var path="/";
var today = new Date();
var expires = new Date();

function SetCooKie(name,value) {
   expires.setTime(today.getTime() + (1000*60*60));
   avviso = name + "=" + value + "; expires=" + expires.toGMTString() + "; path=" + path;
   document.cookie = avviso;
}

function GetCookie(name){ 
   var biscotti = document.cookie.split("; ");
   for (i=0; i < biscotti.length; i++) {
      briciola = biscotti[i].split("=");
      if (briciola[0] == name) {
        valore = briciola[1];
        return valore;
      }
   }
}

function CaricaStile() {
	StileDocumento = document.getElementById("Stile1") ;
	CSS = GetCookie("PortaleBagheria") ;
	if (CSS != null) {
		StileDocumento.href = CSS ;
	}
	else
		StileDocumento.href = "../css/css_1.css" ;
}

function CambiaStile(Tipo) {
	StileDocumento = document.getElementById("Stile1") ;
	if (Tipo == 0) {
		CSS = "../css/TestoGrande.css"
		StileDocumento.href = CSS ;
	}
	else if (Tipo == 1) {
		CSS = "../css/TestoMedio.css"
		StileDocumento.href = CSS ;
	}
	else if (Tipo == 2) {
		CSS = "../css/css_1.css"
		StileDocumento.href = CSS ;
	}
	else if (Tipo == 3) {
		CSS = "../css/AltaVisibilita.css"
		StileDocumento.href = CSS ;
	}
	else if (Tipo == 4) {
		CSS = "../css/SoloTesto.css"
		StileDocumento.href = CSS ;
	}
	SetCooKie("PortaleBagheria",CSS) ;
}