var t;

function openPopNav(navId) {
    stoptimeout(t);
    if (document.layers)	   //NN4+
        document.layers[navId].visibility = "show";
    else if (document.getElementById)	  //gecko(NN6) + IE 5+
        document.getElementById(navId).style.visibility = "visible";
    else if (document.all)	// IE 4
        document.all[navId].style.visibility = "visible";
}

function closePopNav(navId) {
    stoptimeout(t);
    if (document.layers)	   //NN4+
        document.layers[navId].visibility = "hide";
    else if (document.getElementById)	  //gecko(NN6) + IE 5+
        document.getElementById(navId).style.visibility = "hidden";
    else if (document.all)	// IE 4
        document.all[navId].style.visibility = "hidden";
}

function popNavItemMOver(menuItemId, popNavId) {
    document.body.style.cursor = 'pointer';
    IE6BgHover(menuItemId);
    openPopNav(popNavId);
}

function popNavItemMOut(menuItemId, popNavId) {
    IE6BgHoverOff(menuItemId);
    timeout(popNavId);
    document.body.style.cursor = 'auto';
}

function IE6BgHover(d_name) {
    if (navigator.appName.indexOf('Microsoft') != -1) 
    {
        var thestyle = eval('document.all.' + d_name + '.style');
        if (thestyle.backgroundColor = "#008584")
            thestyle.backgroundColor = "#6fbdbd";
    }
    else 
    {
        var obj = document.getElementById(d_name);
        if (obj.style.backgroundColor = "#008584")
            obj.style.backgroundColor = "#6fbdbd";
    }
}

function IE6BgHoverOff(d_name) {
    if (navigator.appName.indexOf('Microsoft') != -1) {
        var thestyle = eval('document.all.' + d_name + '.style');
        if (thestyle.backgroundColor = "#33bebd") {
            thestyle.backgroundColor = "#33a3a1";
        }
    }
    else {
        var obj = document.getElementById(d_name);
        if (obj.style.backgroundColor = "#33bebd") {
            obj.style.backgroundColor = "#33a3a1";
        }
    }

}

function timeout(szDivID) {
    t = setTimeout("HideOpenMenus('" + szDivID + "')", 400);
}
function stoptimeout() {
    clearTimeout(t);
}

function HideOpenMenus(szDivID) {
    var obj = document.getElementById(szDivID);
    obj.style.visibility = 'hidden';
}


function showhidetext(divtoShow,swftoshow,imgtoshow)
{
    //hide all the divs
    if (document.getElementById)	  //gecko(NN6) + IE 5+
    {
        document.getElementById("copy1").style.display = "none";
        document.getElementById("copy2").style.display = "none";
        document.getElementById("copy3").style.display = "none";
        document.getElementById("copy4").style.display = "none";
        
        document.getElementById("swf1").style.display = "none";
        document.getElementById("swf2").style.display = "none";
        document.getElementById("swf3").style.display = "none";
        document.getElementById("swf4").style.display = "none";
        
        document.getElementById("b1").src= "/it/cat/actilea/images/b1.gif"; 
        document.getElementById("b2").src= "/it/cat/actilea/images/b2.gif"; 
        document.getElementById("b3").src= "/it/cat/actilea/images/b3.gif"; 
        document.getElementById("b4").src= "/it/cat/actilea/images/b4.gif"; 
     }   
     
   //show the relevant divs
   document.getElementById(divtoShow).style.display = "inline"       
   document.getElementById(swftoshow).style.display = "inline" 
   document.getElementById(imgtoshow).src = "/it/cat/actilea/images/"+imgtoshow +"_on.gif";     

    try{   
    getMovie("Object1").StopPlay();
    getMovie("Object2").StopPlay();
    getMovie("Object3").StopPlay();
    getMovie("Object1").Rewind();
    getMovie("Object2").Rewind();
    getMovie("Object3").Rewind();
   
   if(swftoshow=="swf2")
        getMovie("Object1").Play();
   if(swftoshow=="swf3")
        getMovie("Object2").Play();
   if(swftoshow=="swf4")
        getMovie("Object3").Play();
        }catch(Error){}
}

function getMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  } else {
    return document[movieName]
  }
}
