
    var diss = 0;   
    var menuGroup = new Array();

    function menu(){};

    menu0 = new menu();
    menu0.menuLinkStyle = "color:#FFFFFF; font-size: 12px; text-decoration: none";
    menu0.tableStyle="border:0px;background-color:#94A0BB;margin-top:6px;padding-bottom:6px;";
    menu0.cellStyle="text-align: left; color: #FFFFFF; padding-left:13px;padding-right:3px;height:8px;border-bottom: 1px solid #FF9900";
    menu0.cellSwapColor="#304979"
    menu0.divBgcolor="#94A0BB"
    menu0.parentMenu = '1';
    menu0.left = '25px';
    menu0.item = new Array(
	'<a style=\"' + menu0.menuLinkStyle + '" href=\"/opencms/ita/about/profile.html\">Profilo</a>',
	'<a style=\"' + menu0.menuLinkStyle + '" href=\"/opencms/ita/about/staff.html\" >Staff</a>');

    menuGroup[0] = menu0;

    menu1 = new menu();
    menu1.menuLinkStyle = "color:#FFFFFF; font-size: 12px; text-decoration: none";
    menu1.tableStyle="border:0px;background-color:#8D994D;margin-top:6px;padding-bottom:6px;";
    menu1.cellStyle="text-align: left; color: #FFFFFF; padding-left:13px;padding-right:3px;height:8px;border-bottom: 1px solid #FF9900";
    menu1.cellSwapColor="#5A6C01"
    menu1.divBgcolor="#8D994D"
    menu1.parentMenu = '1';
    menu1.left = '685px';
    menu1.item = new Array(
	'<a style=\"' + menu1.menuLinkStyle + '" href=\"/opencms/ita/services/elearning.html\" >E-Learning</a>',
	'<a style=\"' + menu1.menuLinkStyle + '" href=\"/opencms/ita/services/cms.html\" >CMS</a>',
	'<a style=\"' + menu1.menuLinkStyle + '" href=\"/opencms/ita/services/webappsdevelopment.html\" >Web apps</a>',
	'<a style=\"' + menu1.menuLinkStyle + '" href=\"/opencms/ita/services/outsourcing/index.html\" >Outsourcing</a>');
	//'<a style=\"' + menu1.menuLinkStyle + '" href=\"/opencms/ita/services/graphic-design.html\" >Design grafico</a>');

    menuGroup[1] = menu1;
    
    menu2 = new menu();
    menu2.menuLinkStyle = "color:#FFFFFF; font-size: 12px; text-decoration: none";
    menu2.tableStyle="border:0px;background-color:#9090A1;margin-top:6px;padding-bottom:6px;";
    menu2.cellStyle="text-align: left; color: #FFFFFF; padding-left:13px;padding-right:3px;height:8px;border-bottom: 1px solid #FF9900";
    menu2.cellSwapColor="#5F5F77"
    menu2.divBgcolor="#9090A1"
    menu2.parentMenu = '1';
    menu2.left = '340px';
    menu2.item = new Array(
	'<a style=\"' + menu2.menuLinkStyle + '" href=\"/opencms/ita/contact/contact.html\">Contatti</a>',
	'<a style=\"' + menu2.menuLinkStyle + '" href=\"/opencms/ita/contact/where.html\">Dove siamo</a>',
	'<a style=\"' + menu2.menuLinkStyle + '" href=\"/opencms/ita/contact/jobs.html\">Lavora con noi</a>');
   
    menuGroup[2] = menu2;

    //Menu verticali
    function initLayer(){
    var timeoutAtt = false;
    var myTimer = null;
	
                    for(var i = 0; i < menuGroup.length; i++){

                            document.write("<div id=\"Layer" + i + "\"  onMouseover=\"layerOn('" + i + "')\" onMouseout=\"tmhdLayer('" + i + "')\" style=\"background-color:" + menuGroup[i].divBgcolor + "; position:absolute; top:0px;left: " + menuGroup[i].left + ";width:155px; display:none\">");

                            document.write("  <table style=\"" + menuGroup[i].tableStyle + "\" width=\"100%\">");
                            for(var j = 0; j < menuGroup[i].item.length; j++){
                                    //document.write("    <tr id=\"block_"+i+"_"+j+"\"  style=\"display:none;\">");
                                    document.write("    <tr id=\"block_"+i+"_"+j+"\" >");
                                    document.write("      <td style=\"" + menuGroup[i].cellStyle + "\" onMouseOut=\"this.style.backgroundColor=''\" onMouseOver=\"this.style.backgroundColor='" + menuGroup[i].cellSwapColor + "'\" height=\"29\">" + menuGroup[i].item[j] + "</td>");
                                    document.write("    </tr>");
                            }

                            document.write("  </table>");

                            document.write("</div>");

                    }
    }

    function vediTr(n,j){
        $("#block_"+n+"_"+j).slideDown("fast");
    }

    function chiudiTr(n,j){
        $("#block_"+n+"_"+j).slideUp("fast");
    }

    function hideDef(n){
        $("#Layer"+n).hide("fast",function(){
           $("#menuRoot_"+n).attr('src','/opencms/ita/images/menuRoot_' + n + '_off.jpg');              
        });
    }

    function showLayer(n,t,l,e){

        layerOn(n);
	if(document.getElementById("Layer" + n).style.display == "none"){
            if(l >= 0){
                document.getElementById("Layer" + n).style.top= t + "px";
                document.getElementById("Layer" + n).style.left=calcolaLeft() + l + "px";
                document.getElementById("menuRoot_" + n).src = '/opencms/ita/images/menuRoot_' + n + '.jpg';
	    }
            $("#Layer"+n).show("fast",function(){
               /*for(var j = 0; j < menuGroup[n].item.length; j++){                  
                  setTimeout("vediTr("+n+","+j+")",(300*j));                  
               }*/
                 
               $("#Layer"+n).fadeTo("fast","0.85");
            });
        }

    }

    function tmhdLayer(n){
        eval("myTimerv" + n + " = setTimeout(\"hideLayer('" + n + "')\",80);");
    }

    function hideLayer(n){        

        $("#Layer"+n).fadeTo("fast","1",function(){
           var k = 0;
           /*for(var j = menuGroup[n].item.length - 1; j >= 0; j--){                
                  setTimeout("chiudiTr("+n+","+j+")",(300*k));
                  k++;
           }
           
           setTimeout("hideDef("+n+")",(300*k));*/
           $("#Layer"+n).hide("fast",function(){
              $("#menuRoot_"+n).attr('src','/opencms/ita/images/menuRoot_' + n + '_off.jpg');              
           });
        });
    }

    function layerOn(n){

        eval("toType = typeof(myTimerv" + n + ");");
        if(toType != "undefined"){
            eval("clearTimeout(myTimerv" + n + ");");
        }
    }

    function calcolaLeft(){

            if(navigator.appName.indexOf("Netscape")!=-1){
                    if(window.innerWidth < 790)
                            return 0;
                    else
                            return ((window.innerWidth - 790)/2) - 7;
            }
            else{
                    if(window.innerWidth < 790)
                            return 0;
                    else
                            return ((document.body.offsetWidth - 790)/2) - 0;

            }
    }







