/* FILE ARCHIVED ON 3:35:45 Jan 12, 2013 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 0:46:27 Oct 18, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ // /prod/webdocs/htdocs/amednews/scripts/amn.js // amednews js scripts (ehs ad processing is separate) // vars for login/logout routines // NOTE these shd be should be changed to the appropriate // domain for use on the staging site var ssoURLBase = "https://webarchive.library.unt.edu/web/20130112033545/https://ssl3.ama-assn.org/apps"; var amnewsHomeURL = "https://webarchive.library.unt.edu/web/20130112033545/http://www.ama-assn.org/amednews/"; // PRINTME functionality - now handled in R-bar SSIs //function print_page() {window.print();} //function prt() {var p=1;} // generic AMA logout-link writer // copied w/mods from "https://webarchive.library.unt.edu/web/20130112033545/http://www.ama-assn.org/ama1/js/ama-default.js" function logoutLink(sessionTitle) { var ldap = document.cookie.indexOf("AMAHTTPSESSIONID"); if (ldap != -1) { //document.write('LOG OUT'); //document.write('LOG OUT'); document.write(' Log out '); } } // logIN link writer (analogous to logoutLink) // allows us to have an explicit login link, not just folks will click on content function loginLink(sessionTitle) { var ldap = document.cookie.indexOf("AMAHTTPSESSIONID"); if (ldap == -1) { var loginUrl = ssoURLBase + "/xsite/x-amnews/xsite.cgi?site=" + escape(document.location); document.write(' Log in '); } } // same but just writes the link itself // does not check for logged in state, as going only to Limited pages function loginLim(sessionTitle) { var loginUrl = ssoURLBase + "/xsite/x-amnews/xsite.cgi?site=" + escape(document.location); document.write(' Log in '); } // generic AMA cookie grabber function getCookie(cookieName) { var cookieStr = "" + document.cookie; var index1 = cookieStr.indexOf(cookieName); if (index1 == -1 || !cookieName) { return ""; } var index2 = cookieStr.indexOf(";", index1); if (index2 == -1) { index2 = cookieStr.length; } return(unescape(cookieStr.substring(index1 + cookieName.length + 1, index2))); } // Multi-browser "bookmark this page" function bkmark(title,url){ if (window.sidebar) // firefox alert('Press CTRL+D to bookmark after popup closes'); else if(window.opera && window.print){ // opera var elem = document.createElement('a'); elem.setAttribute('href',url); elem.setAttribute('title',title); elem.setAttribute('rel','sidebar'); elem.click(); } else if(document.all)// ie window.external.AddFavorite(url, title); } // "link to this page" function poplink(fname) { newwindow2=window.open('','name','height=250,width=550,left=120,top=420'); var tmp = newwindow2.document; tmp.write('Link to this page - American Medical News'); tmp.write(''); tmp.write('

To link to this page, simply copy and paste the following HTML code:

'); tmp.write('

<a href="'+self.location.href+'"><i>American Medical News</i>: '+fname+'</a>

'); tmp.write('

Close window

'); tmp.write(''); tmp.close(); }