function apri(url,width,height) {

var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
var styleStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+',left=0,top=0';

window.open(url,"", styleStr);
}







function hightlight(divid){
if(document.getElementById(divid)){
	document.getElementById(divid).style.backgroundColor = "#fff000";
}
}

function hightlight_no(divid){
if(document.getElementById(divid)){
	document.getElementById(divid).style.backgroundColor = "transparent";
}
}

function hightlight_click(divid){
divid.style.backgroundColor = "#f2f2f2";
}


function avviaRicerca(op){
	document.ricerca.input_hidden_cerca.value=op;
	document.ricerca.submit();
}



function submitNewsLetterHome(op){

msgError="";


	if(document.data_newsletter.email_home.value!=""){
		var email=document.data_newsletter.email_home.value;
		var filter=/^([a-zA-Z0-9_\-])+([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,4})$/;
		if(!filter.test(email)){
			msgError+="Devi inserire un'e-mail valida\n";
		}
	}

	if(document.data_newsletter.email_home.value==""){
		msgError+="Il campo email non è corretto\n";
	}
  	if(document.data_newsletter.accetta_privacy.checked != true){
  				msgError+="Devi accettare i termini della privacy\n";
  	}

	if(msgError!=""){
		alert(msgError);
		return false;

	}else{

	document.data_newsletter.operazione_newsletter_home.value=op;
	document.data_newsletter.submit();
		return true;

	}
}
function submitLogin(op){
	document.login_home.operazione_login.value=op;
	document.login_home.submit();
	return true;
}

