chkza="";

function setCookie(name, value) {
  dataScadenza = new Date();
  dataScadenza.setMonth(dataScadenza.getMonth() + 2);
  var domain="";
  var temp=location.hostname;
  temp=temp.split(".");
  for(i=1;i<temp.length;i++){
    if(i!=1)domain+=".";
    domain+=temp[i];
  }
  var curCookie = name + "=" + escape(value)+ "; expires=" + dataScadenza.toGMTString() + "; path=/; domain="+location.hostname+";";
  document.cookie = curCookie;
  document.location.reload();
}

function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
	// if there are any cookies
	offset = document.cookie.indexOf(search);
	if (offset != -1) { 
		// if cookie exists
		offset += search.length;
		// set index of beginning of value
		end = document.cookie.indexOf(";", offset);
		// set index of end of cookie value
		if (end == -1) {
			end = document.cookie.length;
			}
	chkza=unescape(document.cookie.substring(offset, end));
		}
	}
}
getCookie("Theme");
if(chkza == 'default')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.milano.provincia.cultura/resources/style/default.css\" type=\"text/css\"/>");
	} 
else if(chkza == 'contrasto')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.milano.provincia.cultura/resources/style/contrasto.css\" type=\"text/css\"/>");
	}
else
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.milano.provincia.cultura/resources/style/default.css\" type=\"text/css\"/>");
	}

getCookie("Font");
if(chkza == 's')
	{document.write("<style>body{font-size:100%;} #accessibility a.s{border: 1px solid #F5AB30;} #navtop li{padding-top: 3px;}</style>");}
else if(chkza == 'm')
	{document.write("<style>body{font-size:115%;} #accessibility a.m{border: 1px solid #F5AB30;} #navtop li{padding-top: 1px;}</style>");}
else if(chkza == 'l')
	{document.write("<style>body{font-size:130%;} #accessibility a.l{border: 1px solid #F5AB30;} #navtop li{padding-top: 3px; margin-bottom:-4px}</style>");}
else
	{document.write("<style>body{font-size:100%;} #accessibility a.s{border: 1px solid #F5AB30;} #navtop li{padding-top: 3px;}</style>");}