function hide_button(){
 document.getElementById('Invia').style.display='none';
}
function agree(){
 var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0; 
 if (document.getElementById('frm_agree').checked){
  document.getElementById('Invia').style.display=(IE)?'block':'block';
 }else{
  document.getElementById('Invia').style.display='none';
 }
}
function inizio(){
  document.getElementById('frm_agree').checked=false;
 }
///////////////////////////////////////////////////////////////////
function printpage() {
	window.print();  
}
///////////////////////////////////////////////////////////////////
function change(img){
	document.images["photo"].src = img;
}
////////////////////////////////////////////////////////////////////

var putItThere = null; 

var chasm = screen.availWidth;
var mount = screen.availHeight;


var w = 0;
var h = 0;


function deadCenter(u,w,h) {
  putItThere = window.open(u,'posB','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 10) * .5));
}

var pagina=null;
function apri (url,w,h,x,y){
if (pagina != null)
	pagina.close();
	pagina=window.open(url,null,"fullscreen=no,status=no,resizable=yes,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+x+",left="+y);
}
function apriFullscreen (url){
	w=screen.width;
	h=screen.height;
if (pagina != null)
	pagina.close();
	pagina=window.open(url,null,"fullscreen=yes,status=no,resizable=no,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,channelmode=yes,width="+w+",height="+h+",top=0,left=0");
	//pagina=window.open(url,'','fullscreen=yes');
}
//////////////////////////////////////////////////////////////////////
(function(){

	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
		
	}catch(oh){};
})();

/*//////////////////////////////////////////////////////////////////////////////////////*/
var pagina=null;
function apriPopup(url,w,h){
	x=screen.width/2-w/2;
	y=screen.height/2-h/2;
	if (pagina != null)
		pagina.close();
	pagina=window.open(url,"","fullscreen=no,status=no,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+y+",left="+x);
}





/*//////////////////////////////////////////////////////////////////////////////////////*/
var whitespace = " \t\n\r";
function isEmail (s)
{
	if (isEmpty(s)) 
	   if (isEmail.arguments.length == 1) return defaultEmptyOK;
	   else return (isEmail.arguments[1] == true);
	if (isWhitespace(s)) return false;
	var i = 1;
	var sLength = s.length;
	while ((i < sLength) && (s.charAt(i) != "@")){ 
		i++
	}
	if ((i >= sLength) || (s.charAt(i) != "@")) return false;
	else i += 2;
	while ((i < sLength) && (s.charAt(i) != ".")){ 
		i++
	}
	if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
	else return true;
}
function isEmpty(s){
	return ((s == null) || (s.length == 0))
}
function isWhitespace (s){
	var i;
	if (isEmpty(s)) return true;
	for (i = 0; i < s.length; i++){   
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}






/*//////////////////////////////////////////////////////////////////////////////////////*/
function ShowHide(passa_el){
	if(document.getElementById){
	var el = document.getElementById(passa_el);
		if(el.style.display != "block"){
				el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}





/*//////////////////////////////////////////////////////////////////////////////////////*/

var layerPrecedente="sottomenu1";
var linkPrecedente="linkattivo1";

// Funzione per l'accensione di un livello (con spegnimento del precedente)
function accendiMenu (dopo,dopoLink) {

	Scambia (dopo,layerPrecedente,dopoLink,linkPrecedente);
	layerPrecedente = dopo;
	linkPrecedente = dopoLink;
}


// Funzione per l'apertura e chiusura dei menu' (scambia la visibilità di layers)
function Scambia(dopo, prima, dopoLink, primaLink) 
{ 
//alert('dopo-'+dopo+' prima-'+prima);
if (prima != '') {
	// Explorer 
	if(document.all) 
	{ 
	document.all[prima].style.visibility='hidden'; 
	document.all[prima].style.display='none'; 
	} 
	//netscape 4.73 
	if (document.layers) 
	{ 
	document.layers(prima).style.visibility='hidden' 
	document.layers(prima).style.display='none' 
	} 
	//netscape 7.1 
	if (document.getElementById) 
	{ 
	document.getElementById(prima).style.visibility='hidden'; 
	document.getElementById(prima).style.display='none'; 
	} 
}
if (dopo != '') {
	// Explorer 
	if(document.all) 
	{ 
	document.all[dopo].style.visibility='visible'; 
	document.all[dopo].style.display='block'; 
	} 
	//netscape 4.73 
	if (document.layers) 
	{ 
	document.layers(dopo).style.visibility='visible' 
	document.layers(dopo).style.display='block' 
	} 
	//netscape 7.1 
	if (document.getElementById) 
	{ 
	document.getElementById(dopo).style.visibility='visible'; 
	document.getElementById(dopo).style.display='block'; 
	} 
}

if (primaLink != '') {
	// Explorer 
	if(document.all) 
	{ 
	document.all[primaLink].className="";
	} 
	//netscape 4.73 
	if (document.layers) 
	{ 
	document.layers(primaLink).className="";
	} 
	//netscape 7.1 
	if (document.getElementById) 
	{ 
	document.getElementById(primaLink).className="";
	} 
}
if (dopoLink != '') {
	// Explorer 
	if(document.all) 
	{ 
	document.all[dopoLink].className="attivo"; 
	} 
	//netscape 4.73 
	if (document.layers) 
	{ 
	document.layers(dopoLink).className="attivo";
	} 
	//netscape 7.1 
	if (document.getElementById) 
	{ 
	document.getElementById(dopoLink).className="attivo";
	} 
}


} 



/*// ANTI-SPAM ////////////////////////////////////////////////////////////////////////////////////*/
function DisplayMail(Server, Login, Display){
if ((Display.length == 0) || (Display.indexOf('@')+1)) {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Login + "@" + Server + "</a>"); }
else {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Display + "</a>"); }
}
