function pop(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } // carica frameset if (parent.location.href == self.location.href) window.location.href = 'index.htm'; // show/hide function sai(vedi) { var i,p,v,obj,args; var todiLayer = "insetticidi,rodenticidi,disinfettanti,esche,intro"; var matLayer = todiLayer.split(","); var stringa = "" for (conto in matLayer) { var testo = matLayer[conto]; if (testo == vedi) { stringa = stringa + "'" + testo + "'" + ",'','show',"} else { stringa = stringa + "'" + testo + "'" + ",'','hide',"} } stringa = stringa.substring(0, (stringa.length -1)); stringa = "var args = new Array (" + stringa + ");" eval(stringa); for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } function show(vedi) { var i,p,v,obj,args; var todiLayer = "alimanti,alimins,alimdis,alimdoc,ristanti,ristins,ristdis,ristdoc,cond,anti,tess,altri,introind,introrist,intro"; var matLayer = todiLayer.split(","); var stringa = "" for (conto in matLayer) { var testo = matLayer[conto]; if (testo == vedi) { stringa = stringa + "'" + testo + "'" + ",'','show',"} else { stringa = stringa + "'" + testo + "'" + ",'','hide',"} } stringa = stringa.substring(0, (stringa.length -1)); stringa = "var args = new Array (" + stringa + ");" eval(stringa); for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } var nom = 6; // Number of menus var tits = new Array(); // An array for the title objects var subs = new Array(); // An array for the submenu objects var lastn; var lastmove; var isIE4; var isNav4; var isNav6; var re = new RegExp('px'); function setbrowser() { if (navigator.appVersion.charAt(0) == "4") { if (navigator.appName.indexOf("Explorer") >= 0) { isIE4 = true; } else { isNav4 = true; } } else if (navigator.appVersion.charAt(0) > "4") { isNav6 = true; } if (isNav4) { // Setting the visibility for NN and IE visible = 'show'; hidden = 'hide'; } else if (isIE4) { visible = 'visible'; hidden = 'hidden'; } else if (isNav6) { visible = 'visible'; hidden = 'hidden'; } } for (var i = 1; i <= nom; i++) { // Fills the arrays with title and submenu objects tits[i] = ('title' + i); subs[i] = ('submenu' +i); } // A couple of small functions that changes the image by the clicked menu function picopen(n) { title = ('title' + n); pic = ('pic' + n); if (isNav4) { document.layers[title].document.images[pic].src = "img/nav/opened.gif"; } else if (isIE4) { document.all(pic).src = "img/derattizzazioni/opened.gif"; } else if (isNav6) { document.getElementById(pic).src = "img/derattizzazioni/opened.gif"; } } function picclose(n) { title = ('title' + n); pic = ('pic' + n); if (isNav4) { document.layers[title].document.images[pic].src = "img/derattizzazioni/closed.gif"; } else if (isIE4) { document.all(pic).src = "img/derattizzazioni/closed.gif"; } else if (isNav6) { document.getElementById(pic).src = "img/derattizzazioni/closed.gif"; } } // The main script for toggling the selected menu // Input variables: // n = the number of the submenu to show/hide // move = the number of pixels for moving the objects below lastn = (nom + 1); lastmove = 0; function lasttoggle(n,move) { if (n <= nom) { menu = ('submenu' + n); if (isNav4) { submenu = document.layers[menu]; } else if (isIE4) { submenu = document.all(menu).style; } else if (isNav6) { submenu = document.getElementById(menu).style; } if (submenu.visibility.toLowerCase() == visible) { submenu.visibility = hidden; picclose(n); for (var i = (n+1); i <= nom; i++) { if (isNav4) { var tit = document.layers[tits[i]]; var subm = document.layers[subs[i]]; } else if (isIE4) { var tit = document.all(tits[i]).style; var subm = document.all(subs[i]).style; } else if (isNav6) { var tit = document.getElementById(tits[i]).style; var subm = document.getElementById(subs[i]).style; } var tmptit = parseInt(tit.top); var tmpsub = parseInt(subm.top); if (isNav4) { tit.top = (tmptit - move); subm.top = (tmpsub - move); } else { tit.top = (tmptit - move) + "px"; subm.top = (tmpsub - move) + "px"; } } } } } function toggle(n,move) { var menu = ('submenu' + n); if (isNav4) { submenu = document.layers[menu]; } else if (isIE4) { submenu = document.all(menu).style; } else if (isNav6) { submenu = document.getElementById(menu).style; } if (submenu.visibility.toLowerCase() == visible) { submenu.visibility = hidden; picclose(n); for (var i = (n+1); i <= nom; i++) { if (isNav4) { var tit = document.layers[tits[i]]; var subm = document.layers[subs[i]]; } else if (isIE4) { var tit = document.all(tits[i]).style; var subm = document.all(subs[i]).style; } else if (isNav6) { var tit = document.getElementById(tits[i]).style; var subm = document.getElementById(subs[i]).style; } var tmptit = parseInt(tit.top); var tmpsub = parseInt(subm.top); if (isNav4) { tit.top = (tmptit - move); subm.top = (tmpsub - move); } else { tit.top = (tmptit - move) + "px"; subm.top = (tmpsub - move) + "px"; } } } else { submenu.visibility = visible; picopen(n); if (lastn != n) { lasttoggle(lastn,lastmove); } for (var i = (n+1); i <= nom; i++) { if (isNav4) { var tit = document.layers[tits[i]]; var subm = document.layers[subs[i]]; } else if (isIE4) { var tit = document.all(tits[i]).style; var subm = document.all(subs[i]).style; } else if (isNav6) { var tit = document.getElementById(tits[i]).style; var subm = document.getElementById(subs[i]).style; } var tmptit = parseInt(tit.top); var tmpsub = parseInt(subm.top); if (isNav4) { tit.top = (tmptit + move); subm.top = (tmpsub + move); } else { tit.top = (tmptit + move) + "px"; subm.top = (tmpsub + move) + "px"; } } } lastn = n; lastmove = move; } function init() { setbrowser(); } function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); // --> function MM_showHideLayers() { //v3.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } //--> 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 function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); // --> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; 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&&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= 4) { win.window.focus(); } } //-->