function submitRichiestaInfo (oForm,messaggio) {
	campi="";
	for (i=0;i<=oForm.all.length-1;i++) {
		//alert(oForm.all.length);
		//alert(i);
		
		if (oForm.all(i).getAttribute("mandatory") && oForm.all(i).getAttribute("mandatory")=="true" ) {
			
			oggetto=oForm.all(i)
			nome=oggetto.name;
			
			if (oggetto.tagName=="INPUT" && oggetto.value=="" && nome!=null ) {
				campi=campi+", " +nome;
			}
			if (oggetto.tagName=="TEXTAREA" && oggetto.value=="" && nome!=null ) {
				campi=campi+", " +nome;
			}
			if (oggetto.tagName=="SELECT" && oggetto.SelectedIndex==0 && nome!=null ) {
				campi=campi+", " +nome;
			}
			
			if (oggetto.tagName=="INPUT" && oggetto.type=="checkbox" && nome!=null ) {
				idCheckPadre=oggetto.id
				pos=idCheckPadre.lastIndexOf("_");
				idCheckPadre=idCheckPadre.substring(0,pos);
				
				almenoUno=false;
				for (j=0;j<=oForm.all.length-1;j++) {
					oggettoCheck=oForm.all(j)
					idCheck=oggettoCheck.id;
					pos=idCheck.lastIndexOf("_");
					idCheck=idCheck.substring(0,pos);
					
					if (oggettoCheck.tagName=="INPUT" && oggettoCheck.type=="checkbox" && idCheck!=null && idCheck==idCheckPadre && oggettoCheck.checked) {
						almenoUno=true;
					}
					
				}
			
				if (almenoUno==false) {
					pos=campi.lastIndexOf(idCheckPadre);
					if (pos==-1) campi=campi+", " +idCheckPadre;
				}
			}

		}
	}
	if (campi.length >0) {
		campi=campi.substring(1);
		alert(messaggio+"\n\n " + campi);
		return false;
	}
	return true;
}

	function openImmagini(tipo,nomeText,copiaPath) {
		openWindowPopup1("immagini.asp?type=" + tipo +"&virtualPath=false&nomeText=" + nomeText,null);
	}
	function openWindowPopup1(url,winToClose) {
  popupWinFull = window.open(url,'Full','scrollbars=yes,toolbar=no,menubar=no,resizable=yes,fullscreen=no')
  popupWinFull.focus();
  if (winToClose)  winToClose.close();
}
	function onPreview(tipo,nomeText,virtualPath) {
  var f_url = document.getElementById(nomeText);
  var url1 = "" + virtualPath +"" + f_url.value;
  //alert(url1);
  if (!url1) {
    alert("You have to enter an URL first");
    f_url.focus();
    return false;
  }
  document.getElementById(nomeText+"_ipreview").src=url1;
  document.getElementById(nomeText+"_link_ipreview").href=url1;
  //if (nomeText=="PFoto") window.PFoto_ipreview.src=url;
//  if (nomeText=="GFoto") window.GFoto_ipreview.location.replace(url);
//  if (nomeText=="PFoto2") window.PFoto2_ipreview.location.replace(url);
//  if (nomeText=="GFoto2") window.GFoto2_ipreview.location.replace(url);
  return false;

	}
	
	function openWindowStampa(winParent) {
  popupWin = window.open("stampa.asp",'Full','width=200,height=200,scrollbars=no,toolbar=no,menubar=no,resizable=no,fullscreen=no')

  //alert(popupWin.document.all("centerStampa").innerHTML);
  popupWin.focus();
  //popupWin.document.all("centerStampa").innerHTML=winParent.document.all("corpo_stampabile").innerHTML;
  //alert(winParent.document.all("corpo_stampabile").innerHTML);
  //if (winParent)  winParent.close();
}	

	function openWindowStampaAdmin(winParent) {
  popupWin = window.open("../stampa.asp",'Full','width=180,height=50,scrollbars=no,toolbar=no,menubar=no,resizable=no,fullscreen=no')

  //alert(popupWin.document.all("centerStampa").innerHTML);
  popupWin.focus();
  //popupWin.document.all("centerStampa").innerHTML=winParent.document.all("corpo_stampabile").innerHTML;
  //alert(winParent.document.all("corpo_stampabile").innerHTML);
  //if (winParent)  winParent.close();
}	

