document.write('      Dimensioni Carattere: <a href=\"#\" class=\"s\" title=\"Visualizza il sito con i caratteri di default\"  onclick=\"setCookie(\'Font\', \'s\')\">A</a> | <a href=\"#\" class=\"m\" title=\"Visualizza il sito con i caratteri grandi\"  onclick=\"setCookie(\'Font\', \'m\')\">A</a> | <a href=\"#\" class=\"l\" title=\"Visualizza il sito con i caratteri molto grandi\"  onclick=\"setCookie(\'Font\', \'l\')\">A</a></li>');
document.write('      <li>Ambiente:<br class=\"hide\" />');
document.write('      <a href=\"#\" onclick=\"setCookie(\'Theme\', \'default\')\" class=\"default\">&nbsp;<span class=\"hide\">Visualizza il sito in modalit&agrave; </span></a> <a href=\"#\" onclick=\"setCookie(\'Theme\', \'default\')\" class=\"noborder\">Default</a><br class=\"hide\" /> ');
document.write('      <a href=\"#\" class=\"contrasto\" onclick=\"setCookie(\'Theme\', \'contrasto\')\">&nbsp;<span class=\"hide\">Visualizza il sito in modalit&agrave; </span></a> <a href=\"#\" onclick=\"setCookie(\'Theme\', \'contrasto\')\" class=\"noborder\"> Alto contrasto</a>');

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.imq/resources/style/style/default.css\" />");
	} 
else if(chkza == 'contrasto')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/contrasto.css\" />");
	}
else
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/default.css\" />");
	}

getCookie("Font");
if(chkza == 's')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/s.css\" />");}
else if(chkza == 'm')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/m.css\" />");}
else if(chkza == 'l')
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/l.css\" />");}
else
	{document.write("<link rel=\"stylesheet\" href=\"/system/modules/it.imq/resources/style/s.css\" />");}






// ========================= TARGET='_blank' ========================= 
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors .length; i++) {
	var anchor = anchors[i];
	if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
		anchor.target = "_blank";
		anchor.title = (anchor.title != "") ? anchor.title+" (Questo link si apre in una nuova finestra)" : "Questo link si apre in una nuova finestra";
		//anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
		}
	}
}
//window.onload = externalLinks;
//document.body.onload = alert('document.body.onload');

if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", externalLinks, false );
else if ( typeof window.attachEvent != "undefined" )
    window.attachEvent( "onload", externalLinks );
else {
    if ( window.onload != null ) {
        var oldOnload = window.onload;
        window.onload = function ( e ) {
            oldOnload( e );
            externalLinks();
        };
    }
    else
        window.onload = externalLinks;
}
