// Menu JavaScript (necessari internet explorer)
startList = function() 
{if (document.all&&document.getElementById) 
 {navRoot = document.getElementById("navl");
  for (i=0; i<navRoot.childNodes.length; i++) 
  {node = navRoot.childNodes[i];
   if (node.nodeName=="LI") 
   {node.onmouseover=function() { this.className+=" over";}
    node.onmouseout=function() { this.className=this.className.replace(" over", "");}
   }
  }
  navRoot = document.getElementById("navr");
  for (i=0; i<navRoot.childNodes.length; i++) 
  {node = navRoot.childNodes[i];
   if (node.nodeName=="LI") 
   {node.onmouseover=function() { this.className+=" over";}
    node.onmouseout=function() { this.className=this.className.replace(" over", "");}
   }
  }
  navRoot = document.getElementById("navc");
  for (i=0; i<navRoot.childNodes.length; i++) 
  {node = navRoot.childNodes[i];
   if (node.nodeName=="LI") 
   {node.onmouseover=function() { this.className+=" over";}
    node.onmouseout=function() { this.className=this.className.replace(" over", "");}
   }
  }
 }
}
window.onload=startList;

//
 function SetCookie(cookieName,cookieValue,nDays)
 {var today = new Date();
  var expire = new Date();
  if (nDays==null || nDays==0) nDays=1;
  expire.setTime(today.getTime() + 3600000*24*nDays);
  document.cookie = cookieName+"="+escape(cookieValue)
                  + ";expires="+expire.toGMTString();
 }

 function ReadCookie(cookieName) 
 {var theCookie=""+document.cookie;
  var ind=theCookie.indexOf(cookieName);
  if (ind==-1 || cookieName=="") return ""; 
  var ind1=theCookie.indexOf(';',ind);
  if (ind1==-1) ind1=theCookie.length; 
  return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
 }


 function defidioma(idi,refresca)
 { SetCookie("IDIOMA",idi,365);
   if (refresca) window.location.reload();
 }


function Calculate()

{
   // calcula total cada linia
   
	
	document.getElementById("T10").value = document.getElementById("Q10").value * 10;
	document.getElementById("T11").value = document.getElementById("Q11").value * 10;
	document.getElementById("T12").value = document.getElementById("Q12").value * 15;
	document.getElementById("T13").value = document.getElementById("Q13").value * 15;
	document.getElementById("TALL").value = document.getElementById("QALL").value * 30;

   // calcula total global   
	   
        document.getElementById("TOTAL").value = parseFloat(document.getElementById("T10").value)
	                                      + parseFloat(document.getElementById("T11").value)
	                                      + parseFloat(document.getElementById("T12").value)
	                                      + parseFloat(document.getElementById("T13").value)
	                                      + parseFloat(document.getElementById("TALL").value);
  
}
