var winReference=null;

function openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName){
	var agent=navigator.userAgent.toLowerCase();
	if(agent.indexOf("mac")!=-1&&agent.indexOf("msie")!=-1&&(agent.indexOf("msie 4")!=-1||agent.indexOf("msie 5.0")!=-1)){
		height+=(status)?17:2
	}
	width+=(scrollbars!=""&&scrollbars!=null&&agent.indexOf("mac")==-1)?16:0;
	var properties="width="+width+",height="+height+",screenX="+x+",screenY="+y+",left="+x+",top="+y+((status)?",status":"")+",scrollbars"+((scrollbars)?"":"=no")+((moreProperties)?","+moreProperties:"");
	var reference=openWindow(url,name,properties,openerName);
	return reference
}

function openCenteredWindow(url,name,width,height,status,scrollbars,moreProperties,openerName){
	var x,y=0;
	if(screen){
		x=(screen.availWidth-width)/2;
		y=(screen.availHeight-height)/2}
		if(!status){
			status=""
		}
		if(!openerName){
			openerName=""
		}
		var reference=openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName);
		return reference
}
	
function openCenteredOnOpenerWindow(url,name,width,height,status,scrollbars,moreProperties,openerName){
	var centerX=0;
	var centerY=0;
	if(window.screenX!=null&&window.outerWidth){
		centerX=window.screenX+(window.outerWidth/2);
		centerY=window.screenY+(window.outerHeight/2)
	}
	else{
		if(window.screenLeft){
			if(document.documentElement){
				centerX=window.screenLeft+(document.documentElement.offsetWidth/2);
				centerY=window.screenTop+(document.documentElement.offsetHeight/2)
			}
			else{
				if(document.body&&document.body.offsetWidth){
					centerX=window.screenLeft+(document.body.offsetWidth/2);
					centerY=window.screenTop+(document.body.offsetHeight/2)
				}
			}
		}
	}
	if(centerX==0){
		openCenteredWindow(url,name,width,height,status,scrollbars,moreProperties,openerName)
	}
	var x=parseInt(centerX-(width/2));
	var y=parseInt(centerY-(height/2));
	if(!status){status=""}
	if(!openerName){openerName=""}
	var reference=openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName);
	return reference
}

function openMaxedWindow(url,name,scrollbars,openerName){var x,y=0;var width=600;var height=800;if(screen){if(screen.availLeft){x=screen.availLeft;y=screen.availTop}width=screen.availWidth-6;height=screen.availHeight-29}var reference=openPositionedWindow(url,name,width,height,x,y,false,scrollbars,openerName);return reference}

function openFullChromeWindow(url,name,openerName){return openWindow(url,name,"directories,location,menubar,resizable,scrollbars,status,toolbar")}

function openSizedFullChromeWindow(url,name,width,height,openerName){return openCenteredWindow(url,name,width,height,true,true,"directories,location,menubar,resizable,toolbar",openerName)}

function openWindow(url,name,properties,openerName){
	var agent=navigator.userAgent.toLowerCase();
	if(agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)==4&&agent.indexOf("msie 5")==-1&&agent.indexOf("msie5")==-1&&agent.indexOf("win")!=-1&&url.indexOf("http://")==0){
		winReference=window.open("about:blank",name,properties);
		setTimeout('if (winReference && !winReference.closed) winReference.location.replace("'+url+'")',300)
	}
	else{
		winReference=window.open(url,name,properties)
	}
	setTimeout("if (winReference && !winReference.closed) winReference.focus()",200);
	if(openerName){
		self.name=openerName
	}
	return winReference
}

function closeDialog(dialog){if(dialog&&dialog.closed!=true){dialog.close()}}function closeParentDialog(){if(top.opener&&isWindowPopup(top.opener)){root=top.opener.top.opener;top.opener.close();top.opener=root}}function isWindowPopup(win){return((win.opener)?true:false)}function cleanTerm(aTerm){cleaned=new String();for(var j=0;j<aTerm.length;j++){if((aTerm.charAt(j)>"a"&&aTerm.charAt(j)<="z")||(aTerm.charAt(j)>="A"&&aTerm.charAt(j)<="Z")){cleaned+=aTerm.charAt(j)}}return cleaned}function encodeSpace(withSpaces){var encoded=new String();for(var j=0;j<withSpaces.length;j++){if(withSpaces.charAt(j)=="+"){encoded+="%2B"}else{if(withSpaces.charAt(j)==" "){encoded+="+"}else{encoded+=withSpaces.charAt(j)}}}return encoded}function obGlossaryCall(glossary_term){obCall=new String();obCall="/information/pop_glossary.jsp?term="+encodeSpace(glossary_term);return obCall}function popUp(aLink){aWindow=window.open(obGlossaryCall(aLink),cleanTerm(aLink),"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=400")}function findPosX(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent}}else{if(obj.x){curleft+=obj.x}}return curleft}function findPosY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent}}else{if(obj.y){curtop+=obj.y}}return curtop}function setRollPrice(divpId,text,posLeft,posTop){var divp=document.getElementById(divpId);posLeft=(posLeft)?posLeft:50;posTop=(posTop)?posTop:50;if(text.indexOf(">")<text.indexOf("<")){text=text.slice(text.indexOf(">")+1,text.length)}if(!divp){divp=document.createElement("div");divp.id=divpId;divp.style.position="absolute";divp.style.background="#FFFFFF";divp.style.border="1px solid #B1B6BC";divp.style.color="#990000";divp.style.padding="3px";divp.style.width="90px";divp.style.textAlign="center";divp.innerHTML="<b>Your price<br />"+text;document.body.appendChild(divp);divp=document.getElementById(divpId)}divp.onmouseover=function(){showRollPrice(divpId)};divp.onmouseout=function(){hideRollPrice(divpId)};divp.style.left=posLeft+"px";divp.style.top=posTop+"px";divp.style.display="block"}function showRollPrice(divpId){var divp=document.getElementById(divpId);divp.style.display="block"}function hideRollPrice(divpId){var divp=document.getElementById(divpId);divp.style.display="none"}function setCallPrice(divpId,text,posLeft,posTop){var divp=document.getElementById(divpId);posLeft=(posLeft)?posLeft:50;posTop=(posTop)?posTop:50;if(text.indexOf(">")<text.indexOf("<")){text=text.slice(text.indexOf(">")+1,text.length)}if(!divp){divp=document.createElement("div");divp.id=divpId;divp.style.position="absolute";divp.style.background="#FFFFFF";divp.style.border="1px solid #B1B6BC";divp.style.color="#000000";divp.style.padding="3px";divp.style.width="90px";divp.style.textAlign="left";divp.innerHTML=" "+text;document.body.appendChild(divp);divp=document.getElementById(divpId)}divp.onmouseover=function(){showCallPrice(divpId)};divp.onmouseout=function(){hideCallPrice(divpId)};divp.style.left=posLeft+"px";divp.style.top=posTop+"px";divp.style.display="block"}function showCallPrice(divpId){var divp=document.getElementById(divpId);divp.style.display="block"}function hideCallPrice(divpId){var divp=document.getElementById(divpId);divp.style.display="none"};