
function isEmail(what) {
	var msg3="<%=msg3%>"
	var f2 = self.document.frm_abbon;
   var i = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
   if(!i.test(what)) {
   	alert(msg3);
   	f2.mail.focus();
   	return false
   }
   return true;
}



function open_pop(pagina,id,larg,alt)
{

var option = "width=" + larg +",height=" + alt + ",screenX=50,left=50,screenY=50,top=50,titlebar=no,scrollbars=no,resizable=no"
nuova=window.open(pagina +"?id=" + id,"dettaglio",option);
nuova.creator=self;
}


function open_popr(pagina,id,larg,alt)
{

var option = "width=" + larg +",height=" + alt + ",screenX=50,left=50,screenY=50,top=50,titlebar=no,scrollbars=yes,resizable=yes"
nuova=window.open(pagina +"?id=" + id,"dettaglio",option);
nuova.creator=self;
}


function submit_riservata(theForm){
	continua=true
	if(theForm.User.value == "")
	{
		alert("<%=txt_js_user%>");
		theForm.User.focus();
		continua= false;
	}
	if(continua==true && theForm.Password.value == "")
	{
		alert("<%=txt_js_pwd%>");
		theForm.Password.focus();
		continua= false;
	}
	if(continua==true) theForm.submit();

}

function submit_lingua(theForm){

	theForm.action=theForm.action + '&sel_lingua=' + theForm.sel_lingua.options[theForm.sel_lingua.options.selectedIndex].value
	theForm.submit();

}



function submit_cur(theForm){
	continua=true
	var msg1="<%=msg1%>"
	var msg2="<%=msg2%>"

	if(theForm.nome.value == "")
	{
		alert(msg1 +" <%=txt_cur1%>");
		theForm.nome.focus();
		continua= false;
	}
	if(continua==true && theForm.cognome.value == "")
	{
		alert(msg1 +" <%=txt_cur2%>");
		theForm.cognome.focus();
		continua= false;
	}
	if(continua==true && theForm.nascita.value == "")
	{
		alert(msg1 +" <%=txt_cur3%>");
		theForm.nascita.focus();
		continua= false;
	}
	if(continua==true && theForm.mail.value == "")
	{
		alert(msg1 +" <%=txt_cur4%>");
		theForm.mail.focus();
		continua= false;
	}

	if (continua==true && !isEmail(theForm.mail.value)) {
	          alert(msg2 + " <%=txt_cur4%>.");
		theForm.mail.focus();
		continua= false;
	  }

	if(continua==true && theForm.studio.value == "")
	{
		alert(msg1 +" <%=txt_cur5%>");
		theForm.studio.focus();
		continua= false;
	}
	if(continua==true && theForm.pos.value == "")
	{
		alert(msg1 +" <%=txt_cur6%>");
		theForm.pos.focus();
		continua= false;
	}

	  if (continua==true && theForm.curriculum_file.value=="" )
	  {
	    alert(msg1 +" <%=txt_cur8%>");
	    theForm.curriculum_descr.focus();
	    continua= false;
	  }


		if ((theForm.consenso_privacy[1].checked==true) && (continua==true)) {
		    alert("Non è possibile inviare la richiesta se non si da l'assenso al trattamento dei dati");
		    theForm.consenso_privacy[0].focus();
		continua= false;
		}


	theForm.action="curriculum.asp?i=1";
	if(continua==true) theForm.submit();

}
 
