function chk_codfis(o,messaggio){
	if(!o.value || o.value.search('[^a-zA-Z0-9]')!=-1) {
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}

function chk_telefono(o,messaggio){
	if(!o.value || o.value.search('[^0-9 / .-]')!=-1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}

function chk_num(o,messaggio){
	if(!o.value || o.value.search('[^0-9]') != -1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}


function chk_int(o,messaggio){
	if(!o.value || o.value.search('[^0-9]') != -1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}


function chk_txt1(o,messaggio){
	if(o.value.search('[a-zA-Z0-9 , & . : _ + - ]') == -1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}

function chk_txt(o,messaggio){
	if(o.value.search('[a-zA-Z0-9 "]') == -1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}


function chk_email(o,messaggio){
	if(o.value.search("^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-.]?[0-9a-zA-Z])*\\.[a-zA-Z]{2,4}$") == -1){
		alert(messaggio);
		o.focus();
		return false;
	}
	return true;
}

function chk_info(messaggio){
	if(!document.newsletter.informazione.checked){
		alert(messaggio);
		return false;
	}else{
		return true;
	}
}




function chk_aut2(messaggio){
	
	if(!document.contacts.autorizzazione.checked){
		alert(messaggio);
		return false;
	}else{
		return true;
	}
	
}


//////////////////////////////////////////////////////////////////////////



function popup(url,width,height){
	window.open(url,'popup','scrollbars=yes, top=80, left=80, menubar=no, resizable=no, status=no, width='+width+', height='+height);
}

function conferma(messaggio, url){
	if(confirm(messaggio)){
		return true;
	}
	return false;
}


function chk_url(o){
	if(o.value.search('[a-z]+://[a-zA-Z0-9]+\.[a-zA-Z0-9]+') == -1){
		alert('Campo ' + o.name + ' errato');
		o.focus();
		return false;
	}
	return true;
}
function chk_url1(o,m){
	if(o.value.search('[a-zA-Z0-9]+\.[a-zA-Z0-9]+') == -1){
		if(arguments.length==2){
			alert(m);
			o.focus();
		}
		return false;
	}
	return true;
}

function chk_passwd(o,v){
	if(o.value.search('[a-zA-Z0-9]') == -1 || o.value.length < 9 ){
		if(arguments.length==1) alert('Campo ' + o.name + ' errato');
		else if(arguments.length==2) alert(v);
		o.focus();
		return false;
	}
	return true;
}

function chk_passwd2(o1,o2,v){
	if( o1.value != o2.value ){
		if(arguments.length==1) alert('Campo ' + o.name + ' errato');
		else if(arguments.length==2) alert(v);
		o.focus();
		return false;
	}
	return true;
}


function azzera(url){
	window.location.href = url;
}

