/* * Global variables */ /* * Browser properties BEGIN - PLEASE DO NOT MODIFY: CODE GENERATED AUTOMATICALLY */ var browserVendor = "MSIE" ; var browserVendorDetails = "Microsoft Internet Excplorer" ; var browserEngine = "MSIE" ; var browserVersionMajor = 6 ; var browserVersionMinor = 0 ; var browserHostOS = "WIN98" ; var isBrowserSupported = true ; var hasUserBeenWarned = false ; /* * Browser properties END - PLEASE DO NOT MODIFY: CODE GENERATED AUTOMATICALLY */ // insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement() for Netscape 6/Mozilla if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement) { HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode) { switch (where) { case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this) break; case 'afterBegin': this.insertBefore(parsedNode,this.firstChild); break; case 'beforeEnd': this.appendChild(parsedNode); break; case 'afterEnd': if (this.nextSibling) { this.parentNode.insertBefore(parsedNode,this.nextSibling); } else { this.parentNode.appendChild(parsedNode); } break; } } HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var parsedHTML = r.createContextualFragment(htmlStr); this.insertAdjacentElement(where,parsedHTML) } HTMLElement.prototype.insertAdjacentText = function(where,txtStr) { var parsedText = document.createTextNode(txtStr) this.insertAdjacentElement(where,parsedText) } } /* * Image rollover function used by aao cluster homepage */ function swap(iname,swapGfc) { document.images[iname].src = swapGfc; } /* * open a new window */ function openWin(url,str) { return openLargeWin(url,str); } /* * Used by generic popup function to generate params string */ function getArgs(width,height,center,menu){ xposition=0; yposition=0; if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ if (menu==0){ xposition = (screen.width - width) - 10; yposition = (screen.height - height) - 58; } else if(menu==1){ xposition = (screen.width - width) / 2; yposition = ((screen.height - height) / 2) - 67; } } if (navigator.appName == 'Netscape'){ width = width + 25; height = height + 25; } args="width="+width+",height="+height +",toolbar="+menu+",menubar="+menu +",screenx="+ xposition+",screeny="+yposition +",left="+xposition+",top="+yposition +",resizable=1,scrollbars=1,"; return args; } /* * Generic popup function for use in fragments */ function openPopup(pageToLoad, winName, width, height, center){ args=getArgs(width,height,center,0); if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ if(window.popup){ popup.close(); popup=window.open(pageToLoad,winName,args); } } popup=window.open(pageToLoad,winName,args); } /* * Opens a large popup window. */ function openLargeWin(url,windowname) { popWin = window.open(url,windowname,'width=730,height=412,innerWidth=730,innerHeight=412,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,menubar=yes,status=yes,address=yes,location=yes,toolbar=yes'); popWin.focus(); return false; } function fireMenuItem(menu,href,target) { var form = document.forms[menu]; var oldTarget = form.target; form.action=href; form.target=target; form.submit(); if (browserHostOS.indexOf("MAC") == -1) { form.target = oldTarget; } } function fireMenuItemGet(menu,href,target) { if (target != null && target == '_blank') { newWin = window.open(href); newWin.focus(); } else { document.location = href; } } function openAdWin(url,windowname) { popWin = window.open(url,windowname,'width=730,height=412,innerWidth=730,innerHeight=412,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,menubar=yes,status=yes,address=yes,location=yes,toolbar=yes'); popWin.focus(); } function openFeedbackWin(url) { fedbackWin= window.open(url,"feedbackWin",'width=450,height=550,innerWidth=450,innerHeight=550,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); fedbackWin.focus(); } function openURLFeedbackWin() { var url = "/misc/feedback?feedback_badurl=" + location.href; fedbackWin= window.open(url,"feedbackWin",'width=450,height=550,innerWidth=450,innerHeight=550,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); fedbackWin.focus(); } function openHelpWin(url) { fedbackWin= window.open(url,"help",'width=450,height=350,innerWidth=450,innerHeight=350,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); fedbackWin.focus(); } function openSearchTipsWin(url) { searchTipsWin= window.open(url,"searchTipsWin",'width=450,height=350,innerWidth=450,innerHeight=350,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); searchTipsWin.focus(); } /* * id: the MeSH subject id, truncated at after the TOC@@MESH@ character * description: the item description string */ function meshSearchSubmitForm(id, description) { var msForm = document.forms['meshSearch']; msForm.elements['restrictterm_mesh'].value = id; msForm.elements['restrictdesc_mesh'].value = description; msForm.submit(); return false; } function openEcommerceWin(url) { fedbackWin= window.open(url,"help",'width=730,height=412,innerWidth=730,innerHeight=412,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); fedbackWin.focus(); } function openEcommerceWinAndSubmit(url, form) { fedbackWin= window.open(url,"help",'width=730,height=412,innerWidth=730,innerHeight=412,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); form.submit(); fedbackWin.focus(); } function validateEcommerceBillingProvinceFields(form, userZone) { isBillingProvinceDisabled = false ; isBillingUSAProvinceDisabled = false ; if (userZone.length > 0) { if ( (userZone == 'usa') || (userZone == 'canada') ) {isBillingProvinceDisabled = true;} else {isBillingUSAProvinceDisabled = true;} } else { if (form.elements['ecomm_bill_USAStatesCanadaProvinces'].value != '') {isBillingProvinceDisabled = true ;} } form.elements['ecomm_bill_State'].disabled = isBillingProvinceDisabled ; if (isBillingProvinceDisabled) { form.elements['ecomm_bill_State'].style.backgroundColor = "#EEEEEE"; } else { form.elements['ecomm_bill_State'].style.backgroundColor = "#FFFFFF"; } form.elements['ecomm_bill_USAStatesCanadaProvinces'].disabled = isBillingUSAProvinceDisabled ; return false ; } function validateEcommerceShippingProvinceFields(form, userZone) { isShippingDisabled = false ; isShippingProvinceDisabled = false ; isShippingUSAProvinceDisabled = false ; if (userZone.length > 0) { if ( (userZone == 'usa') || (userZone == 'canada')) {isShippingProvinceDisabled = true} else {isShippingUSAProvinceDisabled = true} } else { if (form.elements['ecomm_ship_USAStatesCanadaProvinces'].value != '') {isShippingProvinceDisabled = true ;} } form.elements['ecomm_ship_State'].disabled = isShippingProvinceDisabled ; if (isShippingProvinceDisabled) { form.elements['ecomm_ship_State'].style.backgroundColor = "#EEEEEE"; } else { form.elements['ecomm_ship_State'].style.backgroundColor = "#FFFFFF"; } form.elements['ecomm_ship_USAStatesCanadaProvinces'].disabled = isShippingUSAProvinceDisabled ; return false ; } function validateEcommerceShippingFields(form) { isShippingDisabled = false ; if (form.elements['ecomm_ship_isSame'].checked == true) {isShippingDisabled = true ;} form.elements['ecomm_ship_Title'].disabled = isShippingDisabled ; form.elements['ecomm_ship_FirstName'].disabled = isShippingDisabled ; form.elements['ecomm_ship_LastName'].disabled = isShippingDisabled ; form.elements['ecomm_ship_StreetAddress'].disabled = isShippingDisabled ; form.elements['ecomm_ship_StreetAddress1'].disabled = isShippingDisabled ; form.elements['ecomm_ship_City'].disabled = isShippingDisabled ; form.elements['ecomm_ship_State'].disabled = isShippingDisabled ; form.elements['ecomm_ship_USAStatesCanadaProvinces'].disabled = isShippingDisabled ; form.elements['ecomm_ship_Country'].disabled = isShippingDisabled ; form.elements['ecomm_ship_PostalCodeZIP'].disabled = isShippingDisabled ; } function redirectMain(dest) { try { opener.location.href=dest; } catch (errorCaught) {alert('You have navigated away from the page where the shopping cart was opened. Please refresh the main browser to display the new content.')}; } function refreshMain() { try { opener.location.reload(); } catch (errorCaught) {} } function openAddAlertWin(url) { fedbackWin= window.open(url,"help",'width=650,height=412,innerWidth=730,innerHeight=412,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); fedbackWin.focus(); } function changeActionAndSubmit(formName, actionPrefix) { var form = document.forms[formName] ; if (form.elements['termsConditions1'].checked) { var oldAction = form.action ; form.action = actionPrefix + oldAction ; } form.submit(); } function changeActionAndSubmitFinal(formName, newAction) { var form = document.forms[formName] ; if (form.elements['termsConditions1'].checked) { form.action = newAction; } form.submit(); } function changeFormActionCommand(formName, commandName, commandValue, brandingURL) { var form = document.forms[formName]; form.action = brandingURL + "/ecommerce/buy"; form.target = "_top"; form.elements[commandName].value = commandValue; if(commandValue != null && commandValue != "") { form.submit(); } return false; } function submitToClose(formName, toURL) { var form = document.forms[formName]; form.action = toURL; form.submit(); return false; } function switchTermsCheckboxes(formName, id) { var form = document.forms[formName]; if (id == '1') {form.elements['termsConditions2'].checked = form.elements['termsConditions1'].checked;} else {form.elements['termsConditions1'].checked = form.elements['termsConditions2'].checked;} return false; } /* * formName = the name of the form (string) * mode = the pick mode (string): 'browseBy' or 'browseLetter' or 'find' * value = the pick value string */ function journalSubscribeSubmitForm(formName, mode, value) { var form = document.forms[formName]; form.elements['product'].value = value; if(value != null && value != "") { form.submit(); } return false; } /* * formName = the name of the form (string) * mode = the pick mode (string): 'browseBy' or 'browseLetter' or 'find' * value = the pick value string */ function journalPickerSubmitForm(formName, mode, value) { var form = document.forms[formName]; form.elements['pickMode'].value = mode; form.elements['pickValue'].value = value; if(value != null && value != "") { form.submit(); } return false; } /* * url = the url (string) for the journal picker popup */ function journalPickerOpenWindow(url) { var title = "journalPickerWindow"; var options = "width=400,height=400,innerWidth=400,innerHeight=400,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes"; var journalPickerWin = window.open(url, title, options); journalPickerWin.opener = self; journalPickerWin.focus(); return false; } /* * Adds a journal to opener's list of journals selected (only if it is not already present) * * acronym = the journal acronym (string) * title = the journal title (string) */ function journalPickerAddItem(acronym, title) { var docRef = self.opener.document; // Check if journal is already in the list if(docRef == null) { return false; } return searchFormAddRestriction(acronym,title,docRef) } /* * Updates the visibility of the journal results list and the "other" block. */ function journalPickerUpdateVisibility(documentRef) { var holder = documentRef.getElementById("jp_results_holder"); var other = documentRef.getElementById("jp_other"); if(journalPickerItemHasNoResults(documentRef)) { holder.style.visibility = "hidden"; if(other != null) { other.style.visibility = "visible"; } } else { holder.style.visibility = "visible"; if(other != null) { other.style.visibility = "hidden"; } } return false; } function journalPickerItemHasNoResults(documentRef) { var items = documentRef.getElementsByTagName("div"); for(var i = 0; i < items.length; i++) { var id = items.item(i).getAttribute("id"); if(id != null && id.indexOf("jp_result_") == 0) { return false; } } return true; } function openImgWin(url,windowname) { imgWin = window.open(url,windowname,'width=640,height=480,innerWidth=640,innerHeight=480,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); imgWin.focus(); } function openVideoWin(url,windowname,videoTitle) { // get same style sheets as current page var styles = document.styleSheets; var numberOfStyleSheets = styles.length; var cssLinks = ""; for (var n = 0; n < numberOfStyleSheets; n++) { cssLinks += ''; } // find the title of the article which is placed into a hidden input in a form var title = ""; var form = document.forms["titleForm"]; if (form != null) { var item = form.elements["titleInput"]; if (item != null) { title = item.value; } } // open a blank window imgWin = window.open("",windowname,'width=640,height=480,innerWidth=640,innerHeight=480,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes,toolbar=yes,status=yes'); imgWin.focus(); // replace with the follwing html var markup = '' + '
' + cssLinks + '' + '' + '' + 'Video | '
+ '' + 'close | '
+ '
' + ' | |
'
+ '' + title + ' | '
+ '