function assolv(n){

	if(navigator.appName.indexOf("Netscape")!=-1){
            document.getElementById(n).style.MozOpacity = 0;
            assolvFF(n);
        }else{
            document.getElementById(n).style.opacity = 0;
            document.getElementById(n).style.filter = 'alpha(opacity=0)';
            assolvIE(n);
        }

}


function assolvIE(n){

	el = document.getElementById(n);
	el.style.display = '';
	op =  parseFloat(el.style.opacity);
	if(op < 0.85 && diss == 1){
                op = op + 0.05;
		el.style.opacity = op;
                el.style.filter = 'alpha(opacity=' + (op*100) + ')';
		setTimeout("assolvIE('" + n + "')", 5);
	}	

}

function assolvFF(n){

	el = document.getElementById(n);
	el.style.display = '';
	op =  parseFloat(el.style.MozOpacity);
	if(op < 0.85 && diss == 1){
		el.style.MozOpacity = op + 0.05;
		setTimeout("assolvFF('" + n + "')", 5);
        }

 }


function oscura(){

     if(navigator.appName.indexOf("Netscape")!=-1){

       document.getElementById('tenda').style.width = window.innerWidth + 'px';
       document.getElementById('tenda').style.height = '2500px';
//       document.getElementById('tenda').style.height = window.innerHeight + 'px';

     }else{

       document.getElementById('tenda').style.width = document.body.offsetWidth;
       document.getElementById('tenda').style.height = '2500px';
//       document.getElementById('tenda').style.height = document.body.offsetHeight;

     }

     // document.getElementById('tenda').style.opacity = 0;
     diss = 1;
     assolv('tenda');

}


