/* AZ Italy additional JS functions */ function submitJobActionFunc(param) { $('submitJobAction').value = param; $('jobSchedulerForm').submit(); } function images_toggle(id,imageid,offset){ var image = document.getElementById(id); var image_div = document.getElementById(imageid); if (image.style.display=="none"){ image.style.display="block"; image.style.visibilty="visible"; } else { image.style.display="none"; image.style.visibilty="hidden"; } } function link_toggle(id, imageid, offset) { var image = document.getElementById(id); var image_div = document.getElementById(imageid); if (image.style.display == "none") { image.style.display = "block"; image.style.visibilty = "visible"; } else { image.style.display = "none"; image.style.visibilty = "hidden"; } } function hideEmail(){ //Check for conference item var confCheck = document.getElementById('conference'); if ( confCheck != null){ var ctnt = document.getElementById('contentholder'); var getDT = ctnt.getElementsByTagName('dt'); var getDD = ctnt.getElementsByTagName('dd'); if(getDT.length > 0){ for(var i = 0; i < getDT.length ;i++){ // 5 th field is email field if(i == 5 ){ getDT[i].style.display = 'none'; getDD[i].style.display = 'none'; } } } } } function unsubscribe(){ if($$('input[name="unsubscribe"]').length>0){ $('siteRegistration').observe('submit',function(evt){ if(!evt.stopped){ evt.stop(); } $('siteRegistration').request({ onComplete:function(){ window.location='../unsubscribe-thank-you/'; } }); }); } } function randomFunction(){ /*Disable email field in Feedback form*/ if(!!$('feedback_form_view')){ if(!!$('fielddiv0')){ $$('#fielddiv0 input').each(function(el){el.disabled=true;}) } } } function setCountry(){ /*Default country selection during Registration 728*/ if(!!$('sp_registration_main')){ if(!$('country').disabled){ $('country').selectedIndex='2'; $('country').disabled=true; } } } // this code print the text in search box function showHideTextInSearchbox() { textToDisplay = "Search"; // 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; } }); } // This method handles 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(); }); } /* * 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 hideCountry(){ if(!!$('sp_registration_email') || !!$('sp_registration_main')){ var arr =[$('postCode').next('label'), $('country')] arr.each(function(el){el.hide();}) } } var toCall = new Array(); toCall[0]=images_toggle; toCall[1]=hideEmail; toCall[2]=unsubscribe; toCall[3]=randomFunction; toCall[4]=setCountry; toCall[5]=flyoutOnload; toCall[6]=showHideTextInSearchbox; toCall[7]=handleSecondLevelNavigation; toCall[8]=link_toggle; toCall[9]=hideCountry;