function MM_validateForm_eng() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm_eng.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+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between  '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

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 valido.\n';
      } else if (test!='R') {
        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 (val<min || max<val) errors+='- '+nm+' deve contenere un numero compreso tra  '+min+' e '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è un campo obbligatorio.\n'; }
  } if (errors) alert('Si sono verificati i seguenti errori:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function nascondi(){
MM_showHideLayers('hider','','hide','lunapop','','hide','lunapopt','','hide','lunapops','','hide','info','','hide','infot','','hide','infos','','hide','fanzone','','hide','gadgets','','hide','gadgetst','','hide','gadgetss','','hide','fanzones','','hide','fanzonet','','hide','discografia','','hide','discografias','','hide','discografiat','','hide');
}

function posiziona() {
/*
Source: Euro.runner s.r.l.
(http://www.eurorunner.com)

Author: Jacopo
Author Email:jdeyla@eurorunner.com
*/
  if (window.screen) {    
	var ah = 457;
	if (navigator.appName=="Netscape") {
			var aw = screen.availWidth;
		    window.moveTo(0, 0);
    		window.resizeTo(aw, ah);
	}else{
	var aw = document.body.clientWidth ;
	}
	var spostamento=(aw-750)/2;
	if (spostamento>=0){
	if (navigator.appName!="Netscape") {
		obj=MM_findObj("fondo");
		obj.style.width="100%";
		obj=MM_findObj("lhome");
		obj.style.pixelLeft=spostamento;
//discografia
		obj=MM_findObj("discografia");
		obj.style.pixelLeft=305+spostamento;
		obj=MM_findObj("discografias");
		obj.style.pixelLeft=320+spostamento;
		obj=MM_findObj("discografiat");
		obj.style.pixelLeft=318+spostamento;	
//gadgets		
		obj=MM_findObj("gadgets");
		obj.style.pixelLeft=558+spostamento;
		obj=MM_findObj("gadgetss");
		obj.style.pixelLeft=550+spostamento+30;
		obj=MM_findObj("gadgetst");
		obj.style.pixelLeft=548+spostamento+30;
//fanzone		
		obj=MM_findObj("fanzone");
		obj.style.pixelLeft=486+spostamento;
		obj=MM_findObj("fanzones");
		obj.style.pixelLeft=474+spostamento+30;
		obj=MM_findObj("fanzonet");
		obj.style.pixelLeft=472+spostamento+30;
//info		
		obj=MM_findObj("info");
		obj.style.pixelLeft=404+spostamento;
		obj=MM_findObj("infot");
		obj.style.pixelLeft=385+spostamento+30;
		obj=MM_findObj("infos");
		obj.style.pixelLeft=387+spostamento+30;
//lunapop
		obj=MM_findObj("lunapop");
		obj.style.pixelLeft=235+spostamento;
		obj=MM_findObj("lunapops");
		obj.style.pixelLeft=223+spostamento+30;
		obj=MM_findObj("lunapopt");
		obj.style.pixelLeft=221+spostamento+30;
		} else {
		document.lhome.left=spostamento;
		document.gadgets.left=558+spostamento;
		document.gadgetss.left=550+spostamento;
		document.gadgetst.left=548+spostamento;
		document.fanzone.left=486+spostamento;
		document.fanzones.left=474+spostamento;
		document.fanzonet.left=472+spostamento;
		document.info.left=404+spostamento;
		document.infos.left=396+spostamento;
		document.infot.left=394+spostamento;
		document.lunapop.left=233+spostamento;
		document.lunapops.left=221+spostamento;
		document.lunapopt.left=223+spostamento;
		document.discografia.left=305+spostamento;
		document.discografias.left=320+spostamento;
		document.discografiat.left=318+spostamento;	

	}
	
	
	}
  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function anteprima_cartole(swf) {
	newWindow = window.open("","newWindow","width=300,height=300,left=0,top=0");
	newWindow.document.open();
	newWindow.document.write('<html><title>Lùnapop</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"WIDTH=100% HEIGHT=100%>');
	newWindow.document.write('<PARAM NAME=movie VALUE="../../media/cartoline/'+swf+'.swf"><PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="http://www.lunapop.com/media/cartoline/'+swf+'.swf" quality=high bgcolor=#FFFFFF  WIDTH=100% HEIGHT=100% TYPE="application/x-shockwave-flash"');
	newWindow.document.write('PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');	
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_jumpMenuPopup(targ,selObj,restore){ //v3.0
  window.open(selObj.options[selObj.selectedIndex].value,targ,"width=468,height=400,scrollbars=yes");
  if (restore) selObj.selectedIndex=0;
}

function scrollamelo(){}
function scrollamelo_old(){
  var i,obj;
  t= new Array;
  o=new Array;
  o[1]='menu';   t[1]=0;  
  o[2]='lunapop';   t[2]=69; 
  o[3]='lunapopt';   t[3]=69; 
  o[4]='lunapops';   t[4]=71; 
  o[5]='info';   t[5]=69; 
  o[6]='infot';   t[6]=72; 
  o[7]='infos';  t[7]=74; 
  o[8]='fanzone';   t[8]=69; 
  o[9]='fanzonet';   t[9]=72; 
  o[10]='fanzones';   t[10]=74; 
  o[11]='gadgets';  t[11]=69; 
  o[12]='gadgetst';   t[12]=69; 
  o[13]='gadgetss';  t[13]=74;
  o[14]='discografia';  t[14]=69;
  o[15]='discografiat';   t[15]=71; 
  o[16]='discografias';  t[16]=69;
  o[17]='fondo';  t[17]=0;
  o[18]='hider';   t[18]=72;
  o[19]='menupop';   t[19]=70;
  o[20]="Layer1"; t[20]=115;
  o[21]="menusez"; t[21]=80;
  
  for(i=0; i<6; i+=1) {
  t[i*3+3]=t[i*3+3]+30;
  t[i*3+4]=t[i*3+4]+30;
  }
  
  for (i=1; i<22; i+=1) if (MM_findObj(o[i])!=null) { 
  	obj=MM_findObj(o[i]);
	//alert(obj);
    if (obj.style) { obj=obj.style;}
    obj.top=document.body.scrollTop+t[i];
	}	
}

function maximizeWin() {
  if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    window.moveTo(0, 0);
    window.resizeTo(aw, ah);
  }
}

function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
}

<!-- Funzioni di ingrandimento delle foto
function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFotoOriginal(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

function viewFoto(img){
	largh=foto1.width;
  	altez=foto1.height;
	stringa="width="+largh+",height="+altez;
	newWindow = window.open("","newWindow",stringa,'left=0,top=0');
	newWindow.document.open();
	newWindow.document.write('<html><title>Lùnapop - Ingrandimento Immagine</title><body bgcolor="#000000" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+img+' width='+largh+' height='+altez+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
//  Fine -->