function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}

var message="Questa operazione non è permessa, se avete bisogno di informazioni o materiale contattateci. \n\nLa riproduzione e l’uso, totale o parziale, in qualsiasi forma e-o con qualsiasi mezzo, di contenuti e immagini senza autorizzazione scritta dell’autore, non è autorizzata ad alcuno.\n\nSi richiama allo scopo la tutela del diritto d’autore e dei diritti connessi alla ideazione e progettazione per la comunicazione visiva così come previsto dal D.L. 29 dicembre 1992 n. 518 e D.L. 16 novembre 1994 n. 685"; 
function click(e) {
if (document.all) {
if (event.button == 2 && window.location.href.indexOf("RSS")==-1 && window.location.href.indexOf("admin")==-1) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

	function openWindowStampaPrezzi(winParent,tipoPrezzo) {

	  popupWin = window.open("stampaScheda.asp?tipoPrezzo=" + tipoPrezzo,'Full','width=200,height=30,scrollbars=no,toolbar=no,menubar=no,resizable=no,fullscreen=no')

 
//  popupWin.focus();
 }	


function adminSelSuperCategoria(scat) {
		checka=document.all['SCAT_'+scat].checked;
		for (var oggetto in document.all) {
			if (document.all[oggetto].name) {
				nomeOggetto=document.all[oggetto].name;
				if (nomeOggetto.substring(0,5+scat.toString().length)=='SCAT_'+scat && (nomeOggetto !=('SCAT_'+scat)) ) {
					document.all[oggetto].checked=checka;
				}	
			}
		}
}
function adminSelCategoria(scat,cat) {
		checka=document.all['SCAT_'+scat+'_CAT_'+cat].checked;
		
		for (var oggetto in document.all) {
			if (document.all[oggetto].name) {
				nomeOggetto=document.all[oggetto].name;
				if (nomeOggetto.substring(0,5+scat.toString().length+5+cat.toString().length)=='SCAT_'+scat+'_CAT_'+cat && (nomeOggetto !=('SCAT_'+scat+'_CAT_'+cat))
					|| ( nomeOggetto.substring(0,5+scat.toString().length)=='SCAT_'+scat && nomeOggetto.indexOf('_CAT_') ==-1) && checka
				
				 ) {
					document.all[oggetto].checked=checka;
				}	
				if (nomeOggetto.substring(0,5+scat.toString().length+5+cat.toString().length)=='SCAT_'+scat+'_CAT_'+cat && (nomeOggetto !=('SCAT_'+scat+'_CAT_'+cat))
					 && !checka
				
				 ) {
					document.all[oggetto].checked=checka;
				}	
				
			}
		}
}

function adminSelProdotto(scat,cat,prod) {
		//alert('SCAT_'+scat+'_CAT_'+cat+'_PROD_'+prod);
		checka=document.all['SCAT_'+scat+'_CAT_'+cat+'_PROD_'+prod].checked;
		
		for (var oggetto in document.all) {
			if (document.all[oggetto].name) {
				nomeOggetto=document.all[oggetto].name;
				if (
				(nomeOggetto.substring(0,5+scat.toString().length+5+cat.toString().length)=='SCAT_'+scat+'_CAT_'+cat || nomeOggetto.substring(0,5+scat.toString().length)=='SCAT_'+scat && (nomeOggetto.indexOf('_CAT_') ==-1 ) ) && 
				(nomeOggetto !=('SCAT_'+scat+'_CAT_'+cat+'_PROD_'+prod))&& 
				(nomeOggetto.indexOf('PROD_') ==-1 ) &&
				checka
				 ) {
					document.all[oggetto].checked=checka;
				}	
			}
		}
}

function adminSelTutto() {
		checka=document.all['export_tutto'].checked;

		for (var oggetto in document.all) {
			if (document.all[oggetto].name) {
				nomeOggetto=document.all[oggetto].name;
				
				if (nomeOggetto.substring(0,5)=='SCAT_' ) {
					document.all[oggetto].checked=checka;
				}	
			}
		}
}