// JavaScript Document
function popup( pageToLoad, name, width, height, sb, stat, resiz) { //v2.0
    	xposition=0; yposition=0;
    	if (parseInt(navigator.appVersion) >= 4){
        	xposition = (screen.width - width + 10) / 2;
        	yposition = (screen.height - height + 65) / 2;
	    }
    	args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=" + resiz + ",scrollbars= " + sb + "," + "status=" + stat + ",titlebar=0," + "toolbar=0," + "hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition;           
	    name=window.open( pageToLoad,name,args );
		name.focus();
}

function new_win(url){
	nuova_finestra=window.open(url,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=522,height=300")
}

function shlayer(livello, stato) {
	if (document.layers) {
	  if (stato==1) {
		document[livello].visibility='show';
	  }else {
	    document[livello].visibility='hide';
	  }
	} else { 
	  if (stato==1) {
	    document.all[livello].style.visibility='visible';  
	  }else{
	    document.all[livello].style.visibility='hidden';
	  }
	}
}

function populateSWF(filmato, w, h, contenitore){
	var shtml = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
	shtml += " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\"";
	shtml += "  width=\""+w+"\" height=\""+h+"\" id=\"f_"+contenitore+"\" align=\"\">";
	shtml += " <param name=movie value=\""+filmato+"\">";
	shtml += " <param name=quality value=high>";
	shtml += " <param name=menu value=false>";
	shtml += " <param name=wmode value=transparent>";
	shtml += " <embed src=\""+filmato+"\" quality=high menu=false ";
	shtml += "wmode=\"transparent\""
	shtml += "width=\""+w+"\" height=\""+h+"\" name=\"home\" align=\"\"";
	shtml += "  type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
	shtml += "     </object>"
	document.getElementById(contenitore).innerHTML = shtml;
}

function chkFormContatti() {
	compilato = true;
	for(i=0; i<document.getElementById('form1').length-2;i++){
		if (document.getElementById('form1').elements[i].value == "") {
			compilato = false;
		}
	}
	if (compilato) {
		if ((document.getElementById("email").value.indexOf (' ') != -1) || (document.getElementById("email").value.indexOf ('@') == -1) || (document.getElementById("email").value.indexOf ('.') == -1)) {
			alert ("Indirizzo e-mail non valido - Invalid e-mail address");
			document.returnValue = false;
		} else {
			document.returnValue = true;
		}
	} else {
		alert ('Compilare tutti i campi obbligatori - Please fill all obligatory field');
		document.returnValue = false;
	}
}

function chkFormGiornalisti() {
	compilato = true;
	for(i=0;i<=13;i++){
		if ((document.form1.elements[i].type=="text") && (document.form1.elements[i].value == "")) {
			compilato = false;
		}
	}
	if (document.form1.elements[21].value == "") {
		compilato = false;
	}	
	
	if (compilato) {
		if ((document.getElementById("email").value.indexOf (' ') != -1) || (document.getElementById("email").value.indexOf ('@') == -1) || (document.getElementById("email").value.indexOf ('.') == -1) || (document.getElementById("emailP").value.indexOf (' ') != -1) || (document.getElementById("emailP").value.indexOf ('@') == -1) || (document.getElementById("emailP").value.indexOf ('.') == -1)) {
			alert ("Indirizzo e-mail non valido - Invalid e-mail address");
			document.returnValue = false;
		} else {
			document.returnValue = true;
		}
	} else {
		alert ('Compilare tutti i campi obbligatori - Please fill all obligatory field');
		document.returnValue = false;
	}
}