var SB;
function ScrollBanOK()
{
	document.getElementById("bannerdiv").style.display = "block";
	document.getElementById("bannerdiv").style.position = "absolute";
	document.getElementById("bannerdiv").style.top = document.body.scrollTop;
	document.getElementById("bannerdiv").style.marginTop = "90px";
	document.getElementById("bannerdiv").style.marginLeft = (1035+((window.screen.width-1035)/2)) + "px";
	SB = window.setTimeout("ScrollBanOK()", 3);
}
function ScrollBanNO()
{
	window.clearTimeout(SB);
}

$(function() {
	ScrollBanOK();
});

function mio(id)
{var xhr; 
try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
catch (e) 
{try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
catch (e2) 
{try {  xhr = new XMLHttpRequest();     }
catch (e3) {  xhr = false;   }
}}
xhr.onreadystatechange  = function()
{if(xhr.readyState  == 4)
{if(xhr.status  == 200) 
document.ajax.dyn="Received:"  + xhr.responseText; 
else 
document.ajax.dyn="Error code " + xhr.status;
}}; 
xhr.open('POST', '/contabanner.aspx?id=' + id,  true); 
xhr.send(null);}

numdivs=5
IE5=NN4=NN6=false
if(document.all)IE5=true
else if(document.layers)NN4=true
else if(document.getElementById)NN6=true
function init() {
	showDiv(0)
}
function showDiv( which ) {
	for(i=0;i<numdivs;i++) {
		if(NN4) eval("document.div"+i+".display='none'")
		if(IE5) eval("document.all.div"+i+".style.display='none'")
		if(NN6) eval("document.getElementById('div"+i+"').style.display='none'")
	}
	if(NN4) eval("document.div"+which+".display='block'")
	if(IE5) eval("document.all.div"+which+".style.display='block'")
	if(NN6) eval("document.getElementById('div"+which+"').style.display='block'")
}

function CheckLength(txta,chrs,maxchars)
{ with (document.modulo)
{ var chars=txta.value
if (chars.length > maxchars)
{ txta.value=chars.substr(0,maxchars);
txta.blur(); }
chrs.value=maxchars-txta.value.length; } 
}
  
function validateForm(form) {  
if ( (form.nome.value == "") ) { 
alert("Attenzione! Il campo NOME è obbligatorio!");
form.nome.focus();  
return false;}
if ( (form.messaggio.value == "") ) { 
alert("Attenzione! Devi inserire la richiesta!");
form.messaggio.focus();  
return false;}
if ( (form.telefono.value == "") ) { 
alert("Attenzione! Il campo TELEFONO è obbligatorio!");
form.telefono.focus();  
return false;}
if  ( form.email.value.indexOf( "@") == -1 )
{ alert( "Inserisci un indirizzo valido per la e-mail" ); 
return false; }
if ( form.email.value.indexOf( ".") == -1 )
{ alert( "Inserisci un indirizzo valido per la e-mail" ); 
return false; }
if ( (form.privacy.checked == false) ) { 
alert("Attenzione! Devi autorizzare il trattamento dei tuoi dati!");
form.privacy.focus();  
return false;}
return true;}  
