﻿function AttivaVoci(pag,sottomenu)
    {
        anArea = document.getElementById('menu'+pag);        
        // setto menu
        if (pag==1) {
            anArea.style.background='url(App_Themes/default/images/SfMenu01_att.gif)';
        }
        else if ((pag==2)||(pag==3)||(pag==4)||(pag==5)) {
            anArea.style.background='url(App_Themes/default/images/SfMenu02_att.gif)';
        }
        else if (pag==6) {
            anArea.style.background='url(App_Themes/default/images/SfMenu03_att.gif)';
        } 
        /*
        else if (pag==7) {
            anArea.style.background='url(App_Themes/default/images/SfMenu04_att.gif)';
        }*/  
        else if (pag==8) {
            anArea.style.background='url(App_Themes/default/images/SfMenu05_att.gif)';
        }      
        
        // setto sottomenu
        if (menu==1) {
            showLayer('SCompany');
            nomeSottoMenu="sottoMenu";
        }
        if (menu==2) {
            showLayer('SSolutions');
            nomeSottoMenu="SsottoMenu";
        }
        
        if (sottomenu!=0){
            showLayer('sottomenu');
            for(i=1;i<=6;i++){
                if (i==sottomenu){
                    hideLayer(nomeSottoMenu+i);
                    showLayer(nomeSottoMenu+i+'_off');
                }
                else {
                    showLayer(nomeSottoMenu+i);
                    hideLayer(nomeSottoMenu+i+'_off');
                }
            }        
        }
        else if (sottomenu==-1) showLayer('sottomenu');
    }
   
    function levelMe(theArea,tipo) {
      idx = parseInt(theArea.id.substring(4)); // remove the "area"
      anArea = document.getElementById('menu'+idx);
      if (idx!=menu) {
          if (idx==1){
            if (tipo==1) anArea.style.background='url(App_Themes/default/images/SfMenu01_roll.gif)';
            else anArea.style.background='url(App_Themes/default/images/SfMenu01.gif)';
            }
          else if ((idx==2)||(idx==3)||(idx==4)||(idx==5)){
            if (tipo==1) anArea.style.background='url(App_Themes/default/images/SfMenu02_roll.gif)';
            else anArea.style.background='url(App_Themes/default/images/SfMenu02.gif)';
            }
          else if (idx==6) {
            if (tipo==1) anArea.style.background='url(App_Themes/default/images/SfMenu03_roll.gif)';
            else anArea.style.background='url(App_Themes/default/images/SfMenu03.gif)';
            }
          else if (idx==7) {
            if (tipo==1) anArea.style.background='url(App_Themes/default/images/SfMenu04_roll.gif)';
            else anArea.style.background='url(App_Themes/default/images/SfMenu04.gif)';
            }
          else if (idx==8) {
            if (tipo==1) anArea.style.background='url(App_Themes/default/images/SfMenu05_roll.gif)';
            else anArea.style.background='url(App_Themes/default/images/SfMenu05.gif)';
            }
      }
    }
    
    function showLayer(id) {
      document.getElementById(id).style.visibility= "visible";
      document.getElementById(id).style.zIndex=10;
    } 
    function hideLayer(id) {
      document.getElementById(id).style.visibility= "hidden";
      document.getElementById(id).style.zIndex=0;
    }
    function nascondi(tempo) {
       setTimeout('nascondiTurbina()',tempo);
    }
      function nascondiTurbina() {
       fadeIn('container');
       hideLayer('container2');
    }
    function fadeIn(id) 
	{
	if (navigator.appName!="Microsoft Internet Explorer"){
	    showLayer(id);}
	else{
	    var elem = document.getElementById(id);
	elem.style.filter="blendTrans(duration=3)";
	elem.style.zIndex=10;
	if (elem.filters.blendTrans.status != 2) 
		{
			elem.filters.blendTrans.apply();
			elem.style.visibility="visible";
			elem.filters.blendTrans.play();
		}		    
	}
	}
	
	
	
	

