function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);



<!-- // java per  menu comprare  //
	var oldX, oldY; //memorizzano e recuperano la posizione della finestra popup //
	var dragIt = false; //indica se la finestra è trascinata o meno //
	
	var ie=document.all&&document.getElementById;
	var ns=document.getElementById&&!document.all;

	function apriPopUp(url,w,h,caption){
		if (!ie&&!ns) // se il visitatore usa un vecchio browser apre un pop-up standard //
			window.open(url,caption,"width="+w+",height="+h); 
		else {
			// imposta la proprietà display dell'elemento popWin  //
			document.getElementById("popWin").style.display='';
			// imposta la larghezza del popup //
			document.getElementById("popWin").style.width=w+"px";
			// imposta l'altezza del popup //
			document.getElementById("popWin").style.height=h+"px";
			
			if(oldX == null){
				cw = (larghezzaBrowser() / 3) - w/1.3; // recupera la distanza dal margine sinistro del browser //
				// imposta la posizione orizzontale dal bordo sinistro //
				document.getElementById("popWin").style.left = cw+"px";
				// imposta la posizione verticale a 25 pixel dal bordo superiore //
				document.getElementById("popWin").style.top = 150+"px";
			}
			
		// imposta l'elemento titolo al valore del parametro caption  //
		temp = document.getElementById("winTitle");  
		temp.firstChild.nodeValue = caption;
		
		// carica i contenuti all'interno dell'iFrame //
		document.getElementById("contentiFrame").src=url;
		}
	}
	
	function chiudiPopUp(){
		oldX = document.getElementById("popWin").style.left; 
		oldY = document.getElementById("popWin").style.top;
		// imposta lo stile dell'elemento popWin a "none"	
		document.getElementById("popWin").style.display="none";
	}

	function startDrag(e){
		offsetx=ie? event.clientX : e.clientX;
		offsety=ie? event.clientY : e.clientY;
		
		tempx=parseInt(document.getElementById("popWin").style.left);
		tempy=parseInt(document.getElementById("popWin").style.top);
			dragIt = true;
	
		document.getElementById("popWin").onmousemove=DragNDrop;
	}

	function DragNDrop(e){
		// script per il movimento del pop-up relativo a Internet Explorer //
		if (ie&&dragIt&&event.button==1){
			document.getElementById("popWin").style.left=tempx+event.clientX-offsetx+"px";
			document.getElementById("popWin").style.top=tempy+event.clientY-offsety+"px";
		}
		// script per il movimento del pop-up relativo a Netscape //
		else if (ns&&dragIt){
			document.getElementById("popWin").style.left=tempx+e.clientX-offsetx+"px";
			document.getElementById("popWin").style.top=tempy+e.clientY-offsety+"px";
		}
	}
	
	function stopDrag(){
		dragIt=false;
		document.getElementById("popWin").onmousemove=null;
	}

	function larghezzaBrowser()	{
		if (navigator.userAgent.indexOf("MSIE") > 0)
			return(document.body.clientWidth);
		else
			return window.outerWidth;
	}
	
// -->

<!-- // ijava per  menu comprare old  //

function MM_openBrWindow(theURL) { //v2.0
  window.open(theURL,'','scrollbars=yes,resizable=yes,width=860,height=610, left=' + parseInt((screen.availWidth-860)/2) + ',top=' + parseInt((screen.availHeight-610)/2));
};// -->




