function togPop(whichPop)
{
	$(whichPop).toggleClassName('activePopUp');
}
/* This function should be called once onLoad by any page using the activePopUp system */
function watchPopups()
{
	Event.observe(document.body, 'click', function(event) {
		var activeElements=$('pb-pgBody').select('.activePopUp');
		var element = Event.element(event);
		var whichEl=((element.id).empty()) ? 'pb-pgBody' : element.id;
		for (var i=0; i<activeElements.length; i++)
		{
			if (activeElements[i].id != whichEl && (! $(whichEl).descendantOf(activeElements[i].id) ))
			{
				activeElements[i].removeClassName('activePopUp');
			}
		}
	});
}
function showTab(whichTabSet,whichTab)
{
	var aE=$(whichTabSet).select('.activeBlock');
	aE.invoke('removeClassName','activeBlock');
	$(whichTab+'Tab').addClassName('activeBlock');
	$(whichTab+'TabContent').addClassName('activeBlock');
}
/* This function requires prototype,scriptaculous with effects, and lightview */
function divToModal(whichDiv,whatTitle,whatWidth,whatHeight)
{
	if ((typeof whatWidth != "undefined")&&(typeof whatHeight != "undefined")){
		Lightview.show({
			href: '#'+whichDiv,
			rel: 'inline',
			title: whatTitle,
			caption: '',
			options: {
				width:whatWidth,
				height:whatHeight,
				topclose: false,
				overlayClose: false
			}
		});		
	}
	else
	{
		Lightview.show({
			href: '#'+whichDiv,
			rel: 'inline',
			title: whatTitle,
			caption: '',
			options: {
				autosize: true,
				topclose: false,
				overlayClose: false
			}
		});
	}
	$(whichDiv).focus();
}

/* This function requires prototype,scriptaculous with effects, and lightview */
function closeModalDiv(whichDiv,returnToPoint)
{
	Lightview.hide();
	if ((typeof returnToPoint != "undefined")&&(document.getElementById(returnToPoint))){
		document.getElementById(returnToPoint).focus();
	}
}
/* BEGIN: These variables and functions are currently only being used by the Google Search Code */
var qsParm = new Array();
function URLDecode(psEncodeString)
{
  var lsRegExp = /\+/g;
  return unescape(String(psEncodeString).replace(lsRegExp, " "));
}
function getQueryString()
{
  var query = window.location.search.substring(1);
  var parms = query.split('&');
  for (var i=0; i<parms.length; i++){
  	var pos = parms[i].indexOf('=');
  	if (pos > 0){
  		var key = parms[i].substring(0,pos);
  		var val = parms[i].substring(pos+1);
  		qsParm[key] = val;
  	}
  }
}
/* END: These variables and functions are currently only being used by the Google Search Code */
/* BEGIN: cookie functions used by Pitneyworks UK and France customer offers */
function temp_createCookie(name,value,days) {
                if (days) {
                                var date = new Date();
                                date.setTime(date.getTime()+(days*24*60*60*1000));
                                var expires = "; expires="+date.toGMTString();
                }
                else var expires = "";
                document.cookie = name+"="+value+expires+"; path=/";
}
function temp_readCookie(name) {
                var nameEQ = name + "=";
                var ca = document.cookie.split(';');
                for(var i=0;i < ca.length;i++) {
                                var c = ca[i];
                                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
                }
                return null;
}
function temp_eraseCookie(name) {
                createCookie(name,"",-1);
}
/* END: cookie functions used by Pitneyworks UK and France customer offers */