var brsVersion=0;var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gPopMSG=null;var gPopMSGContent=null;var gPopMSGIsShown=false;var gHideSelects=false;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler}function showLoader(){showPopMSG()}function hideLoader(){hidePopMSG()}function initPopUp(){gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");gPopMSG=document.getElementById("msgContainer");gPopMSGContent=document.getElementById("msgInnerContent");var cIndex=(parseInt(window.navigator.appVersion.indexOf("MSIE"),10)+5);brsVersion=parseInt(window.navigator.appVersion.charAt(cIndex),10);if(brsVersion<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true}if(document.body.clientHeight>document.body.offsetHeight){gPopupMask.style.height=parseInt(document.body.clientHeight)+'px'}}addEvent(window,"load",initPopUp);function showPopMSG(msgHTML){gPopMSGIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopMSG.style.display="block";centerPopMSG();if(gHideSelects==true){hideSelectBoxes()}if(msgHTML!=null){gPopMSGContent.innerHTML=msgHTML}}function centerPopMSG(){if(gPopMSGIsShown){width=gPopMSG.offsetWidth;height=gPopMSG.offsetHeight;var vWidth=getViewportWidth();var vHeight=getViewportHeight();var theBody=document.documentElement;var theBodyIE=document.body;if(window.navigator.userAgent.indexOf("MSIE")>-1){var fWidth=theBodyIE.scrollWidth;var fHeight=theBodyIE.scrollHeight}else{if(theBodyIE.scrollHeight>theBody.scrollHeight){var fWidth=theBodyIE.scrollWidth;var fHeight=theBodyIE.scrollHeight}else{var fWidth=theBody.scrollWidth;var fHeight=theBody.scrollHeight}}var sTop=parseInt(theBody.scrollTop+theBodyIE.scrollTop,10);var sLeft=parseInt(theBody.scrollLeft+theBodyIE.scrollLeft,10);var sTop=parseInt(theBody.scrollTop+theBodyIE.scrollTop,10);var sLeft=parseInt(theBody.scrollLeft+theBodyIE.scrollLeft,10);gPopupMask.style.width=fWidth+"px";gPopupMask.style.height=fHeight+"px";gPopupMask.style.top="0px";gPopupMask.style.left="0px";gPopMSG.style.top=(sTop+((vHeight-height)/2))+"px";gPopMSG.style.left=(sLeft+((vWidth-width)/2))+"px"}}function hidePopMSG(){gPopMSGIsShown=true;restoreTabIndexes();if(gPopupMask==null){return}gPopupMask.style.display="none";gPopMSG.style.display="none";if(gHideSelects==true){displaySelectBoxes()}}
function showPopWin(url,width,height,returnFunc,rVal){
	hidePopWin(false);
	if(height>=((document.body.clientHeight+document.documentElement.clientHeight)-50)){
		height=(document.body.clientHeight+document.documentElement.clientHeight)-200
	}
	gPopupIsShown=true;
	disableTabIndexes();
	gPopupMask.style.display="block";
	gPopupContainer.style.display="block";
	centerPopWin(width,height);
	var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);
	gPopupContainer.style.width=width+"px";
	gPopupContainer.style.height=(height+titleBarHeight)+"px";
	gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)-2+"px";
	gPopFrame.style.height=(height)+"px";
	gPopFrame.src=url;
	gReturnFunc=returnFunc;
	if(gHideSelects==true){
		hideSelectBoxes()
	}
	
	if (rVal == 1) {
		//urchinTracker(url);
		return false;
	}
}
function showPopWinDelay(url,width,height,returnFunc){window.parent.hidePopWin(false);window.parent.setTimeout('showPopWin("'+url+'", '+width+', '+height+', '+returnFunc+');',10)}var gi=0;function centerPopWin(width,height){if(gPopupIsShown==true){if(width==null||isNaN(width)){width=gPopupContainer.offsetWidth}if(height==null){height=gPopupContainer.offsetHeight}var vWidth=getViewportWidth();var vHeight=getViewportHeight();var theBody=document.documentElement;var theBodyIE=document.body;if(window.navigator.userAgent.indexOf("MSIE")>-1){var fWidth=theBodyIE.scrollWidth;var fHeight=theBodyIE.scrollHeight}else{if(theBodyIE.scrollHeight>theBody.scrollHeight){var fWidth=theBodyIE.scrollWidth;var fHeight=theBodyIE.scrollHeight}else{var fWidth=theBody.scrollWidth;var fHeight=theBody.scrollHeight}}if(vHeight>fHeight){fHeight=vHeight}var sTop=parseInt(theBody.scrollTop+theBodyIE.scrollTop,10);var sLeft=parseInt(theBody.scrollLeft+theBodyIE.scrollLeft,10);gPopupMask.style.width=fWidth+"px";gPopupMask.style.height=fHeight+"px";gPopupMask.style.top="0px";gPopupMask.style.left="0px";var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.top=(sTop+((vHeight-(height+titleBarHeight))/2))+"px";gPopupContainer.style.left=(sLeft+((vWidth-width)/2))+"px"}}function popRS(){if(gPopupIsShown){window.frames["pWindow"].getPopTitleW();window.frames["pWindow"].resizePopWin();centerPopWin()}}addEvent(window,"resize",popRS);addEvent(window,"scroll",centerPopWin);addEvent(window,"scroll",centerPopMSG);window.onscroll=centerPopWin;window.onscroll=centerPopMSG;function hidePopWin(callReturnFunc){gPopupIsShown=false;restoreTabIndexes();if(gPopupMask==null){return}gPopupMask.style.display="none";gPopupContainer.style.display="none";if(callReturnFunc==true&&gReturnFunc!=null){gReturnFunc(window.frames["pWindow"].returnVal)}gPopFrame.src='/_ssi/_loading.html';if(gHideSelects==true){displaySelectBoxes()}document.getElementById("popupTitle").innerHTML=""}function setPopTitle(){if((window.frames["pWindow"].document.title==null)||(window.frames["pWindow"].document.title.length==0)){window.setTimeout("window.setPopTitle()",10)}else{window.document.getElementById("popupTitle").innerHTML=window.frames["pWindow"].document.title}}function keyDownHandler(e){if(gPopupIsShown&&e.keyCode==9)return false}function disableTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){gTabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++}}}}function restoreTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=gTabIndexes[i];tagElements[k].tabEnabled=true;i++}}}}function hideSelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="hidden"}}}}function displaySelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="visible"}}}}
