<!--
function validate_cms_psw(nome_form) {
	min_psw_chars = 6;
	if (document[nome_form].userid.value == ""){ 
		window.alert("Non hai inserito un nuovo UserID");
	} else if (document[nome_form].userid.value.length < min_psw_chars ){
		window.alert("Per motivi di sicurezza inserire un userID di almeno "+ min_psw_chars +" caratteri");
	} else if (document[nome_form].psw1.value != document[nome_form].psw2.value){
		window.alert("Le password inserite non coincidono!");
	} else if (document[nome_form].psw1.value == ""){
		window.alert("Non hai inserito una nuova password");
	} else if (document[nome_form].psw1.value.length < min_psw_chars ){
		window.alert("Per motivi di sicurezza inserire una password di almeno "+ min_psw_chars +" caratteri");
	} else {
		document[nome_form].submit();
	}
} 

function validate_cms_news(nome_form) {
	if (document[nome_form].news.value == ""){ 
		window.alert("Non hai inserito alcuna News");
	}else {
		document[nome_form].submit();
	}
}

function validate_cms_modify_notification(nome_form) {
	if (document[nome_form].email.value == ""){ 
		window.alert("Non hai inserito alcuna E-Mail");
	}else {
		document[nome_form].submit();
	}
}

function validate_cms_mlist(nome_form) {
	min_psw_chars = 6;
	if (document[nome_form].userid.value == ""){ 
		window.alert("Non hai inserito un nuovo UserID");
	} else if (document[nome_form].userid.value.length < min_psw_chars ){
		window.alert("Per motivi di sicurezza inserire un userID di almeno "+ min_psw_chars +" caratteri");
	} else if (document[nome_form].psw1.value != document[nome_form].psw2.value){
		window.alert("Le password inserite non coincidono!");
	} else if (document[nome_form].psw1.value == ""){
		window.alert("Non hai inserito una nuova password");
	} else if (document[nome_form].psw1.value.length < min_psw_chars ){
		window.alert("Per motivi di sicurezza inserire una password di almeno "+ min_psw_chars +" caratteri");
	} else {
		document[nome_form].submit();
	}
} 

function validate_mlist_subcription(){
	var errors='';
	if(document.getElementById('name').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire un NOME.\n';
		}else{
			errors+='- You must insert a NAME.\n';
		}
	}
	if(document.getElementById('surename').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire il COGNOME.\n';
		}else{
			errors+='- You must insert your SURNAME.\n';
		}
	}
	if(document.getElementById('email').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire un indirizzo E-MAIL.\n';
		}else{
			errors+='- You must insert an E-MAIL ADDRESS.\n';
		}
	}	
	if(document.form.accept[1].checked == true){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- Per inviare i suoi dati deve prima dare consenso alla loro trattazione.\n';
		}else{
			errors+='- In order to send your data you must accept the disclaimer.\n';
		}
	}		
	if (errors){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			alert('Si sono verificati i seguenti errori:\n\n'+errors);
		}else{
			alert('The following errors occured:\n\n'+errors);
		}
		
	} else{
		document.form.submit();
	}
}

function validate_samples_request(){
	var errors='';
	if(document.getElementById('company').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire il nome della sua AZIENDA.\n';
		}else{
			errors+='- You must insert the name of your COMPANY.\n';
		}	
	}
	if(document.getElementById('address').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire l\'INDIRIZZO della sua azienda.\n';
		}else{
			errors+='- You must insert the ADDRESS of your company.\n';
		}	
	}	
	if(document.getElementById('locality_italy').options[document.getElementById('locality_italy').selectedIndex].text=="- - - - - - - - - - - - - - - - - -" && document.getElementById('locality_world').options[document.getElementById('locality_world').selectedIndex].text=="- - - - - - - - - - - - - - - - - -"){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire la località da cui scrive.\n';
		}else{
			errors+='- You must insert where you are.\n';
		}	
	}	
	if(document.getElementById('state').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire lo STATO da cui scrive.\n';
		}else{
			errors+='- You must insert the COUNTRY  where you are.\n';
		}
	}	
	if(document.getElementById('email').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire un indirizzo E-MAIL.\n';
		}else{
			errors+='- You must insert an E-MAIL ADDRESS.\n';
		}
	}
	if(document.getElementById('name').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire un NOME.\n';
		}else{
			errors+='- You must insert a NAME.\n';
		}
	}
	if(document.getElementById('surename').value==''){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			errors+='- È necessario inserire il COGNOME.\n';
		}else{
			errors+='- You must insert your SURNAME.\n';
		}
	}
	if (errors){
		if(this.location.search.indexOf('lang=eng')==-1){ //se "lang=eng" non è contenuto nella query
			alert('Si sono verificati i seguenti errori:\n\n'+errors);
		}else{
			alert('The following errors occured:\n\n'+errors);
		}
		
	} else{
		document.form.submit();
	}
}

function resize_frame(reference_id){
	// script by Francesco Bisignani
	// reference_id è la cella della tabella + esterna su cui viene fatto il calcolo
	// x funzionare Opera il topmargin del body devessere "0" altrimenti al topmargin css aggiunge uno ulteriore
	var css_top_margin = 20;	//deve ugualiare il margin-top del CSS
	var css_border = 1;			//spessore dell' eventuale bordo della tabella + esterna
	parent.document.body.rows = (document.getElementById(reference_id).scrollHeight+(1*css_border)+css_top_margin)+",*";
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
