var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gPopupIsShown=false;var gHideSelects=false;var gLoading="Loading.html";var gCloseLinkText="Close this Window";var gPopupInit=false;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler}function setCloseDialogLink(A){gCloseLinkText=A}function initPopUp(){gPopupInit=true;var B=document.getElementsByTagName("body")[0];var A=document.createElement("div");A.id="popupMask";var D=document.createElement("div");D.id="popupContainer";D.innerHTML='<div id="popupInner"><div id="popupTitleBar"><div id="popupTitle"></div><div id="popupControls"><a onclick="hidePopWin();">'+gCloseLinkText+'</a></div></div><iframe src="'+gLoading+'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe></div>';B.appendChild(A);B.appendChild(D);gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var C=parseInt(window.navigator.appVersion.charAt(0),10);if(C<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true}addEvent(B,"click",bodyClickEventHandler)}addEvent(window,"load",initPopUp);function bodyClickEventHandler(B){var A=B.target?B.target:B.srcElement;if(A&&(A.nodeType==3||A.nodeType==4)){A=A.parentNode}if((A.id)&&(A.id.indexOf("popupMask")>-1)){hidePopWin()}}function showPopWin(E,G,A,D){if(gPopupInit==false){window.setTimeout("showPopWin('"+E+"',"+G+","+A+");",10);return }var C=getViewportHeight()-4;var B=getViewportWidth()-4;if(A>C){A=C}if(G>B){G=B}gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";positionPopWin(D,G,A);var F=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=G+"px";gPopupContainer.style.height=(A)+"px";gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(A-F)+"px";gPopFrame.src=E;if(gHideSelects==true){hideSelectBoxes()}window.setTimeout("setPopTitleAndRewriteTargets();",100)}function positionPopWin(D,A,I){if(gPopupIsShown==true){if(A==null||isNaN(A)){A=gPopupContainer.offsetWidth}if(I==null){I=gPopupContainer.offsetHeight}var B=YAHOO.util.Dom.get(D);var G=YAHOO.util.Dom.getX(B)+B.offsetWidth;var F=YAHOO.util.Dom.getY(B);var C=YAHOO.util.Dom.getClientRegion();var E=YAHOO.util.Dom.getViewportHeight();var H=YAHOO.util.Dom.getViewportWidth();if((G+A)>C.right){if(C.right>(A+4)){G=(C.right-(A+4))}}if((F+I)>C.bottom){if(C.bottom>(I+4)){F=(C.bottom-(I+4))}}gPopupMask.style.height=E+"px";gPopupMask.style.width=H+"px";gPopupMask.style.top=C.top+"px";gPopupMask.style.left=C.left+"px";gPopupContainer.style.top=F+"px";gPopupContainer.style.left=G+"px"}}addEvent(window,"resize",hidePopWin);window.onscroll=hidePopWin;function hidePopWin(){if(gPopupIsShown){gPopupIsShown=false;restoreTabIndexes();if(gPopupMask==null){return }gPopupMask.style.display="none";gPopupContainer.style.display="none";gPopFrame.src=gLoading;if(gHideSelects==true){displaySelectBoxes()}}}function setPopTitleAndRewriteTargets(){if((window.frames.popupFrame.document.title==null)||(window.frames.popupFrame.document.title=="Loading Dialog Content")){window.setTimeout("setPopTitleAndRewriteTargets();",10)}else{var D=window.frames.popupFrame.document;document.getElementById("popupTitle").innerHTML=D.title;if(D.getElementsByTagName("base").length<1){var B=window.frames.popupFrame.document.getElementsByTagName("a");for(var C=0;C<B.length;C++){if(B.target==null){B[C].target="_parent"}}var A=window.frames.popupFrame.document.getElementsByTagName("form");for(C=0;C<A.length;C++){if(A.target==null){A[C].target="_parent"}}}}}function setPopTitle(){var B=window.frames.popupFrame.document;var A=document.getElementById("popupTitle");if(B&&A){A.innerHTML=B.title}}function keyDownHandler(A){if(gPopupIsShown&&A.keyCode==9){return false}}function disableTabIndexes(){if(document.all){var C=0;for(var B=0;B<gTabbableTags.length;B++){var D=document.getElementsByTagName(gTabbableTags[B]);for(var A=0;A<D.length;A++){gTabIndexes[C]=D[A].tabIndex;D[A].tabIndex="-1";C++}}}}function restoreTabIndexes(){if(document.all){var C=0;for(var B=0;B<gTabbableTags.length;B++){var D=document.getElementsByTagName(gTabbableTags[B]);for(var A=0;A<D.length;A++){D[A].tabIndex=gTabIndexes[C];D[A].tabEnabled=true;C++}}}}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"}}}}function addEvent(D,C,A){if(D.addEventListener){D.addEventListener(C,A,false);return true}else{if(D.attachEvent){var B=D.attachEvent("on"+C,A);return B}else{return false}}}function getViewportHeight(){if(window.innerHeight!=window.undefined){return window.innerHeight}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}return window.undefined}function getViewportWidth(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}return window.undefined}function openDialog(D,E,A,B){var C=(E!=null)?E:400;var F=(A!=null)?A:600;showPopWin(D,F,C,B)}function closeDialog(){window.parent.hidePopWin()};
