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=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/default.css\" />");
	} 
else if(chkza == 'contrast')
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/contrasto.css\" />");
	}
else if(chkza == 'relax')
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/relax.css\" />");
	}
else
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/default.css\" />");
	}

getCookie("Font");
if(chkza == 'small')
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/piccolo.css\" />");}
else if(chkza == 'normal')
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/normale.css\" />");}
else if(chkza == 'big')
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/grande.css\" />");}
else
	{document.write("<link rel=\"stylesheet\" href=\"/opencms/opencms/system/modules/it.milano.provincia.diritti_tutele/resources/style/normale.css\" />");}
