/* Astrazeneca.nl Javascript */ exitMessage='U verlaat nu deze website om een site te bezoeken die buiten de verantwoordelijkheid van AstraZeneca BV valt. Wij hebben geen controle op de aard, inhoud en beschikbaarheid van deze site. Klik op "Cancel" om terug te keren naar AstraZeneca.nl of "OK" om deze site te verlaten.'; function addFormValidation(){ //identify the form uses prototype var frm = $('frm_hcp'); //add a function to onsubmit event frm.onsubmit = function(){ return validateEOrderForm(); } } function validateEOrderForm(){ //check that the BIG number is exactly 11 digits long var re = /^\d{11}$/; var fieldValue=$('big_number').value; if(re.test(fieldValue)){ return true; }else{ //invalid BIG-number format alert('U moet een geldige BIG-Nummer invoeren (11 cijfers)'); return false; } } function moveForm(){ //uses prototype var page=$('itemid5730611'); //find the free text panel in the right hand panel which contains the form if(page){ var frm=$('frm_requestform'); if(frm){ $$('#links .free_text_panel').each(function(el){ //is el an ancestor of frm? if(frm.descendantOf(el)){ el.addClassName('content_segmentation_form'); } }); } } } function refreshPageOnce(){ //uses prototype //refresh the request form only once only if segmentation has been applied var page=$('itemid5730611'); if(page){ var href = location.href; var params = href.toQueryParams(); if(params.setSegmentation && !params.refreshed){ href+='&refreshed=true'; location.href=href; } } } 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; //Redirect to this URL window.location=link_chosen; return false; } function switchPageSelect() { //Put the Redirect forms into an array var form_id=new Array; if (document.getElementById('frm_requestform')) { form_id[0]=document.getElementById('frm_requestform'); } if (form_id.length > 0) { for (var i = 0; i < form_id.length; i++) { form_id[i].onsubmit = function () { // On submit tell fnSwitchpage function which form to use return fnSwitchpage(this); } } } } // this method handle the fly-out behaviour function fly_out_handle() { /* * "websitelink" css only used "Other Az Websites" link */ $$('div.websitelink').each(function(s) { // getting all class name var specificClass = $(s).readAttribute('class'); // if websites list is showing then only it will work. if(specificClass.search("collapsed") == -1) { // this part of code gets panelItemId var childElements = $(s).childElements(); var statusObj = childElements[0].down(1); var hrefValue = childElements[0].down(0).readAttribute('href'); var panelItemId; var pageUrl = window.location.href; var status = false; pageUrl.scan(/[?]+/, function(match){ status = true; }); if(status) { pageUrl = pageUrl+"&"; } else { pageUrl = pageUrl+"?"; } hrefValue.scan(/[0-9]+/, function(match){ panelItemId = match; }); //..................................... if(navigator.appName != "Microsoft Internet Explorer") // following code for FF,Opera,Safari { $(s).removeClassName('expanded'); $(s).removeClassName('toexpand'); $(s).addClassName('collapsed'); childElements[0].down(0).setAttribute('href',pageUrl+'expandPanel'+panelItemId+'=true'); statusObj.innerHTML = "expand"; if(childElements[1] == "[object HTMLScriptElement]") { childElements[1].remove(); } else if(childElements[1] == "[object HTMLDivElement]") { childElements[1].remove(); } if(childElements[2] == "[object HTMLDivElement]") { childElements[2].remove(); } } else // following code for IE { $(s).removeClassName('expanded'); $(s).removeClassName('toexpand'); $(s).addClassName('collapsed'); childElements[0].down(0).setAttribute('href',pageUrl+'expandPanel'+panelItemId+'=true'); statusObj.innerHTML = "expand"; if(childElements[1] == "[object]") { childElements[1].remove(); } if(childElements[2] == "[object]") { childElements[2].remove(); } } } }); } function flyoutOnload() { $$('div.hideintro').each(function(s){ $(s).removeClassName('hideintro'); }); fly_out_handle(); // onload method call for fly-out Event.observe(document.body, 'click', function(event) { // method call when clicked any where on the page fly_out_handle(); }); } // this code print the text in search box function showHideTextInSearchbox() { textToDisplay = "Zoeken"; // this test to be displayed if($('searchfield').value == "") $('searchfield').value = textToDisplay; $('searchfield').observe('click', function(event) { if(this.value == textToDisplay) // if user clicks on search box, default text will go { this.value = ""; } }); $('searchfield').observe('blur', function(event) { if(this.value == "") // if user clicks outside the search box, default text will reappear. { this.value = textToDisplay; } }); } /* * SecondLevelNavigation */ function handleSecondLevelNavigation() { $$('ul.nav_menu li').each(function(s) { $(s).observe('mouseover', function(event){ var secondlevelul = $(s).down('ul'); if(secondlevelul != undefined) { secondlevelul.removeClassName('nav_submenu'); s.down('a').addClassName('nav_menu_hover'); } }); $(s).observe('mouseout', function(event){ var secondlevelul = $(s).down('ul'); if(secondlevelul != undefined) { secondlevelul.addClassName('nav_submenu'); s.down('a').removeClassName('nav_menu_hover'); } }); }); } function switchTabs(){ var items = $$('ul.tabs-nav a'); var panels = $$('div.tabs-panel'); items.each(function(el){ el.observe('click',function(e){ if(!e.stopped) e.stop(); items.each(function(e){$(e.parentNode).removeClassName('tabs-selected');}) $(el.parentNode).addClassName('tabs-selected'); var idx=el.href.split("#")[1].toString(); for(i=0;i