function isIE() { return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent); } function rightString(fullString, subString) { if (fullString.indexOf(subString) == -1) { return ""; } else { return (fullString.substring(fullString.indexOf(subString)+subString.length, fullString.length)); } } function Set_Cookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below will set it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } function Get_Cookie( check_name ) { // first we'll split this cookie up into name/value pairs // note: document.cookie only returns name=value, not the other components var a_all_cookies = document.cookie.split( ';' ); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; // set boolean t/f default f for ( i = 0; i < a_all_cookies.length; i++ ) { // now we'll split apart each name=value pair a_temp_cookie = a_all_cookies[i].split( '=' ); // and trim left/right whitespace while we're at it cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); // if the extracted name matches passed check_name if ( cookie_name == check_name ) { b_cookie_found = true; // we need to handle case where cookie has no value but exists (no = sign, that is): if ( a_temp_cookie.length > 1 ) { cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ); } // note that in cases where cookie is initialized but no value, null is returned return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if ( !b_cookie_found ) { return null; } } function Delete_Cookie( name, path, domain ) { if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } //This function lets the browser sleep for the time (in s) that was given as input function aspmlSleep(timetosleep){ timetosleep = timetosleep * 1; var sleeping = true; var now = new Date(); var dtalarm; var startingms = now.getTime(); var alarmms = null; //alert("start sleeping at: " + startingms + "\n going to sleep for: " + timetosleep + " s"); while(sleeping){ dtalarm = new Date(); alarmms = dtalarm.getTime(); if(alarmms - startingms > timetosleep){ sleeping = false; } } //alert("end of sleeping period"); } function ExpandSections(sec, secnrself, seccount, sleep) { for (var x = 0; x <= seccount; x++){ var id = '' + sec + x; var secExpand = document.getElementById(id); if (secExpand) { if (x==secnrself){ //aspmlSleep(sleep); //alert('expanding: '+ id); secExpand.style.display = 'block'; } else { //aspmlSleep(sleep); //alert('hiding: '+ id); secExpand.style.display = 'none'; } } } } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 0){ if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){ arrReturnElements.push(oCurrent); } } } return arrReturnElements; } function activateMenu() { var mainmenuid = Get_Cookie( 'mnmnID' ); var mainmenuidnr = rightString(''+mainmenuid, 'menu'); var submenuid = Get_Cookie( 'mnsbID' ); //alert(document.cookie); //alert('mainmenuID: '+mainmenuid + ' mainmenuIDNR: '+mainmenuidnr+ ' submenuID: '+submenuid); var activeMainmenupresent = '0'; var activeSubmenupresent = '0'; var htmlbodyformenu = document.getElementsByTagName("body")[0]; if (isIE()) { var arrayMainmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "className" , "menu_current"); var arraySubmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "className" , "submenu_current"); } else { var arrayMainmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "class" , "menu_current"); var arraySubmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "class" , "submenu_current"); } //alert (arrayMainmenu_current); if (arrayMainmenu_current) { if (arrayMainmenu_current.length > 0) { activeMainmenupresent = '1'; Delete_Cookie('mnmnID', '/', ''); //alert('Agent was able to match active MAIN menu items: '+arrayMainmenu_current.length); // reset mainmenuid mainmenuid =(arrayMainmenu_current[0].id); mainmenuidnr = rightString(''+mainmenuid, 'menu'); } } if (arraySubmenu_current) { if (arraySubmenu_current.length > 0) { activeSubmenupresent = '1'; Delete_Cookie('mnsbID', '/', ''); //alert('Agent was able to match active SUB menu items: '+arraySubmenu_current.length); } } //Only activate the menuitem by use of the cookie if NO 'menu_current' class was present if ( (mainmenuid!='') && (activeMainmenupresent=='0') ) { //alert('Using cookie to activate menu-items'); var sec1 = document.getElementById(mainmenuid); if (sec1) {sec1.className='menu_current';} if (submenuid!=''){ var sec2 = document.getElementById(submenuid); if (sec2) {sec2.className='submenu_current';} } } ExpandSections('mnuFSIII', mainmenuidnr, 20, 0); } function activateMenuFolder(mainmenuid, mainmenuidnr) { var htmlbodyformenu = document.getElementsByTagName("body")[0]; var arrayMainmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "class" , "menu_current"); var arrayMainmenu_inactive = this.getElementsByAttribute(htmlbodyformenu, "*", "aspMenu" , "1"); var arraySubmenu_current = this.getElementsByAttribute(htmlbodyformenu, "*", "class" , "submenu_current"); // if (arrayMainmenu_current) { // //deactivate all active mainmenu items // for (i = 0; i < arrayMainmenu_current.length; i++){ // arrayMainmenu_current[i].className='menu'; // } // } //alert (arrayMainmenu_inactive.length); if (arrayMainmenu_inactive) { //deactivate all inactive mainmenu items for (i = 0; i < arrayMainmenu_inactive.length; i++){ arrayMainmenu_inactive[i].className='menu'; } } if (arraySubmenu_current) { //deactivate all active submenu items for (i = 0; i < arraySubmenu_current.length; i++){ arraySubmenu_current[i].className='submenu'; } } var sec1 = document.getElementById(mainmenuid); if (sec1) {sec1.className='menu_current';} ExpandSections('mnuFSIII', mainmenuidnr, 20, 0); } function setMainmenu(mainmenuid) { if (mainmenuid) { Delete_Cookie('mnmnID', '/', ''); Set_Cookie( 'mnmnID', mainmenuid, '', '/', '', '' ); Delete_Cookie('mnsbID', '/', ''); } } function setSubmenu(submenuid, mainmenuid) { if (submenuid) { Delete_Cookie('mnmnID', '/', ''); Set_Cookie( 'mnmnID', mainmenuid, '', '/', '', '' ); Delete_Cookie('mnsbID', '/', ''); Set_Cookie( 'mnsbID', submenuid, '', '/', '', '' ); } }