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 createFlash(src,lar,alt){
    if (navigator.appVersion.indexOf("MSIE") != -1){
    var strContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" ';
    strContent += 'width="'+lar+'" ';
    strContent += 'height="'+alt+'">';
    strContent += '<param name="menu" value="false" />';
    strContent += '<param name="movie" value="'+src+'">';
    strContent += '<param name=quality value=high>';
    strContent += '<param name="wmode" value="transparent">';
    strContent += 'Flash plug-in not installed.';
    strContent += '</object>';
    document.write(strContent);
  }else{
	document.write('<object type="application/x-shockwave-flash" data="'+ src +'" width="'+ lar +'" height="'+ alt +'" wmode="transparent">Flash plug-in not installed.</object>');
  }
}




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;
}



