function pop (url,w,h,s,f) {
LeftPosition =(screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
window.open(url,'new','width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+s+',fullscreen='+f+'')
}

function showLay(layId) {
eval("styleUsed="+layId+".style.display;");
if (styleUsed=="none") {
eval(layId+".src='/cm/img/freccia_on.gif';");
eval(""+layId+".style.display='block';");
} else {
eval(layId+".src='/cm/img/freccia_off.gif';");
eval(""+layId+".style.display='none';");
}
}



function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
		return false
	    }
    }
    return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   return false
}
if (len<2) {
return false
}
return true;
}
//-->

function ControllaFormRichiestaInformazioni()
{

	var titolo = document.f1.titolo.value;
		if (titolo=='')
		
		{
			alert("Attenzione titolo necessario");
			return false;
		}	
	
	
	var nome = document.f1.nome.value;
		if (nome=='')
		{
			alert("Attenzione nome necessario");
			return false;
		}	
	var cognome = document.f1.cognome.value;
		if (cognome=='')
		{
			alert("Attenzione cognome necessario");
			return false;
		}	
	
	
	var mail= document.f1.mail.value;
	if (mail=='')
		{
			alert("Attenzione indirizzo mail necessario");
			return false;
		}	
	else
		{
			if (emailCheck(mail)==false)
			{
			alert("Attenzione indirizzo mail errato, controllare .,@");
			return false;
			}	
			
		}	
		
	var id_provincia = document.f1.id_provincia.value;
		if (id_provincia=='' || id_provincia=='0')
		{
			alert("Attenzione provincia di lavoro necessaria");
			return false;
		}	
	
	var richiesta = document.f1.richiesta.value;
		if (richiesta=='')
		{
			alert("Attenzione compilare il campo di richiesta informazioni");
			return false;
		}	
	
	
	
	
return true;	
}
	
		

function ControllaForm_caso_clinico()
{
var radioass=false
			for (var counter = 0; counter < window.document.f1.risp.length; counter++)
			{ 
  			if (window.document.f1.risp[counter].checked) radioass=true;
			}
			if(!radioass){
 			alert("Deve essere selezionata almeno una risposta");
			 return false;
			}
					
			return true;
			}

