// JavaScript Document
// Author: Roberto Silvestri
function switch_on_off(item) {
   elem=document.getElementById(item);
   visibile=(elem.style.display!="none")
   prefisso=document.getElementById("menu" + item);
   if (visibile) 
   {
     elem.style.display="none";
     prefisso.innerHTML="<img src='img/file_type/closed64.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   } 
   else 
   {
      elem.style.display="block";
      prefisso.innerHTML="<img src='img/file_type/opened64.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

      
function ShowContent(val)
{
	var testFrame = document.getElementById("contenuti");
    testFrame.src=val;
    testFrame.style.visibility="visible";
}



function controllomail(mail){
	var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
	if (!espressione.test(mail))
	{
	    alert("La mail inserita non &egrave; valida!");
	    return false;
	}
	else
	{
		return true;
	}
}

function open_link()
{
	var link = './riservata/riservata.php';
	var nome = 'riservata';
	
	window.open(link,nome,"width=990,height=700,left=0,top=0,resizable=no, fullscreen=no, channelmode=no, menubar=no, toolbar=no, scrollbars=no, location=no, status=no");
}

function open_dettagli(link)
{
	var nome = 'dettagli';
	
	window.open(link,nome,"width=800,height=400,left=100,top=100,resizable=no, fullscreen=no, channelmode=no, menubar=no, toolbar=no, scrollbars=no, location=no, status=no");
}

function open_galleria(link)
{
	var nome = 'galleria';
	var orizzontale = screen.width;
	var verticale = screen.height;
	var six = (orizzontale - 840) /2;
	var top = (verticale - 650) /2;
	window.open(link,nome,"width=840,height=650,left="+six+",top="+top+",resizable=no, fullscreen=no, channelmode=no, menubar=no, toolbar=no, scrollbars=yes, location=no, status=no");
}


