// JavaScript Document
function addSingleProd(url,id) {
	var el = document.getElementById(id);	
	if (el.value && el.value>0)
		location.href=url + "&action=AddToCart&"+id+"="+el.value;
}

  function switchDisplay(id) {
	obj = document.getElementById(id);
	if (obj.style.display=="none")
	  	obj.style.display="";
	else
		obj.style.display="none";
  }
  
  function switchClassNames(id,class1,class2) {
	obj = document.getElementById(id);
	if (obj.className==class1)
	  	obj.className=class2;
	else
		obj.className=class1;	  
  }

msg = "Fattori di rischio - Medicina personalizzata - Farmacogenetica - Malattie neurodegenerative - Fibrosi cistica - Trombofilia - X fragile - Dislipidemie - Farmacogenetica - Diagnosi prenatale - ";

pos = 0;
function ScrollMessage() {
   var newtext = msg.substring(pos, msg.length) + msg.substring(0, pos);
   var div = document.getElementById("scorrevole");
   div.firstChild.nodeValue = newtext;
   pos++;
   if (pos > msg.length) pos = 0;
   window.setTimeout("ScrollMessage()",90);
}

var newtext="a";
function scrolla() {

    if(msg.length > 110) {
        newtext = msg.substring(0,110);
        msg = msg + msg.charAt(0);
        msg = msg.substring(1,msg.length);
   }
   else {
        newtext = msg.substring(0,msg.length);
        msg = msg + msg.charAt(0);
        msg = msg.substring(1,msg.length);
    }
    
   var div = document.getElementById("scorrevole");
   div.firstChild.nodeValue = newtext;
   
   window.setTimeout("scrolla()",100);
}

