/* Seroquel additional JS functions */ var pageTracker; var timesCalled = 0; function setPageTracker(){ if( timesCalled > 5){ //quit, too many retries return; } try { pageTracker = _gat._getTracker("UA-10573087-7"); pageTracker._trackPageview(); pageTracker._setVar("gateway"); } catch(err) { //perhaps it isn't loaded yet. wait a second and try again timesCalled += 1; setPageTracker.delay(1); } } function addLandingPageTrackingCode(){ var landingPage = $('landing_page_overlay'); if(landingPage){ //add the google tracking code to the landing page overlay - it is included on every other page anyway var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); if(document.createElement){ var elScript=document.createElement('script'); if(elScript){ elScript.src=gaJsHost + 'google-analytics.com/ga.js'; elScript.type='text/javascript'; //get a handle to this script file var elHead=document.getElementsByTagName('head'); if(elHead){ //get script var elExistingScript=document.getElementsByTagName('script'); if(elExistingScript){ //add into head before previous element elHead[0].insertBefore(elScript,elExistingScript[0]); } } } } //add a specific variable to identify the landing page setPageTracker(); //now, try to track the two anchors on the landing page as requested if($$('a[href="http://www.astrazeneca.co.uk"]').size() > 0){ $$('a[href="http://www.astrazeneca.co.uk"]')[0].observe('click', function(event){ if(!Object.isUndefined(pageTracker)){ pageTracker._trackEvent('extnerallinks', 'click', 'Seroquel UK website'); } }); } if($$('a[href="http://www.seroquel.com"]').size() > 0){ $$('a[href="http://www.seroquel.com"]')[0].observe('click', function(el){ if(!Object.isUndefined(pageTracker)){ pageTracker._trackEvent('extnerallinks', 'click', 'Seroquel US website'); } }); } } } function fnSwitchpage(the_form){ //Get the selected link URL from the dropdown var link_chosen; link_chosen=the_form.selection.options[the_form.selection.selectedIndex].value; if(!Object.isUndefined(pageTracker)){ pageTracker._trackEvent('extnerallinks', 'click', the_form.selection.options[the_form.selection.selectedIndex].value); } //Redirect to this URL window.location=link_chosen; return false; } function hideSearchText(the_form) { var defaultValue; var inputValue; inputValue=the_form.bsterm.value; if(inputValue == 'Search Seroquel.info here'){ the_form.bsterm.value = ''; } else if(inputValue == '' || inputValue == null){ the_form.bsterm.value = 'Search Seroquel.info here'; } } var toCall = []; toCall[0]=addLandingPageTrackingCode;