/* Simply4Doctors Australia additional JS functions */ //define the message for the exit ramp exitMessage='Thank you for visiting the simply4doctors website. You are now leaving the site. Please note that the information provided on external websites may not comply with Australian regulatory requirements. Please refer to individual Company Product Information for information relevant to the Australian environment.'; function addMasterScript(){ //this adds in the master root.js file which includes all basic JS functionality //this must be included in all local js files //Do not copy code from the root.js file, use this function to import it instead if(document.getElementById){ //browser supports getElementById - attempt to add js functionality //this is a site-specific js file so include the master //create a script element if(document.createElement){ elRootScript=document.createElement('script'); if(elRootScript){ //include master file elRootScript.src='/_mshost81109/system/styles/root/javascript/root.js'; //elRootScript.src='../styles/root/javascript/root.js'; elRootScript.type='text/javascript'; //get a handle to this script file elHead=document.getElementsByTagName('head'); if(elHead){ //get script elExistingScript=document.getElementsByTagName('script'); if(elExistingScript){ //add into head before previous element elHead[0].insertBefore(elRootScript,elExistingScript[0]); //attachEvents function is called when the master file loads //so global functionality is still enabled } } elScript=document.createElement('script'); elScript.src='/_mshost81109/system/styles/root/javascript/calculator.js'; elScript.type='text/javascript'; if(elHead){ //get script elExistingScript=document.getElementsByTagName('script'); if(elExistingScript){ //add into head before previous element elHead[0].insertBefore(elScript,elExistingScript[0]); } } } } } } //call the above function addMasterScript(); var toCall=new Array; toCall[0]=decorateAAP; toCall[1]=attachExitRamps; function decorateAAP(){ //is this an AAP news article? var contentFooter=document.getElementById('contentfooter'); if(contentFooter){ //check inner text of source dd var dd=contentFooter.getElementsByTagName('dd'); if(dd){ ddInnerText=dd[0].innerHTML; if(ddInnerText.indexOf('Australian Associated Press')!==-1){ //it is an AAP article var href='http://www.simply4doctors.com.au/current-news/?itemId=1329489'; //create the link to right of article_header var upper_div = document.createElement('div'); upper_div.setAttribute('id','news_provider_upper'); var upper_a = document.createElement('a'); upper_a.href=href; linkText=document.createTextNode('Brought to you by AAP'); upper_a.appendChild(linkText); upper_div.appendChild(upper_a); //add in to right of article_header //if there is an introductory paragraph, add it to that var inserted=false; contentHolder=document.getElementById('contentholder'); if(contentHolder){ contentChildren=contentHolder.getElementsByTagName('p'); if(contentChildren){ //are there any tags whose direct parent is contentHolder? for(i=0;i=4&&links[i].href.substring(0,4)=='http'){ attr=getAttributeCrossBrowser(links[i],'class'); if(attr){ attr+=' external'; }else{ attr='external'; } setAttributeCrossBrowser(links[i],'class',attr); } } findExitRamps(); } } }