var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gHideSelects=false;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler}function initPopUp(){gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var A=parseInt(window.navigator.appVersion.charAt(0),10);if(A<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true}}addEvent(window,"load",initPopUp);function showPopWin(D,B,A,C){gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";centerPopWin(B,A);var E=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=B+"px";gPopupContainer.style.height=(A+E)+"px";gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(A)+"px";gPopFrame.src=D;gReturnFunc=C;if(gHideSelects==true){hideSelectBoxes()}window.setTimeout("setPopTitle();",600)}var gi=0;function centerPopWin(A,D){if(gPopupIsShown==true){if(A==null||isNaN(A)){A=gPopupContainer.offsetWidth}if(D==null){D=gPopupContainer.offsetHeight}var G=getViewportHeight();var C=getViewportWidth();var B=document.documentElement;var E=parseInt(B.scrollTop,10);var F=parseInt(B.scrollLeft,10);gPopupMask.style.height=G+"px";gPopupMask.style.width=C+"px";gPopupMask.style.top=E+"px";gPopupMask.style.left=F+"px";window.status=gPopupMask.style.top+" "+gPopupMask.style.left+" "+gi++;var H=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.top=(E+((G-(D+H))/2))+"px";gPopupContainer.style.left=(F+((C-A)/2))+"px"}}addEvent(window,"resize",centerPopWin);window.onscroll=centerPopWin;function hidePopWin(A){gPopupIsShown=false;restoreTabIndexes();if(gPopupMask==null){return}gPopupMask.style.display="none";gPopupContainer.style.display="none";if(A==true&&gReturnFunc!=null){gReturnFunc(window.frames["popupFrame"].returnVal)}gPopFrame.src="loading.html";if(gHideSelects==true){displaySelectBoxes()}}function setPopTitle(){if(window.frames["popupFrame"].document.title==null){window.setTimeout("setPopTitle();",10)}else{document.getElementById("popupTitle").innerHTML=window.frames["popupFrame"].document.title}}function keyDownHandler(A){if(gPopupIsShown&&A.keyCode==9){return false}}function disableTabIndexes(){if(document.all){var B=0;for(var C=0;C<gTabbableTags.length;C++){var A=document.getElementsByTagName(gTabbableTags[C]);for(var D=0;D<A.length;D++){gTabIndexes[B]=A[D].tabIndex;A[D].tabIndex="-1";B++}}}}function restoreTabIndexes(){if(document.all){var B=0;for(var C=0;C<gTabbableTags.length;C++){var A=document.getElementsByTagName(gTabbableTags[C]);for(var D=0;D<A.length;D++){A[D].tabIndex=gTabIndexes[B];A[D].tabEnabled=true;B++}}}}function hideSelectBoxes(){for(var A=0;A<document.forms.length;A++){for(var B=0;B<document.forms[A].length;B++){if(document.forms[A].elements[B].tagName=="SELECT"){document.forms[A].elements[B].style.visibility="hidden"}}}}function displaySelectBoxes(){for(var A=0;A<document.forms.length;A++){for(var B=0;B<document.forms[A].length;B++){if(document.forms[A].elements[B].tagName=="SELECT"){document.forms[A].elements[B].style.visibility="visible"}}}};
