// JavaScript Document

function showsup()
	{	
		if(document.getElementById && ScanCookie("megabanner")==0)
		{
		document.getElementById("pub").style.width = larg;
		document.getElementById("pub").style.height = haut;
		document.getElementById("pub").innerHTML = html_haut+html_mil+html_bas;
		setTimeout("closeSup()",20000);//timeout chiusura
		/*CreationCookie("megabanner", "valore", "nessuna");*/
		}
	}

function closeSup()
	{
	if(document.getElementById)
		{
		document.getElementById("pub").style.width = 1;
		document.getElementById("pub").style.height = 1;
		document.getElementById("pub").innerHTML = '';
		}
	}

function ScanCookie(variable)
	{
	cook = document.cookie;
	variable += "=";
	place = cook.indexOf(variable,0);
	if (place <= -1)
		return("0");
	else
		{
		end = cook.indexOf(";",place)
		if (end <= -1)
			return(unescape(cook.substring(place+variable.length,cook.length)));
		else
			return(unescape(cook.substring(place+variable.length,end)));
		}
	}

/*
function CreationCookie (nome, valore, scadenza) {//lasciare scadenza a "nessuna" per non impostare cookie
 	//alert("in function")
    if (scadenza == "nessuna") {
		var data = new Date();
		data.setDate(data.getDate() + 1);//+1 giorno - numero di giorni durata cookie
		data.setMonth(data.getMonth());
		//restituisce la data nel formato necessario
        scadenza = data.toGMTString();
		//alert(scadenza) visualizzare scadenza cookie
    }
    valore = escape(valore);
    document.cookie=nome + "=" + valore + ";expires=" + scadenza;
}
/*/



if(document.all)
	{
	larg = document.body.clientWidth;
	haut = document.body.clientHeight;
	}
else
	{
	larg = screen.width;
	haut = screen.height;
	}
	
html_haut = "<TABLE WIDTH="+larg+" HEIGHT="+haut+" ><TR><TD VALIGN=\"middle\" ALIGN=\"center\">";
html_bas = "</TD></TR></TABLE>";

html_mil = "<TABLE WIDTH=\"441\" HEIGHT=\"270\" CELLPADDING=\"0\" CELLSPACING=\"0\" bgcolor=\"white\" class=\"tabella\" border=\"0\" >";
html_mil += "<TR>";
html_mil += "<TD align=\"right\">";
html_mil += "<A HREF=# onClick=\"closeSup();return(false)\"><style=\"color:#000;float:right;margin-right:10px\"> |X| Chiudi</style></a></br>";
html_mil += "<A HREF=\"../prova-gratuita.html\"><img src=\"../images/finestra-a-discesa.jpg\" border=\"0\"></a>";
html_mil += "</TD>";
html_mil += "</TR>";
html_mil += "</TABLE>";

window.onload = setTimeout("showsup()",10000)//timeout partenza
