<!-- FUNZIONI PER LA VISUALIZZAZIONE DHTML //-->

<!-- creazione della classe Browser per definire il tipo di browser //-->
function Browser() {
	this.n4 = (document.layers) ? 1 : 0;
	this.ie = (document.all) ? 1 : 0;
	this.n6 = (document.getElementById) ? 1 : 0;
}

<!-- definizione della posizione del layer sulla base del browser e dei dati ricevuti //-->
function centra(id,left) {
	if (bw.n4){
		this.obj = document.layers[id];
	}else if(bw.ie){
		this.obj = document.all[id].style;
	}else if(bw.n6){
		this.obj = document.getElementById(id).style;
	}
		this.obj.left = (left>0) ? left : 0;
		this.obj.top = 0;
		return this.obj;
}

<!-- definizione delle dimensioni utili della pagina, e di setup del layer al primo e successivi accessi //-->
function setup(prima){
	<!-- creazione di una istanza della classe Browser, di nome bw //-->
	 /*
	bw = new Browser();
	if(bw.ie) {
		wdth = Math.round(document.body.clientWidth);
	}else if(bw.n4 || bw.n6){
		wdth = Math.round(window.innerWidth);
	}
	if(prima){
		lay = new centra('logo', Math.round((wdth/2))-400);
		DisplayInfo();
		//scrivi()
	}else{
		if(bw.n4){
			location.reload();
		}else if(bw.ie || bw.n6){
			lay = new centra('logo', Math.round((wdth/2))-400);
		}
	
	}	
	 */	
}


<!-- scelta del contenuto del layer in base al browser e all'accesso //-->
function scrivi() {
	var net = "<table width=100% border=0 cellpadding=4 cellspacing=0>" +
	"<tr onMouseOver=bgColor='#C3BDAE' onMouseOut=bgColor='#929BAE'>"+
	"<td class=menuhp1><div id=SubCell style=height:22px; padding-left: 5px; padding-bottom: 8px; vertical-align: bottom><a href=gruppo.jsp?cat_id=92&breadcrumbs0=Chi+siamo&breadcrumbs=Il+gruppo+&breadcrumbs1=Il+gruppo+&pic= class=menu_sx>Il gruppo <td width=10>&nbsp;</td></tr>"+
	"</table>";
	//var exp = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH='700' HEIGHT='400'><PARAM NAME=movie VALUE='pagina_file/movie.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#CCCCCC><EMBED src='pagina_file/movie.swf' quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH='700' HEIGHT='400' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT>"
	if (bw.n4) {
		document.layers.logo.document.close();
		document.layers.logo.document.write(net);
		document.layers.logo.document.close();
	}else if(bw.ie){
		if(document.readyState == "complete"){
			if(visitato || navigator.cookieEnabled == false){
				eval("document.all.logo.innerHTML = net");
			}
		}else{
			timerID = setTimeout("scrivi()",100);
		}
	}else if(bw.n6){
		document.getElementById("logo").innerHTML = net;
	}
}

<!-- FUNZIONI PER LA GESTIONE DEL COOKIE //-->

<!-- funzione per il recupero della sottostringa nel cookie //-->
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

<!-- funzione per il recupero del cookie //-->
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	}
	return null;
}

<!-- funzione per la scrittura del cookie //-->
function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}

<!-- funzione per l'incremento del contatore e controllo sul numero di accessi //-->
function DisplayInfo() {
	var expdate = new Date();
	var visit;
	// expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
	expdate.setTime(expdate.getTime() + (10 * 1000)); 
	if(!(visit = GetCookie("dhtmlFlash"))) visit = 0;
	visit++;
	SetCookie("dhtmlFlash", visit, expdate, "/", null, false);
	if(visit > 1){
		visitato = true;
	}else{
		visitato = false;
	}
}

<!-- funzione per resettare il cookie //-->
function ResetCounts() {
	var expdate = new Date();
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
	visit = 0;
	SetCookie("dhtmlFlash", visit, expdate , "/", null, false);
	leapto();
}
