function aaWin(url, type) {
if (type=="press") {
		var winl = (screen.width - 500) / 2;
		var wint = (screen.height - 700) / 2;
		settings='height=700,width=500,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=1,resizable=0';
		var MyPerWindow=window.open(url,'personnelWin',settings);
} else {if (type=="videos") {
		var winl = (screen.width - 500) / 2;
		var wint = (screen.height - 350) / 2;
		settings='height=350,width=500,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=0,resizable=1';
		var MyPicWindow=window.open(url,'pictureWin',settings)
} else {if (type=="profile") {
		var winl = (screen.width - 600) / 2;
		var wint = (screen.height - 400) / 2;
		settings='height=400,width=600,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=0,resizable=0';
		var MyByeWindow=window.open(url,'profileWin',settings);
} else {if (type=="popup") {
		var winl = (screen.width - 652) / 2;
		var wint = (screen.height - 418) / 2;
		settings='height=418,width=652,top='+wint+',left='+winl+',status=0,		location=0,scrollbars=0,resizable=1'; 	
    		var MySqWindow=window.open(url,'popWin',settings);
} else {if (type=="horiz") {
		var winl = (screen.width - 600) / 2;
		var wint = (screen.height - 525) / 2;
		settings='height=525,width=600,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=0,resizable=1'; 	
   		var MyHorizWindow=window.open(url,'horizWin',settings);
} else {if (type=="picture") {
		var winl = (screen.width - 430) / 2;
		var wint = (screen.height - 600) / 2;
		settings='height=600,width=430,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=0,resizable=1'; 	
    		var MyMainWindow=window.open(url,'mainWin',settings);
} else {if (type=="square") {
		var winl = (screen.width - 574) / 2;
		var wint = (screen.height - 600) / 2;
		settings='height=600,width=574,top='+wint+',left='+winl+',status=0, 		location=0,scrollbars=0,resizable=1'; 	
    		var MyMainWindow=window.open(url,'squareWin',settings);
		}
		 				}
					}
		    	}
			}
		}
	}
}

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve contenere un indirizzo e-mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' deve contenere un numero.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' deve contenere un numero tra '+min+' e '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è richiesto.\n'; }
  } if (errors) alert('Si è verificato il seguente errore:\n'+errors);
  document.MM_returnValue = (errors == '');
}



 