

//Contents for menu 1
var menu1=new Array()
menu1[1]='<a href="servizi.htm">Info</a>'
menu1[2]='<a href="produzionivide.htm"">Produzioni Video</a>'
menu1[3]='<a href="riversamenti.htm"">Riversamenti da e su qualunque formato</a>'
menu1[4]='<a href="formazione.htm"">Formazione</a>'
menu1[5]='<a href="location.htm"">Location</a>'
menu1[6]='<a href="foto.htm">Foto</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[1]='<a href="promoaziendali.htm">Promo Aziendali</a>'
menu2[2]='<a href="eventi.htm">Eventi</a>'
menu2[3]='<a href="tv.htm">Tv</a>'
menu2[4]='<a href="concertilive.htm">Concerti Live</a>'
menu2[5]='<a href="videoclip.htm">Videoclip</a>'
menu2[6]='<a href="spot.htm">Spot</a>'
menu2[7]='<a href="documentari.htm">Documentari</a>'


//Contents for menu 3, and so on
var menu3=new Array()
menu3[1]='<a href="sociale.htm">Info</a>'
menu3[3]='<a href="laboratori.htm">Laboratori didattico/educativi</a>'
menu3[2]='<a href="cineteca.htm">Cineteca dei Ragazzi</a>'

var menuwidth='100px' //default menu width
var menubgcolor='ffffff'  //menu bgcolor
var disappeardelay=100  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var verticaloffset=2

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

button2up = new Image; button2up.src = "img/menu/servizi.jpg";
button2down = new Image; button2down.src = "img/menu/servizion.jpg";
button1up = new Image; button1up.src = "img/menu/chisiamo.jpg";
button1down = new Image; button1down.src = "img/menu/chisiamoon.jpg";
button3up = new Image; button3up.src = "img/menu/produzioni.jpg";
button3down = new Image; button3down.src = "img/menu/produzionion.jpg";
button4up = new Image; button4up.src = "img/menu/sociale.jpg";
button4down = new Image; button4down.src = "img/menu/socialeon.jpg";
button5up = new Image; button5up.src = "img/menu/service.jpg";
button5down = new Image; button5down.src = "img/menu/serviceon.jpg";
button6up = new Image; button6up.src = "img/menu/portfolio.jpg";
button6down = new Image; button6down.src = "img/menu/portfolioon.jpg";
button7up = new Image; button7up.src = "img/menu/contatti.jpg";
button7down = new Image; button7down.src = "img/menu/contattion.jpg";
button8up = new Image; button8up.src = "images/tastoni/tastone4.jpg";
button8down = new Image; button8down.src = "images/tastoni/tastone4_1.jpg";
button9up = new Image; button9up.src = "images/tastoni/tastone5.jpg";
button9down = new Image; button9down.src = "images/tastoni/tastone5_1.jpg";
button10up = new Image; button10up.src = "images/tastoni/tastone6.jpg";
button10down = new Image; button10down.src = "images/tastoni/tastone6_1.jpg";
button11up = new Image; button11up.src = "images/immagini/tasti_5.jpg";
button11down = new Image; button11down.src = "images/immagini/tastisu_5.jpg";

function MouseOverRoutine(ButtonName)
{
if (ButtonName=="button2") 
{document.button2.src = button2down.src;}
if (ButtonName=="button1") 
{document.button1.src = button1down.src;}
if (ButtonName=="button3") 
{document.button3.src = button3down.src;}
if (ButtonName=="button4") 
{document.button4.src = button4down.src;}
if (ButtonName=="button5") 
{document.button5.src = button5down.src;}
if (ButtonName=="button6") 
{document.button6.src = button6down.src;}
if (ButtonName=="button7") 
{document.button7.src = button7down.src;}
if (ButtonName=="button8") 
{document.button8.src = button8down.src;}
if (ButtonName=="button9") 
{document.button9.src = button9down.src;}
if (ButtonName=="button10") 
{document.button10.src = button10down.src;}
if (ButtonName=="button11") 
{document.button11.src = button11down.src;}
}

function MouseOutRoutine(ButtonName)
{
if (ButtonName=="button2") 
{document.button2.src = button2up.src;}
if (ButtonName=="button1") 
{document.button1.src = button1up.src;}
if (ButtonName=="button3") 
{document.button3.src = button3up.src;}
if (ButtonName=="button4") 
{document.button4.src = button4up.src;}
if (ButtonName=="button5") 
{document.button5.src = button5up.src;}
if (ButtonName=="button6") 
{document.button6.src = button6up.src;}
if (ButtonName=="button7") 
{document.button7.src = button7up.src;}
if (ButtonName=="button8") 
{document.button8.src = button8up.src;}
if (ButtonName=="button9") 
{document.button9.src = button9up.src;}
if (ButtonName=="button10") 
{document.button10.src = button10up.src;}
if (ButtonName=="button11") 
{document.button11.src = button11up.src;}
}
