ADS.addEvent(window,"load",initDynElements);ADS.addEvent(window,"load",initForm);ADS.addEvent(window,"load",initCollapsed);ADS.addEvent(window,"load",initAddtlInfo);function initDynElements(){var A="";var B="";var I=getURLParam("goto");logMsg("initDynElemets: gotoParam="+I);if(getURLParam("ahasite")!=null&&getURLParam("ahasite")!=""){logMsg("initDynElemets: ahasite param exists");B=getURLParam("ahasite").toUpperCase();A=B.toLowerCase()}else{if(I!=null&&I!=""){logMsg("initDynElemets: ahasite param does not exist");if(I.match(/ams\.aha\.org/)!=null){var H=I.match(/ahabu=.+/i);if(H!=null&&H!=""){var E=H[0].replace(/ahabu=/,"");logMsg("initDynElements: ahabu="+E);A=E}}else{var G=I.split(".");A=G[1]}}}if(A==""){A="aha"}B=A.toUpperCase();logMsg("initDynElements: site="+B);var J=ADS.$("OAMloginform");if(J){J.action="http://sso.aha.org/opensso/UI/Login?ahasite="+B;C=ADS.$("goto");if(C){C.value=(I!=""&&I!=null)?I:""}}logMsg("initDynElements: "+A+" links being set");var D=A;A=A.replace(/-/,"");var C=null;if(A=="osso"){A="hospitalconnect";D="hospitalconnect"}if(A=="ashe"||A=="ashhra"||A=="aone"||A=="aha"){D="oam-"+D}if(A in PORTAL){logMsg("initDynElements: domain in PORTAL: setting links");var F="";if(I!=null&&I!=""){F=encodeURIComponent(I)}else{F="http://www."+PORTAL[A]+"/"+D+"/oam/welcome.html"}C=ADS.$("logoLink");if(C){C.href="http://www."+PORTAL[A]}C=ADS.$("indivMsg");if(C){if(A!="aha"){C.style.display="block"}}C=ADS.$("helpPageLink");if(C){C.href="http://www."+PORTAL[A]+"/"+D+"/oam/help.html"}C=ADS.$("privacyPageLink");if(C){C.href="http://www."+PORTAL[A]+"/"+D+"/oam/privacy.html"}C=ADS.$("contactPageLink");if(C){C.href="http://www."+PORTAL[A]+"/"+D+"/oam/contact_us.html"}C=ADS.$("forgotPasswordLink");if(C){C.href=OAMLINK.forgotPassword+"?ahasite="+B+"&goto=http://www."+PORTAL[A]+"/"+D+"/oam/welcome.html"}C=ADS.$("registerLink");if(C){C.href=OAMLINK.register+"&AHABU="+B+"&RedirectURL="+F}C=ADS.$("browserReqLink");if(C){C.href="http://www.hospitalconnect.com/oam/error/browser_req.jsp?domain="+B}C=ADS.$("loginLogoImg");if(C){C.src="http://i.aha.org/oam/images/logos/"+B+".gif";C.alt=ADS.$("logoLink").href}C=ADS.$("errorLogoImg");if(C){C.src="http://i.aha.org/oam/images/logos/"+B+".gif";C.alt=ADS.$("logoLink").href}}}function initForm(){var A=ADS.$("OAMloginform");if(A){ADS.addEvent(A.remember_me,"click",setRememberMe)}}function setRememberMe(){var A=ADS.$("OAMloginform");if(A.remember_me.value=="yes"){logMsg("validateForm: Remember Me Yes: setting field...");ADS.$("iPSPCookie").value="yes"}else{logMsg("validateForm: Remember Me No: setting field...");ADS.$("iPSPCookie").value="no"}return }function initCollapsed(){var A=document.getElementsByTagName("div");for(var B=0;B<A.length;B++){if(A[B].className=="collapsible"){var C=A[B].firstChild;while(C.nodeName.toLowerCase()!="h1"){C=C.nextSibling}A[B].tween=new Tween(A[B],"height",C.scrollHeight,A[B].scrollHeight,500,"px");A[B].style.height=C.scrollHeight+"px";C.onclick=function(){if(!this.parentNode.tween.playing){this.style.backgroundImage="url("+(this.parentNode.tween.position==0?"/oam/images/minus.gif":"/oam/images/plus.gif")+")";this.parentNode.tween.play()}}}}}function initAddtlInfo(){if(document.getElementById("remember_me")){var A=document.getElementById("remember_me");var B=document.getElementById("addtlInfo");A.tween=new Tween(B,"height",0,B.scrollHeight,300,"px");B.style.height=0;A.onclick=function(){this.tween.play()}}}PositionX=100;PositionY=100;defaultWidth=500;defaultHeight=500;var AutoClose=true;if(parseInt(navigator.appVersion.charAt(0))>=4){var isNN=(navigator.appName=="Netscape")?1:0;var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0}var optNN="scrollbars=no,width="+defaultWidth+",height="+defaultHeight+",left="+PositionX+",top="+PositionY;var optIE="scrollbars=no,width=150,height=100,left="+PositionX+",top="+PositionY;function popImage(imageURL,imageTitle){if(isNN){imgWin=window.open("about:blank","",optNN)}if(isIE){imgWin=window.open("about:blank","",optIE)}with(imgWin.document){writeln("<html><head><title>Loading...</title><style>body{margin:0px;}</style>");writeln("<script>");writeln("var isNN,isIE;");writeln("if (parseInt(navigator.appVersion.charAt(0))>=4){");writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');writeln("function reSizeToImage(){");writeln("if (isIE){");writeln("window.resizeTo(300,300);");writeln("width=300-(document.body.clientWidth-document.images[0].width);");writeln("height=300-(document.body.clientHeight-document.images[0].height);");writeln("window.resizeTo(width,height);}");writeln("if (isNN){");writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln("<\/script>");if(!AutoClose){writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')}else{writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">')}writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');close()}};
