/*-----------------------------------------------*/
/*------------ ICONA ERRORE CODICE --------------*/
/*-----------------------------------------------*/

function VisualizzaStatoCodice(codice_trovato,nome_elemento){

	if (codice_trovato == "0") {
	
		var ElementoNascosto = document.getElementById("ok_"+nome_elemento);
		ElementoNascosto.style.display = "none";
		
		var ElementoNascosto = document.getElementById("err_"+nome_elemento);
		ElementoNascosto.style.display = "block";

		document.getElementById(nome_elemento).value = "";
		//document.getElementById("bottone_invia_codici").disabled = true ;
	
	} else {

		var ElementoNascosto = document.getElementById("ok_"+nome_elemento);
		ElementoNascosto.style.display = "block";
		
		var ElementoNascosto = document.getElementById("err_"+nome_elemento);
		ElementoNascosto.style.display = "none";
		//document.getElementById("bottone_invia_codici").disabled = false ;

	}
	
}

function VisualizzaCodiciDoppi(){

var codicie_doppio=0;

for (i=1; i<11; i++) {
	
	if ( document.getElementById("materiale_"+i) != null ) {
		if ( document.getElementById("materiale_"+i).value != "" ) {
			
			
			codice_corrente = document.getElementById("materiale_"+i).value

			codicie_doppio = 0 ;

					/*******************************************************************************************/
					/**** MI SCORRO NUOVAMENTE TUTTI I CODICI PER VEDERE CHE NON CE NE SIANO DI DOPPI **********/
					/*******************************************************************************************/
					for (i_2=1; i_2<11; i_2++) {
						
						if ( document.getElementById("materiale_"+i_2) != null ) {
							
							if ( document.getElementById("materiale_"+i_2).value != "" ) {
								
								if ( codice_corrente == document.getElementById("materiale_"+i_2).value ) {
									
									codicie_doppio = codicie_doppio + 1
									
								}

									/************************************************************************/
									/***** SE BECCO UN CODICE INSERITO PIU' DI UNA VOLTA FERMO IL CICLO *****/
									/************************************************************************/								
									if ( codicie_doppio > 1 ) {
										
										document.getElementById("materiale_"+i_2).value = "";
										alert("Il numero di serie '" + codice_corrente + "' è stato inserito più volte !");
										
										var ElementoNascosto = document.getElementById("ok_materiale_"+i_2);
										ElementoNascosto.style.display = "none";
										
										var ElementoNascosto = document.getElementById("err_materiale_"+i_2);
										ElementoNascosto.style.display = "none";

										//document.getElementById("bottone_invia_codici").disabled = true ;
										
										return false;
									}
									/************************************************************************/
									/************************************************************************/
									/************************************************************************/
								
							}
							
						}
						
					}
					/*******************************************************************************************/
					/*******************************************************************************************/
					/*******************************************************************************************/
			
			
		}
	}
	
}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*------------ CARICAMENTO MENU -----------------*/
/*-----------------------------------------------*/

function VerificaCodiceInserito(numero_elemento,nome,valore,codice_articolo){
		
		if (valore != ""){
			
			createXMLHttpRequest();
	
			UrlPagina = ""
			UrlPagina = UrlPagina + "?numero_elemento="+numero_elemento
			UrlPagina = UrlPagina + "&nome="+nome
			UrlPagina = UrlPagina + "&valore="+valore
			UrlPagina = UrlPagina + "&codice_articolo="+codice_articolo
						
			xmlHttp.onreadystatechange = handleStateChangeVerificaCodici;
			xmlHttp.open("GET", "verifica_codice.asp"+UrlPagina, true);
			xmlHttp.send(null);
			
		}else{
			
			var ElementoNascosto = document.getElementById("ok_"+nome);
			ElementoNascosto.style.display = "none";
			
			var ElementoNascosto = document.getElementById("err_"+nome);
			ElementoNascosto.style.display = "none";
			
		}
	
}

function handleStateChangeVerificaCodici(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Si è verificato un errore</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + ""

		if (xmlHttp.readyState==4){

			if (xmlHttp.status == 200){
				
				document.getElementById("Div_Controllo_Codice").innerHTML = xmlHttp.responseText;
				
				VisualizzaStatoCodice(document.getElementById("codice_trovato").value,document.getElementById("nome_elemento").value);
				
				VisualizzaCodiciDoppi()
				
			}else{

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Div_Controllo_Codice").innerHTML = Messaggio;
			}
		
		}else{
			document.getElementById("Div_Controllo_Codice").innerHTML = Caricamento
		}


}
/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------*/
/*------------ INIZIALIZZO OGGETTO --------------*/
/*-----------------------------------------------*/

var xmlHttp;

function createXMLHttpRequest(){

	if (window.XMLHttpRequest) {
	   xmlHttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
	   xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	   alert('Impossibile continuare: il tuo browser non supporta XMLHttpRequest');
	}

}
/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/





//---------------------------------------------------------------
// --- FUNZIONE GLOBALE PRE CARICAMENTO PAGINA 
//---------------------------------------------------------------
function CaricaPaginaGlobale(Elemento){

var Elemento;

if (Elemento=='') {
	Elemento = "id_pagina_controllo";
}

//alert(Elemento);

Id_Pagina = document.getElementById(Elemento).value;
TitoloPaginaNew = document.title;
Lang = document.getElementById("Lingua").value;

if (document.getElementById("Messaggio_Iscrizione") !=null) {
	var Messaggio_Iscrizione = "";			
	Messaggio_Iscrizione =  document.getElementById("Messaggio_Iscrizione").value;
}

var Id_Categoria = "";
var Id_Categoria_2 = "";
var Id_Categoria_3 = "";
var Id_Categoria_4 = "";
var Id_Prodotto = "";

if (document.getElementById("id_categoria") !=null) {
	Id_Categoria = document.getElementById("id_categoria").value;
	Id_Categoria_2 = document.getElementById("id_categoria_2").value;
	Id_Categoria_3 = document.getElementById("id_categoria_3").value;
	Id_Categoria_4 = document.getElementById("id_categoria_4").value;
	Id_Prodotto = document.getElementById("id_prodotto").value;
}

UrlPagina = "?id_pagina="+document.getElementById(Elemento).value+"&Lang="+Lang+"&id_email="+document.getElementById("id_email").value
UrlPagina = UrlPagina + "&Messaggio="+Messaggio_Iscrizione
UrlPagina = UrlPagina + "&id_categoria="+Id_Categoria
UrlPagina = UrlPagina + "&id_categoria_2="+Id_Categoria_2
UrlPagina = UrlPagina + "&id_categoria_3="+Id_Categoria_3
UrlPagina = UrlPagina + "&id_categoria_4="+Id_Categoria_4
UrlPagina = UrlPagina + "&id_prodotto="+Id_Prodotto

if (document.getElementById("tabella_origine") !=null) {
	UrlPagina = UrlPagina + "&tabella_origine="+document.getElementById("tabella_origine").value
}

		CaricaPagina(
			Id_Pagina,
			Lang,
			UrlPagina,
			Id_Categoria,
			Id_Categoria_2,
			Id_Categoria_3,
			Id_Categoria_4,
			Id_Prodotto,
			TitoloPaginaNew
		);
}
//---------------------------------------------------------------
//---------------------------------------------------------------
//---------------------------------------------------------------






/*-----------------------------------------------*/
/*------------ CARICAMENTO MENU -----------------*/
/*-----------------------------------------------*/

function CaricaMenu(Id_Pagina,Lang,UrlPagina,Id_Categoria,Id_Categoria_2,Id_Categoria_3,Id_Categoria_4,Id_Prodotto,TitoloPaginaNew){

		createXMLHttpRequest();

		document.title = TitoloPaginaNew;
		document.getElementById("id_pagina_controllo").value = Id_Pagina;
		document.getElementById("Lingua").value = Lang;
		
		xmlHttp.onreadystatechange = handleStateChangeMenu;
		xmlHttp.open("GET", "menu.asp"+UrlPagina, true);
		xmlHttp.send(null);
}

function handleStateChangeMenu(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare il menu di navigazione ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"

		if (xmlHttp.readyState==4){

			if (xmlHttp.status == 200){
				document.getElementById("Menu_Lang").innerHTML = xmlHttp.responseText;

				//---------------------------------------------------------------
				// --- QUANDO FINISCO DI CARICARE IL MENU ALLORA CARICO LA PAGINA
				//---------------------------------------------------------------
				Id_Pagina = document.getElementById("id_pagina_controllo").value;
				TitoloPaginaNew = document.title;
				Lang = document.getElementById("Lingua").value;
				
				if (document.getElementById("Messaggio_Iscrizione") !=null) {
					var Messaggio_Iscrizione = "";			
					Messaggio_Iscrizione =  document.getElementById("Messaggio_Iscrizione").value;
				}
				
				var Id_Categoria = "";
				var Id_Categoria_2 = "";
				var Id_Categoria_3 = "";
				var Id_Categoria_4 = "";
				var Id_Prodotto = "";

				if (document.getElementById("id_categoria") !=null) {
					Id_Categoria = document.getElementById("id_categoria").value;
					Id_Categoria_2 = document.getElementById("id_categoria_2").value;
					Id_Categoria_3 = document.getElementById("id_categoria_3").value;
					Id_Categoria_4 = document.getElementById("id_categoria_4").value;
					Id_Prodotto = document.getElementById("id_prodotto").value;
				}

				UrlPagina = "?id_pagina="+document.getElementById("id_pagina_controllo").value+"&Lang="+Lang+"&id_email="+document.getElementById("id_email").value
				UrlPagina = UrlPagina + "&Messaggio="+Messaggio_Iscrizione
				UrlPagina = UrlPagina + "&id_categoria="+Id_Categoria
				UrlPagina = UrlPagina + "&id_categoria_2="+Id_Categoria_2
				UrlPagina = UrlPagina + "&id_categoria_3="+Id_Categoria_3
				UrlPagina = UrlPagina + "&id_categoria_4="+Id_Categoria_4
				UrlPagina = UrlPagina + "&id_prodotto="+Id_Prodotto

				if (document.getElementById("tabella_origine") !=null) {
					UrlPagina = UrlPagina + "&tabella_origine="+document.getElementById("tabella_origine").value
				}

				CaricaPagina(
					Id_Pagina,
					Lang,
					UrlPagina,
					Id_Categoria,
					Id_Categoria_2,
					Id_Categoria_3,
					Id_Categoria_4,
					Id_Prodotto,
					TitoloPaginaNew
				);
				
				//---------------------------------------------------------------
				//---------------------------------------------------------------
				//---------------------------------------------------------------

			}else{

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Menu_Lang").innerHTML = Messaggio;
			}
		
		}else{
			document.getElementById("Menu_Lang").innerHTML = Caricamento
		}


}
/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/















/*----------------------------------------------------------------------*/
/*------------ CARICAMENTO PAGINA CATALOGO CON CONTROLLO ---------------*/
/*----------------------------------------------------------------------*/

function CaricaPaginaCatalogo(Id_Pagina,Lang,UrlPagina,Id_Categoria,Id_Categoria_2,Id_Categoria_3,Id_Categoria_4,Id_Prodotto,TitoloPaginaNew){

//alert(UrlPagina);

	createXMLHttpRequest();

		document.title = TitoloPaginaNew;
		document.getElementById("id_pagina_controllo").value = Id_Pagina;
		document.getElementById("Lingua").value = Lang;

//alert(document.getElementById("id_utente_accesso").value);

	if ((document.getElementById("id_utente_accesso") !=null)&&(document.getElementById("id_utente_accesso") !='')) {
			xmlHttp.onreadystatechange = handleStateChange;
			xmlHttp.open("GET", "content.asp"+UrlPagina, true);
			xmlHttp.send(null);
	}else{
			Visualizza_Acc_Negato();
	}
		
}

/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/


/*-----------------------------------------------*/
/*------------ CARICAMENTO PAGINA ---------------*/
/*-----------------------------------------------*/

function CaricaPaginaCodici(Id_Pagina,Lang,UrlPagina,Id_Categoria,Id_Categoria_2,Id_Categoria_3,Id_Categoria_4,Id_Prodotto,TitoloPaginaNew){

	createXMLHttpRequest();

		document.title = TitoloPaginaNew;
		document.getElementById("id_pagina_controllo").value = Id_Pagina;
		document.getElementById("Lingua").value = Lang;
		
			xmlHttp.onreadystatechange = handleStateChange;
			xmlHttp.open("GET", "content.asp"+UrlPagina, true);
			xmlHttp.send(null);
		
}

function handleStateChange(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				

				document.getElementById("Contenuto_Pagina").innerHTML = xmlHttp.responseText;

				// ACCESSO EFFETTUATO DA POP UP
				if (document.getElementById("controllo_pop_up")!=null){
					var ElementoNascosto = document.getElementById("Effettuare_Login_0");
					ElementoNascosto.style.display = "none";
					
					var ElementoNascosto = document.getElementById("Effettuare_Login");
					ElementoNascosto.style.display = "none"; 
				}

			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Contenuto_Pagina").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("Contenuto_Pagina").innerHTML = Caricamento
		}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*------------ CARICAMENTO PAGINA ---------------*/
/*-----------------------------------------------*/

function CaricaPaginaCodici_2(Id_Pagina,Lang,UrlPagina,Id_Categoria,Id_Categoria_2,Id_Categoria_3,Id_Categoria_4,Id_Prodotto,TitoloPaginaNew){

	createXMLHttpRequest();
		
		document.title = TitoloPaginaNew;
		document.getElementById("id_pagina_controllo").value = Id_Pagina;
		document.getElementById("Lingua").value = Lang;

		if (document.getElementById("codice_articolo").value == ''   ){
			alert("Inserire il codice del prodotto !");
			document.getElementById("codice_articolo").focus();
			return false;
		}

			xmlHttp.onreadystatechange = handleStateChange_2;
			xmlHttp.open("GET", "content.asp"+UrlPagina, true);
			xmlHttp.send(null);
		
}

function handleStateChange_2(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				

				document.getElementById("Contenuto_Pagina").innerHTML = xmlHttp.responseText;

				// ACCESSO EFFETTUATO DA POP UP
				if (document.getElementById("controllo_pop_up")!=null){
					var ElementoNascosto = document.getElementById("Effettuare_Login_0");
					ElementoNascosto.style.display = "none";
					
					var ElementoNascosto = document.getElementById("Effettuare_Login");
					ElementoNascosto.style.display = "none"; 
				}

			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Contenuto_Pagina").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("Contenuto_Pagina").innerHTML = Caricamento
		}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*------------ CARICAMENTO PAGINA ---------------*/
/*-----------------------------------------------*/

function CaricaPagina(Id_Pagina,Lang,UrlPagina,Id_Categoria,Id_Categoria_2,Id_Categoria_3,Id_Categoria_4,Id_Prodotto,TitoloPaginaNew){

//alert(UrlPagina);

	createXMLHttpRequest();

		document.title = TitoloPaginaNew;
		document.getElementById("id_pagina_controllo").value = Id_Pagina;
		document.getElementById("Lingua").value = Lang;

			xmlHttp.onreadystatechange = handleStateChange;
			xmlHttp.open("GET", "content.asp"+UrlPagina, true);
			xmlHttp.send(null);
		
}

function handleStateChange(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				
				document.getElementById("Contenuto_Pagina").innerHTML = xmlHttp.responseText;

				//---------------------------------------------------------------
				// --- QUANDO FINISCO DI CARICARE LA PAGINA ALLORA CARICO LE FOTO
				//---------------------------------------------------------------
					if (document.getElementById("Immagini_Pagina_Ajax") != null){
						
						Larghezza = document.getElementById("larghezza_immagine").value;
						Altezza = document.getElementById("altezza_immagine").value;
		
						Id_Padre = document.getElementById("id_padre").value;
						Tabella_Padre = document.getElementById("tabella_pagina_controllo").value;
		
//						UrlPagina = "?id_pagina="+document.getElementById("id_pagina_controllo").value+"&Lang="+document.getElementById("Lingua").value+"&id_email="+document.getElementById("id_email").value;
						UrlPagina = "?id_padre="+document.getElementById("id_padre").value+"&Lang="+document.getElementById("Lingua").value+"&id_email="+document.getElementById("id_email").value;		

						TitoloPaginaNew = document.title;
						Lang = document.getElementById("Lingua").value;

						CaricaImmagini(Id_Padre,Lang,UrlPagina,TitoloPaginaNew,Larghezza,Altezza,Tabella_Padre);
					}
				//---------------------------------------------------------------
				//---------------------------------------------------------------
				//---------------------------------------------------------------

				// ACCESSO EFFETTUATO DA POP UP
				if (document.getElementById("controllo_pop_up")!=null){
					var ElementoNascosto = document.getElementById("Effettuare_Login_0");
					ElementoNascosto.style.display = "none";
					
					var ElementoNascosto = document.getElementById("Effettuare_Login");
					ElementoNascosto.style.display = "none"; 
				}

			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Contenuto_Pagina").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("Contenuto_Pagina").innerHTML = Caricamento
		}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

















/*--------------------------------------------------------*/
/*------------ CARICAMENTO IMMAGINI PAGINA ---------------*/
/*--------------------------------------------------------*/

function CaricaImmagini(Id_Padre,Lang,UrlPagina,TitoloPaginaNew,Larghezza,Altezza,Tabella_Padre){

		Immagine = "";
		Immagine = Immagine + "<iframe "
		Immagine = Immagine + "src='immagini.asp?id_padre="+Id_Padre+"&Tabella_Padre="+Tabella_Padre+"&Larghezza="+Larghezza+"&Altezza="+Altezza+"' "
		Immagine = Immagine + "width='"+Larghezza+"' Height='"+Altezza+"' "
		Immagine = Immagine + "scrolling='no' frameborder='0'>"
		Immagine = Immagine + "</iframe>"

		document.getElementById("Immagini_Pagina_Ajax").innerHTML = Immagine

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------*/
/*------------ SELEZIONE LINGUA -----------------*/
/*-----------------------------------------------*/

function Seleziona_Lingua(Lingua) {

	Id_Pagina = document.getElementById("id_pagina_controllo").value;
	
	UrlPagina = "?id_pagina="+document.getElementById("id_pagina_controllo").value+"&Lang="+Lingua
	UrlPagina = UrlPagina + "&id_categoria="+document.getElementById("id_categoria").value
	UrlPagina = UrlPagina + "&id_categoria_2="+document.getElementById("id_categoria_2").value
	UrlPagina = UrlPagina + "&id_categoria_3="+document.getElementById("id_categoria_3").value
	UrlPagina = UrlPagina + "&id_categoria_4="+document.getElementById("id_categoria_4").value
	UrlPagina = UrlPagina + "&id_prodotto="+document.getElementById("id_prodotto").value

	TitoloPaginaNew = document.title;

	document.title = TitoloPaginaNew;
	document.getElementById("id_pagina_controllo").value = Id_Pagina;
	document.getElementById("Lingua").value = Lingua;

	CaricaMenu(
	Id_Pagina,
	Lingua,
	UrlPagina,
	document.getElementById("id_categoria").value,
	document.getElementById("id_categoria_2").value,
	document.getElementById("id_categoria_3").value,
	document.getElementById("id_categoria_4").value,
	document.getElementById("id_prodotto").value,
	TitoloPaginaNew
	);

} 

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/










/*-----------------------------------------------*/
/*------------ ISCRIZIONE NEWSLETTER ------------*/
/*-----------------------------------------------*/

function Check_Iscrivi_Newsletter(UrlPagina){

f = document.forms.form4;
b = document.form4;

if (f.email.value == ''   ){
	alert("Inserire indirizzo email !");
	f.email.focus();
	return false;
}

		if (f.email.value != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(f.email.value)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   f.email.focus();
			   return false;
			}
		}

	if (document.getElementById("radiobutton_iscriviti").checked == true){
		radiobutton = 'iscriviti';
	}else{
		radiobutton = 'cancellati';
	}

	var postData = "nome="+document.getElementById("nome").value+"&cognome="+document.getElementById("cognome").value+"&email="+document.getElementById("email").value+"&radiobutton="+radiobutton;

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "content.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChange;
	xmlHttp.send(postData);

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/








/*-----------------------------------------------*/
/*------------ ISCRIZIONE UTENTE ----------------*/
/*-----------------------------------------------*/

function Conferma_Iscrizione_Area_Riservata(UrlPagina){

azione = document.getElementById("azione").value;
punteggio = document.getElementById("punteggio").value;

if (document.getElementById("id_utente_accesso")!=null){
	id_utente = document.getElementById("id_utente_accesso").value;
}else{
	id_utente = document.getElementById("id_utente_modifica").value;
}

abilita = document.getElementById("abilita").value;

ragionesociale = document.getElementById("ragionesociale").value;
piva = document.getElementById("piva").value;

cod_fisc = document.getElementById("cod_fisc").value;
nome = document.getElementById("nome").value;
cognome = document.getElementById("cognome").value;

indirizzo = document.getElementById("indirizzo").value;
cap = document.getElementById("cap").value;
citta = document.getElementById("citta").value;
id_provincia = document.getElementById("id_provincia").value;

/*
indirizzo_spedizione = document.getElementById("indirizzo_spedizione").value;
cap_spedizione = document.getElementById("cap_spedizione").value;
citta_spedizione = document.getElementById("citta_spedizione").value;
id_provincia_spedizione = document.getElementById("id_provincia_spedizione").value;
*/

indirizzo_spedizione = "";
cap_spedizione =  "";
citta_spedizione =  "";
id_provincia_spedizione =  "";

cellulare = document.getElementById("cellulare").value;
telefono = document.getElementById("telefono").value;
fax = document.getElementById("fax").value;

username_form = document.getElementById("username_form").value;
password_form = document.getElementById("password_form").value;
password_2_form = document.getElementById("password_2_form").value;



if (nome == ''   ){
	alert("Inserire il cognome!");
	document.getElementById("nome").focus();
	return false;
}

if (cognome == ''   ){
	alert("Inserire il cognome!");
	document.getElementById("cognome").focus();
	return false;
}


if (cod_fisc != '' ){

		var k2=cod_fisc;
		k2=k2+"y";
		var n2=k2.indexOf("y");
		if ( n2!=16 ){
			alert("Il codice fiscale non e' corretto, controllarne la lunghezza!");
			document.getElementById("cod_fisc").focus();		
			return false;
		}				

}

/*
if ((cod_fisc == '' )&&(piva == '' )){
	alert("Inserire il codice fiscale o la partita iva!");
	document.getElementById("cod_fisc").focus();
	return false;
}

if ((cod_fisc != '' )&&(piva != '' )){
	alert("Inserire il codice fiscale o la partita iva!");
	document.getElementById("cod_fisc").focus();
	return false;
}

if ((piva != '' )||(cod_fisc != '' )){

		if (piva != '' ){
		
			if (!IsNumber(piva)){
				alert("La partita iva non e' corretta!");
				document.getElementById("piva").focus();
				return false;
			}

				var k=piva;
				k=k+"x";
				var n=k.indexOf("x");
				if ( n!=11 ){
					alert("La partita iva non e' corretta, controllarne la lunghezza!");
					document.getElementById("piva").focus();		
					return false;
				}				
		
		}


		if (cod_fisc != '' ){
		
				var k2=cod_fisc;
				k2=k2+"y";
				var n2=k2.indexOf("y");
				if ( n2!=16 ){
					alert("Il codice fiscale non e' corretto, controllarne la lunghezza!");
					document.getElementById("cod_fisc").focus();		
					return false;
				}				

		}

}
*/

if (cellulare == ''   ){
	alert("Inserire il numero di telefono cellulare!");
	document.getElementById("cellulare").focus();
	return false;
}

if (telefono == ''   ){
	alert("Inserire il numero di telefono!");
	document.getElementById("telefono").focus();
	return false;
}


if (ragionesociale == ''   ){
	alert("Inserire la ragione sociale!");
	document.getElementById("ragionesociale").focus();
	return false;
}

if (indirizzo == ''   ){
	alert("Inserire la via!");
	document.getElementById("indirizzo").focus();
	return false;
}

if (cap == ''   ){
	alert("Inserire il cap!");
	document.getElementById("cap").focus();
	return false;
}

if (citta == ''   ){
	alert("Inserire la città!");
	document.getElementById("citta").focus();
	return false;
}

if (id_provincia == ''   ){
	alert("Selezionare la provincia!");
	document.getElementById("id_provincia").focus();
	return false;
}

if (piva == ''   ){
	alert("Inserire la partita iva!");
	document.getElementById("piva").focus();
	return false;
}

		if (piva != '' ){
		
			if (!IsNumber(piva)){
				alert("La partita iva non e' corretta!");
				document.getElementById("piva").focus();
				return false;
			}

				var k=piva;
				k=k+"x";
				var n=k.indexOf("x");
				if ( n!=11 ){
					alert("La partita iva non e' corretta, controllarne la lunghezza!");
					document.getElementById("piva").focus();		
					return false;
				}				
		
		}
		

if (username_form == ''   ){
	alert("Inserire indirizzo email - login!");
	document.getElementById("username_form").focus();
	return false;
}


		if (username_form != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			//   if(!i.test(what)) { alert("L'indirizzo email inserito non e' valido!"); return false}   
			   if(!i.test(username_form)) {
			   alert("L'indirizzo email inserito non e' valido!");
			   document.getElementById("username_form").focus();
			   return false;
			}
		}

if (password_form == ''   ){
	alert("Inserire la password!");
	document.getElementById("password_form").focus();
	return false;
}

if (password_2_form == ''   ){
	alert("Confermare la password!");
	document.getElementById("password_2_form").focus();
	return false;
}

if (password_form == username_form   ){
	alert("Login e Password non possono essere uguali!");
	document.getElementById("password_form").focus();
	return false;
}

		var password_len = password_form;
		var Lunghezza_Password=password_len.length;
			if (Lunghezza_Password < 6   ){
				alert("La password deve contenere almeno 6 caratteri!");
			document.getElementById("password_form").focus();
			return false;
			}


if (password_form != password_2_form   ){
	alert("Password errata !\n'Password' deve essere uguale a 'Conferma password'");
	document.getElementById("password_form").focus();
	return false;
}


//------------------------------------------------
//------------------------------------------------
//------------------------------------------------

if (document.getElementById("lista_username")!=null){
	
	// CONTROLLO SE LA LOGIN SELEZIONATA ESISTE GIA'
	d = document.getElementById("lista_username").value.split(",");

	var agree_username=false;
	var j;
	for(j=0;j<d.length-1;j++){

		var_sx = d[j] ;
		var_dx = document.getElementById("username_form").value
		
		var_sx = var_sx.toLowerCase();
		var_dx = var_dx.toLowerCase();
		
		if ( var_sx == var_dx ){
			agree_username=true;
		}
		
	}

		if (agree_username==true) {
			alert("La login inserita è gia' utilizzata, selezionarne un'altra!");
			document.getElementById("username_form").value="";
			document.getElementById("username_form").focus();
		}	

}

if (document.getElementById("lista_password")!=null){
	
	// CONTROLLO SE LA LOGIN SELEZIONATA ESISTE GIA'
	d = document.getElementById("lista_password").value.split(",");

	var agree_password=false;
	var j;
	for(j=0;j<d.length-1;j++){
					
		var_sx = d[j] ;
		var_dx = document.getElementById("password_form").value
		
		var_sx = var_sx.toLowerCase();
		var_dx = var_dx.toLowerCase();
		
		if ( var_sx == var_dx ){
			agree_password=true;
		}
	}

		if (agree_password==true) {
			alert("La password inserita è gia' utilizzata, selezionarne un'altra!");
			document.getElementById("password_form").value="";
			document.getElementById("password_2_form").value="";
			document.getElementById("password_form").focus();
		}	

}

if (cod_fisc != '' ){
	
		if (document.getElementById("lista_cod_fisc")!=null){
			
			// CONTROLLO SE COD FISC SELEZIONATE ESISTE GIA'
			d = document.getElementById("lista_cod_fisc").value.split(",");
		
			var agree_cod_fisc=false;
			var j;
			for(j=0;j<d.length-1;j++){

				var_sx = d[j] ;
				var_dx = document.getElementById("cod_fisc").value
				
				var_sx = var_sx.toLowerCase();
				var_dx = var_dx.toLowerCase();
				
				if ( var_sx == var_dx ){
					agree_cod_fisc=true;
				}
				
			}
		
				if (agree_cod_fisc==true) {
					alert("Il codice fiscale inserito è gia' utilizzato!");
					document.getElementById("cod_fisc").value="";
					document.getElementById("cod_fisc").value="";
					document.getElementById("cod_fisc").focus();
				}
		
		}
	
}else{
	agree_cod_fisc = false
}

/*
if (document.getElementById("lista_piva")!=null){
	
	d = document.getElementById("lista_piva").value.split(",");

	var agree_piva=false;
	var j;
	for(j=0;j<d.length-1;j++){
		if (d[j]==document.getElementById("piva").value){
			agree_piva=true;
		}
	}

		if (agree_piva==true) {
			alert("La Partita Iva inserita è gia' utilizzata!");
			document.getElementById("piva").value="";
			document.getElementById("piva").value="";
			document.getElementById("piva").focus();
		}	

}
*/

//------------------------------------------------
//------------------------------------------------
//------------------------------------------------






/*





if (document.getElementById("n_serie")!=null){
	n_serie = document.getElementById("n_serie").value;
	materiale = document.getElementById("materiale").value;
}





*/















/*





if (indirizzo_spedizione == ''   ){
	alert("Inserire la via del punto vendita!");
	document.getElementById("indirizzo_spedizione").focus();
	return false;
}

if (cap_spedizione == ''   ){
	alert("Inserire il cap del punto vendita!");
	document.getElementById("cap_spedizione").focus();
	return false;
}

if (citta_spedizione == ''   ){
	alert("Inserire la città del punto vendita!");
	document.getElementById("citta_spedizione").focus();
	return false;
}

if (id_provincia_spedizione == ''   ){
	alert("Selezionare la provincia del punto vendita!");
	document.getElementById("id_provincia_spedizione").focus();
	return false;
}




*/






//------------------------------------------------
//------------------------------------------------
//------------------------------------------------

/*

if (document.getElementById("n_serie")!=null){
	
	if ((n_serie == '' ) && (materiale == '' )) {
		alert("Inserisci il codice prodotto e seleziona il prodotto!");
		document.getElementById("n_serie").focus();
		return false;

	}else{
		
		// CONTROLLO SE LA LOGIN SELEZIONATA ESISTE GIA'
		d = document.getElementById("lista_num_serie").value.split(",");
	
		var agree_num_serie=false;
		var j;
		for(j=0;j<d.length-1;j++){
			if (d[j]==(document.getElementById("materiale").value+"-"+document.getElementById("n_serie").value)){
				agree_num_serie=true;
			}
		}
	
			if (agree_num_serie==false) {
				alert("I dati inseriti sono inesistenti o non corretti !");
				document.getElementById("n_serie").value="";
				document.getElementById("n_serie").focus();
			}
			
	}
		
}

*/

/*
if (document.getElementById("lista_num_serie")!=null){

	// CONTROLLO SE LA LOGIN SELEZIONATA ESISTE GIA'
	d = document.getElementById("lista_num_serie").value.split(",");

	var agree_num_serie=false;
	var j;
	for(j=0;j<d.length-1;j++){
		if (d[j]==document.getElementById("n_serie").value){
			agree_num_serie=true;
		}
	}

		if (agree_num_serie==false) {
			alert("Il numero di serie inserito è inesistente o non è corretto !");
			document.getElementById("n_serie").value="";
			document.getElementById("n_serie").focus();
		}	

}
*/

//------------------------------------------------
//------------------------------------------------
//------------------------------------------------


//	if ((agree_username == false)&&(agree_password == false)&&(agree_num_serie != false)) {
	if ( (agree_username == false)&&(agree_password == false)&&(agree_cod_fisc == false) ) {

		if (document.getElementById("consenso").checked != true   ) {
			alert("Per poter continuare e' neccessario acconsentire il trattamento dei dati personali!");
			document.getElementById("consenso").focus();
			return false;
		}
		
			UrlPagina = "?id_pagina=901&Lang="+document.getElementById("Lingua").value
		
			var	postData = "ragionesociale="+ragionesociale
			postData = postData + "&piva="+piva
			postData = postData + "&cod_fisc="+cod_fisc
			postData = postData + "&nome="+nome
			postData = postData + "&cognome="+cognome
			postData = postData + "&indirizzo="+indirizzo
			postData = postData + "&cap="+cap
			postData = postData + "&citta="+citta
			
			postData = postData + "&id_provincia="+id_provincia
			postData = postData + "&indirizzo_spedizione="+indirizzo_spedizione
			postData = postData + "&cap_spedizione="+cap_spedizione
			postData = postData + "&citta_spedizione="+citta_spedizione
			postData = postData + "&id_provincia_spedizione="+id_provincia_spedizione
			
			postData = postData + "&cellulare="+cellulare
			postData = postData + "&telefono="+telefono
			postData = postData + "&fax="+fax
			postData = postData + "&email="+username_form
			postData = postData + "&username="+username_form
			postData = postData + "&password="+password_form
		
			postData = postData + "&azione="+azione
			postData = postData + "&punteggio="+punteggio
			postData = postData + "&id="+id_utente
			postData = postData + "&abilita="+abilita
			postData = postData + "&provenienza=no-outlook"
			
			/*
			if (document.getElementById("n_serie")!=null){
				postData = postData + "&n_serie="+n_serie
				postData = postData + "&materiale="+materiale
			}
			*/
			
			postData = postData.replace(/ /g,"%20");

			var agree=confirm("Confermare i dati inseriti e procedere con l'invio della richiesta ?");
			
			if (agree == true){
				
				xmlHttp.open("POST", "iscrizione.asp"+UrlPagina, true);
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", postData.length);
				xmlHttp.setRequestHeader("Connection", "close");
				xmlHttp.onreadystatechange = handleStateChange;
				xmlHttp.send(postData);
		
			}
			
	}
	
	
}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/




/*-----------------------------------------------*/
/*----------- ACCESSO AREA RISERVATA ------------*/
/*----------- DOPO INSERIMENTO CODICE -----------*/
/*-----------------------------------------------*/

function Check_Accedi_Area_Inserimento_Codice(){

	UrlPagina = "?id_pagina=100"
	UrlPagina = UrlPagina + "&SessionContr="+document.getElementById("id_session_accesso").value
	UrlPagina = UrlPagina + "&Lang="+document.getElementById("Lingua").value

	postData = "username="+document.getElementById("username").value
	postData = postData + "&password="+document.getElementById("password").value

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "login.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChangeAccesso;
	xmlHttp.send(postData);

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/






/*-----------------------------------------------*/
/*----------- ACCESSO AREA RISERVATA ------------*/
/*-----------------------------------------------*/

function Check_Accedi_Area(){

username = document.getElementById("username").value;
password = document.getElementById("password").value;

if (username == ''   ){
	alert("Inserire indirizzo email !");
	document.getElementById("username").focus();
	return false;
}

		if (username != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(username)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   document.getElementById("username").focus();
			   return false;
			}
		}


if (password == ''   ){
	alert("Inserire password !");
	document.getElementById("password").focus();
	return false;
}

	UrlPagina = "?id_pagina=100"
	UrlPagina = UrlPagina + "&SessionContr="+document.getElementById("id_session_accesso").value
	UrlPagina = UrlPagina + "&Lang="+document.getElementById("Lingua").value

	postData = "username="+document.getElementById("username").value
	postData = postData + "&password="+document.getElementById("password").value

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "login.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChangeAccesso;
	xmlHttp.send(postData);

}

function Check_Accedi_Area_Pop_Up(){

username = document.getElementById("username_pop").value;
password = document.getElementById("password_pop").value;

if (username == ''   ){
	alert("Inserire indirizzo email !");
	document.getElementById("username_pop").focus();
	return false;
}

		if (username != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(username)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   document.getElementById("username_pop").focus();
			   return false;
			}
		}


if (password == ''   ){
	alert("Inserire password !");
	document.getElementById("password_pop").focus();
	return false;
}

	UrlPagina = "?id_pagina=100"
	UrlPagina = UrlPagina + "&SessionContr="+document.getElementById("id_session_accesso").value
	UrlPagina = UrlPagina + "&Lang="+document.getElementById("Lingua").value

	postData = "username="+document.getElementById("username_pop").value
	postData = postData + "&password="+document.getElementById("password_pop").value

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "login.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChangeAccesso;
	xmlHttp.send(postData);

}

function handleStateChangeAccesso(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='margin-top:8px; width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				

				document.getElementById("TabellaLogin").innerHTML = xmlHttp.responseText;
				
				// ACCESSO EFFETTUATO DA POP UP
				if (document.getElementById("controllo_pop_up")!=null){
					var ElementoNascosto = document.getElementById("Effettuare_Login_0");
					ElementoNascosto.style.display = "none"; 

					var ElementoNascosto = document.getElementById("Effettuare_Login");
					ElementoNascosto.style.display = "none"; 
				}
				
			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("TabellaLogin").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("TabellaLogin").innerHTML = Caricamento
		}

}
/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/






/*-----------------------------------------------*/
/*- ACCESSO DA INDEX.ASP ------------------------*/
/*- utente registrato con login e password ------*/
/*-----------------------------------------------*/

function Check_Accedi_Area_Registrato(){

f = document.forms.Form88;
b = document.Form88;

if (f.username.value == ''   ){
	alert("Inserire indirizzo email !");
	f.username.focus();
	return false;
}

		if (f.username.value != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(f.username.value)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   f.username.focus();
			   return false;
			}
		}

if (f.password.value == ''   ){
	alert("Inserire password !");
	f.password.focus();
	return false;
}





//------------------------------------------------
//------------------------------------------------
//------------------------------------------------

if (FrameControlloPassword.document.FormControlloPassword.campo_tot != null){
	
	d = FrameControlloPassword.document.FormControlloPassword.campo_tot.value.split(",");

	var agree_accesso=false;
	var j;
	for(j=0;j<d.length-1;j++){
		if ( d[j] == (  document.getElementById("username").value + "|" + document.getElementById("password").value  )){
			agree_accesso=true;
		}
	}

			if (agree_accesso==false) {
				document.getElementById("username").value = "" ;
				document.getElementById("password").value = "" ;
				
				var ElementoNascosto = document.getElementById("Accesso_Negato_0_Registrato");
				ElementoNascosto.style.display = "block";

				var ElementoNascosto = document.getElementById("Accesso_Negato_Registrato");
				ElementoNascosto.style.display = "block";
				
			}

}

//------------------------------------------------
//------------------------------------------------
//------------------------------------------------

	if (agree_accesso == true){
		
		f.submit();
		
	}
	
}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


function Chiudi_Pop_Up_Login(){
	
	var ElementoNascosto = document.getElementById("Accesso_Negato_0_Registrato");
	ElementoNascosto.style.display = "none";
	
	var ElementoNascosto = document.getElementById("Accesso_Negato_Registrato");
	ElementoNascosto.style.display = "none";
	
}


function Chiudi_Pop_Up_Accesso(){
	
	var ElementoNascosto = document.getElementById("AccessoNegato_0");
	ElementoNascosto.style.display = "none";
	
	var ElementoNascosto = document.getElementById("AccessoNegato");
	ElementoNascosto.style.display = "none";
	
}

/*-----------------------------------------------*/
/*----------- LOGOUT ----------------------------*/
/*-----------------------------------------------*/

function Check_Logout(){

createXMLHttpRequest();

		UrlPagina = "?id_pagina=102"
		UrlPagina = UrlPagina + "&Lang="+document.getElementById("Lingua").value
		UrlPagina = UrlPagina + "&id_utente="
		
		location.href = UrlPagina
		
/*		xmlHttp.onreadystatechange = handleStateChangeLogout;
		xmlHttp.open("GET", "login.asp"+UrlPagina, true);
		xmlHttp.send(null);
*/

}

function handleStateChangeLogout(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='margin-top:8px; width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				

				document.getElementById("TabellaLogin").innerHTML = xmlHttp.responseText;
				
				//---------------------------------------------------------------
				// --- QUANDO FINISCO DI CARICARE IL MENU ALLORA CARICO LA PAGINA
				//---------------------------------------------------------------
				Id_Pagina = document.getElementById("id_pagina_logout").value;
				TitoloPaginaNew = document.title;
				Lang = document.getElementById("Lingua").value;
				
				if (document.getElementById("Messaggio_Iscrizione") !=null) {
					var Messaggio_Iscrizione = "";			
					Messaggio_Iscrizione =  document.getElementById("Messaggio_Iscrizione").value;
				}
				
				var Id_Categoria = "";
				var Id_Categoria_2 = "";
				var Id_Categoria_3 = "";
				var Id_Categoria_4 = "";
				var Id_Prodotto = "";

				if (document.getElementById("id_categoria") !=null) {
					Id_Categoria = document.getElementById("id_categoria").value;
					Id_Categoria_2 = document.getElementById("id_categoria_2").value;
					Id_Categoria_3 = document.getElementById("id_categoria_3").value;
					Id_Categoria_4 = document.getElementById("id_categoria_4").value;
					Id_Prodotto = document.getElementById("id_prodotto").value;
				}

				UrlPagina = "?id_pagina="+document.getElementById("id_pagina_logout").value+"&Lang="+Lang+"&id_email="+document.getElementById("id_email").value
				UrlPagina = UrlPagina + "&Messaggio="+Messaggio_Iscrizione
				UrlPagina = UrlPagina + "&id_categoria="+Id_Categoria
				UrlPagina = UrlPagina + "&id_categoria_2="+Id_Categoria_2
				UrlPagina = UrlPagina + "&id_categoria_3="+Id_Categoria_3
				UrlPagina = UrlPagina + "&id_categoria_4="+Id_Categoria_4
				UrlPagina = UrlPagina + "&id_prodotto="+Id_Prodotto

				if (document.getElementById("tabella_origine") !=null) {
					UrlPagina = UrlPagina + "&tabella_origine="+document.getElementById("tabella_origine").value
				}

				CaricaPagina(
					Id_Pagina,
					Lang,
					UrlPagina,
					Id_Categoria,
					Id_Categoria_2,
					Id_Categoria_3,
					Id_Categoria_4,
					Id_Prodotto,
					TitoloPaginaNew
				);
				
				//---------------------------------------------------------------
				//---------------------------------------------------------------
				//---------------------------------------------------------------

				// ACCESSO EFFETTUATO DA POP UP
				if (document.getElementById("controllo_pop_up")!=null){
					var ElementoNascosto = document.getElementById("Effettuare_Login_0");
					ElementoNascosto.style.display = "none";
					
					var ElementoNascosto = document.getElementById("Effettuare_Login");
					ElementoNascosto.style.display = "none"; 
				}

			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("TabellaLogin").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("TabellaLogin").innerHTML = Caricamento
		}

}
/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/















/*-----------------------------------------------*/
/*------------ INVIO CODICE ARTICOLO ------------*/
/*-----------------------------------------------*/

function Check_Invia_Codice(UrlPagina){

document.getElementById("bottone_invia_codici").style.display = "none";

codice_articolo = document.getElementById("codice_articolo").value;
materiale_no = document.getElementById("materiale_no").value;

if ( document.getElementById("materiale_1") != null ) {
	materiale_1 = document.getElementById("materiale_1").value;
}

if ( document.getElementById("materiale_2") != null ) {
	materiale_1 = document.getElementById("materiale_2").value;
}

if ( document.getElementById("materiale_3") != null ) {
	materiale_1 = document.getElementById("materiale_3").value;
}

if ( document.getElementById("materiale_4") != null ) {
	materiale_1 = document.getElementById("materiale_4").value;
}

if ( document.getElementById("materiale_5") != null ) {
	materiale_1 = document.getElementById("materiale_5").value;
}

if ( document.getElementById("materiale_6") != null ) {
	materiale_1 = document.getElementById("materiale_6").value;
}

if ( document.getElementById("materiale_7") != null ) {
	materiale_1 = document.getElementById("materiale_7").value;
}

if ( document.getElementById("materiale_8") != null ) {
	materiale_1 = document.getElementById("materiale_8").value;
}

if ( document.getElementById("materiale_9") != null ) {
	materiale_1 = document.getElementById("materiale_9").value;
}

if ( document.getElementById("materiale_10") != null ) {
	materiale_1 = document.getElementById("materiale_10").value;
}

if (materiale_no == ''   ){
	alert("Selezionare il prodotto !");
	document.getElementById("bottone_invia_codici").style.display = "block";
	document.getElementById("materiale_no").focus();
	return false;
}

if (codice_articolo == ''   ){
	alert("Inserire il codice articolo !");
	document.getElementById("bottone_invia_codici").style.display = "block";
	document.getElementById("codice_articolo").focus();
	return false;
}

numero_codice_inseriti = 0;

for (i=1; i<11; i++) {
	
	if ( document.getElementById("materiale_"+i) != null ) {
		if ( document.getElementById("materiale_"+i).value != "" ) {
			numero_codice_inseriti = 1;
		}
	}
	
}	

if ( numero_codice_inseriti == 0 ) {
	alert("Inserire almeno un numero di serie !");
	document.getElementById("bottone_invia_codici").style.display = "block";
	document.getElementById("materiale_1").focus();
	return false;
}


ultimo_campo_da_controllare = 1

for (i=1; i<11; i++) {
 	if ( document.getElementById("materiale_"+i) != null ) {
 		if ( document.getElementById("materiale_"+i).value != "" ) {
			
			ultimo_campo_da_controllare = i
			
 		}
 	}
	
}

		VerificaCodiceInserito(i,"materiale_"+ultimo_campo_da_controllare,document.getElementById("materiale_"+ultimo_campo_da_controllare).value,document.getElementById('codice_articolo').value);

		setTimeout("InviaCodiciDef('"+UrlPagina+"');",1000);

}

function InviaCodiciDef(UrlPagina){

//document.getElementById("bottone_invia_codici").style.display = "none";

flag_procedi = true ;

if ( document.getElementById("codice_trovato") == null ) {
	flag_procedi = false ;
}else{
	if ( document.getElementById("codice_trovato").value == "0" ) {
		flag_procedi = false ;	
	}
}
			if ( flag_procedi == true ) {
				
				document.getElementById("bottone_invia_codici").style.display = "none";
				
				var postData = "codice_articolo="+document.getElementById("codice_articolo").value
				
				if ( document.getElementById("materiale_1") != null ) {
					postData = postData + "&materiale_1="+document.getElementById("materiale_1").value
				}
				if ( document.getElementById("materiale_2") != null ) {
					postData = postData + "&materiale_2="+document.getElementById("materiale_2").value
				}
				if ( document.getElementById("materiale_3") != null ) {
					postData = postData + "&materiale_3="+document.getElementById("materiale_3").value
				}
				if ( document.getElementById("materiale_4") != null ) {
					postData = postData + "&materiale_4="+document.getElementById("materiale_4").value
				}
				if ( document.getElementById("materiale_5") != null ) {
					postData = postData + "&materiale_5="+document.getElementById("materiale_5").value
				}
				if ( document.getElementById("materiale_6") != null ) {
					postData = postData + "&materiale_6="+document.getElementById("materiale_6").value
				}
				if ( document.getElementById("materiale_7") != null ) {
					postData = postData + "&materiale_7="+document.getElementById("materiale_7").value
				}
				if ( document.getElementById("materiale_8") != null ) {
					postData = postData + "&materiale_8="+document.getElementById("materiale_8").value
				}
				if ( document.getElementById("materiale_9") != null ) {
					postData = postData + "&materiale_9="+document.getElementById("materiale_9").value
				}
				if ( document.getElementById("materiale_10") != null ) {
					postData = postData + "&materiale_10="+document.getElementById("materiale_10").value
				}
				
				postData = postData.replace(/ /g,"%20");

				xmlHttp.open("POST", "content.asp"+UrlPagina, true);
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", postData.length);
				xmlHttp.setRequestHeader("Connection", "close");
				xmlHttp.onreadystatechange = handleStateChangeInserisciCodice;
				xmlHttp.send(postData);
				
			}else{
				
				document.getElementById("bottone_invia_codici").style.display = "block";
				
				alert("Si è verificato un errore !")
				return false;
				
			}
			
			/*
			if ( document.getElementById("codice_trovato").value != "0" ) {
				
				var postData = "codice_articolo="+document.getElementById("codice_articolo").value
				
				if ( document.getElementById("materiale_1") != null ) {
					postData = postData + "&materiale_1="+document.getElementById("materiale_1").value
				}
				if ( document.getElementById("materiale_2") != null ) {
					postData = postData + "&materiale_2="+document.getElementById("materiale_2").value
				}
				if ( document.getElementById("materiale_3") != null ) {
					postData = postData + "&materiale_3="+document.getElementById("materiale_3").value
				}
				if ( document.getElementById("materiale_4") != null ) {
					postData = postData + "&materiale_4="+document.getElementById("materiale_4").value
				}
				if ( document.getElementById("materiale_5") != null ) {
					postData = postData + "&materiale_5="+document.getElementById("materiale_5").value
				}
				if ( document.getElementById("materiale_6") != null ) {
					postData = postData + "&materiale_6="+document.getElementById("materiale_6").value
				}
				if ( document.getElementById("materiale_7") != null ) {
					postData = postData + "&materiale_7="+document.getElementById("materiale_7").value
				}
				if ( document.getElementById("materiale_8") != null ) {
					postData = postData + "&materiale_8="+document.getElementById("materiale_8").value
				}
				if ( document.getElementById("materiale_9") != null ) {
					postData = postData + "&materiale_9="+document.getElementById("materiale_9").value
				}
				if ( document.getElementById("materiale_10") != null ) {
					postData = postData + "&materiale_10="+document.getElementById("materiale_10").value
				}
				
				postData = postData.replace(/ /g,"%20");

				xmlHttp.open("POST", "content.asp"+UrlPagina, true);
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", postData.length);
				xmlHttp.setRequestHeader("Connection", "close");
				xmlHttp.onreadystatechange = handleStateChangeInserisciCodice;
				xmlHttp.send(postData);
				
			}else{
				
				document.getElementById("bottone_invia_codici").style.display = "block";
				
				alert("Si è verificato un errore !")
				return false;
			}
			*/
			
}

function handleStateChangeInserisciCodice(){

Messaggio = "";
Messaggio = Messaggio + "<table border='0' cellpadding='0' cellspacing='0' style='width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Messaggio = Messaggio + "  <tr><td>"
Messaggio = Messaggio + "<center>Impossibile caricare la pagina richiesta ....</center>"
Messaggio = Messaggio + "  </td></tr>"
Messaggio = Messaggio + "</table>"

Caricamento = "";
Caricamento = Caricamento + "<table border='0' cellpadding='0' cellspacing='0' style='margin-top:8px; width:100%; FONT-SIZE: 11px;COLOR: #000000; FONT-FAMILY: Trebuchet MS, Verdana;'>"
Caricamento = Caricamento + "  <tr><td>"
Caricamento = Caricamento + "<center>loading ...</center>"
Caricamento = Caricamento + "  </td></tr>"
Caricamento = Caricamento + "</table>"


		// if xmlHttp shows "loaded"
		if (xmlHttp.readyState == 4){

			if (xmlHttp.status == 200){				

				document.getElementById("Contenuto_Pagina").innerHTML = xmlHttp.responseText;

				Check_Accedi_Area_Inserimento_Codice();

			}else{	

				// INTERCETTO ERRORE E VISUALIZZO
				handleErrFullPage(xmlHttp.responseText);
				//-------------------------------
				
				document.getElementById("Contenuto_Pagina").innerHTML = Messaggio;
			}
		
		}else{
				document.getElementById("Contenuto_Pagina").innerHTML = Caricamento
		}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/














/*-----------------------------------------------*/
/*---- CONTROLLO MODULO SEMPLIFICATO ------------*/
/*-----------------------------------------------*/

function Check_Send_Modulo_1(UrlPagina){

f = document.forms.form4;
b = document.form4;

if (f.nome.value == ''   ){
	alert("Inserire il nome !");
	f.nome.focus();
	return false;
}

if (f.cognome.value == ''   ){
	alert("Inserire il cognome !");
	f.cognome.focus();
	return false;
}

if (f.email.value == ''   ){
	alert("Inserire indirizzo email !");
	f.email.focus();
	return false;
}

		if (f.email.value != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(f.email.value)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   f.email.focus();
			   return false;
			}
		}


	postData = "data="+document.getElementById("data").value
	postData = postData + "&nome="+document.getElementById("nome").value
	postData = postData + "&cognome="+document.getElementById("cognome").value
	postData = postData + "&societa="+document.getElementById("societa").value
	postData = postData + "&ruolo="+document.getElementById("ruolo").value
	postData = postData + "&telefono="+document.getElementById("telefono").value
	postData = postData + "&fax="+document.getElementById("fax").value
	postData = postData + "&email="+document.getElementById("email").value
	postData = postData + "&richiesta="+document.getElementById("richiesta").value

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "content.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChange;
	xmlHttp.send(postData);

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/







/*-----------------------------------------------*/
/*- CONTROLLO MODULO SEMPLIFICATO COMPLESSO -----*/
/*-----------------------------------------------*/

function Check_Send_Modulo_2(UrlPagina){

f = document.forms.form4;
b = document.form4;

if (f.nome.value == ''   ){
	alert("Inserire il nome !");
	f.nome.focus();
	return false;
}

if (f.cognome.value == ''   ){
	alert("Inserire il cognome !");
	f.cognome.focus();
	return false;
}

if (f.email.value == ''   ){
	alert("Inserire indirizzo email !");
	f.email.focus();
	return false;
}

		if (f.email.value != ''   ){		   
			   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			   if(!i.test(f.email.value)) {
			   alert("L'indirizzo email inserito non e' valido !");
			   f.email.focus();
			   return false;
			}
		}

	postData = "data="+document.getElementById("data").value
	postData = postData + "&nome="+document.getElementById("nome").value
	postData = postData + "&cognome="+document.getElementById("cognome").value
	postData = postData + "&societa="+document.getElementById("societa").value
	postData = postData + "&indirizzo="+document.getElementById("indirizzo").value
	postData = postData + "&citta="+document.getElementById("citta").value
	postData = postData + "&cap="+document.getElementById("cap").value
	postData = postData + "&provincia="+document.getElementById("provincia").value
	postData = postData + "&nazione="+document.getElementById("nazione").value
	postData = postData + "&telefono="+document.getElementById("telefono").value
	postData = postData + "&fax="+document.getElementById("fax").value
	postData = postData + "&email="+document.getElementById("email").value
	postData = postData + "&richiesta="+document.getElementById("richiesta").value

	postData = postData.replace(" ","%20");

	xmlHttp.open("POST", "content.asp"+UrlPagina, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postData.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = handleStateChange;
	xmlHttp.send(postData);

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------*/
/*--- RICHIEDI ORDINE ---------------------------*/
/*-----------------------------------------------*/

function RichiediOrdine(UrlPagina,Numero_Ordine,Data_Ordine){

	postData = ""
	postData = postData.replace(" ","%20");

var agree=confirm("Inviare ordine n° "+Numero_Ordine+" del "+Data_Ordine+" ?");

	if (agree == true){

		xmlHttp.open("POST", "richiedi_ordine.asp"+UrlPagina, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", postData.length);
		xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.send(postData);
		
	}
}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

function Visualizza_Acc_Negato(){

//alert("prova");

	var ElementoNascosto = document.getElementById("AccessoNegato_0");
	ElementoNascosto.style.display = "none";
	ElementoNascosto.style.display = "block";
	
	var ElementoNascosto = document.getElementById("AccessoNegato");
	ElementoNascosto.style.display = "none";
	ElementoNascosto.style.display = "block";
	
}

/*-----------------------------------------------*/
/*--- RICERCA SEMPLICE --------------------------*/
/*-----------------------------------------------*/

function Cerca_Libera(UrlPagina,TitoloPagina){
	
	if ((document.getElementById("id_utente_accesso") !=null)&&(document.getElementById("id_utente_accesso") !='')) {

			if (document.getElementById("cerca").value == ''){
				alert("Inserire almeno un carattere !");
				document.getElementById("bottone_invia_codici").style.display = "block";
				document.getElementById("cerca").focus();
				return false;
			}
		
			document.title=TitoloPagina;
		
			postData = "cerca="+document.getElementById("cerca").value
			postData = postData.replace(/ /g,"%20");
		
			document.getElementById("cerca").value = "";
			
			xmlHttp.open("POST", "content.asp"+UrlPagina, true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", postData.length);
			xmlHttp.setRequestHeader("Connection", "close");
			xmlHttp.onreadystatechange = handleStateChange;
			xmlHttp.send(postData);
	
	}else{
			Visualizza_Acc_Negato();
	}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*--- RICERCA PER FASCE -------------------------*/
/*-----------------------------------------------*/

function Cerca_Fasce(UrlPagina){
	
	if ((document.getElementById("id_utente_accesso") !=null)&&(document.getElementById("id_utente_accesso") !='')) {
		
			if (document.getElementById("punti_min").value == ''){
				alert("Inserire il punteggio minimo !");
				document.getElementById("punti_min").focus();
				return false;
			}	
		
			if (!IsNumber(document.getElementById("punti_min").value)){
				alert("Il punteggio non e' corretto!");
				document.getElementById("punti_min").focus();
				return false;
			}
		
		
		
			if (document.getElementById("punti_max").value == ''){
				alert("Inserire il punteggio massimo !");
				document.getElementById("punti_max").focus();
				return false;
			}	
		
			if (!IsNumber(document.getElementById("punti_max").value)){
				alert("Il punteggio non e' corretto!");
				document.getElementById("punti_max").focus();
				return false;
			}
		
			var punteggio_minimo = 0 ;
			var punteggio_massimo = 0 ;
		
			punteggio_minimo = parseFloat(document.getElementById("punti_min").value) ;
			punteggio_massimo = parseFloat(document.getElementById("punti_max").value) ;
		
			if (punteggio_minimo > punteggio_massimo) {
				alert("Il punteggio massimo deve essere > del punteggio minimo !");
				document.getElementById("punti_min").focus();
				return false;
			}
		
				postData = "punti_min="+document.getElementById("punti_min").value
				postData = postData + "&punti_max="+document.getElementById("punti_max").value
				
				postData = postData.replace(" ","%20");
			
				document.getElementById("punti_min").value = "";
				document.getElementById("punti_max").value = "";
				
				xmlHttp.open("POST", "content.asp"+UrlPagina, true);
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				xmlHttp.setRequestHeader("Content-length", postData.length);
				xmlHttp.setRequestHeader("Connection", "close");
				xmlHttp.onreadystatechange = handleStateChange;
				xmlHttp.send(postData);
		
	}else{
			Visualizza_Acc_Negato();
	}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------*/
/*--- APERTURA MOTORE DI RICERCA -----------------*/
/*-----------------------------------------------*/

function Visualizza_Ricerca(){

	document.getElementById("visualizza_menu").value="1";

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*--- APERTURA POP-UP 2 -------------------------*/
/*-----------------------------------------------*/

function apriFinestraDim(page,larghezza,altezza)
{
	
	winOpened=window.open(page,"","height="+altezza+",width="+larghezza+",scrollbars=no,toolbar=no");

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/


/*-----------------------------------------------*/
/*--- APERTURA POP-UP ---------------------------*/
/*-----------------------------------------------*/

function apriFinestra(page)
{
	winOpened=window.open(page,"","height=300,width=300,scrollbars=no,toolbar=no");
}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------*/
/*--- GESTIONE E VISUALIZZAZIONE ERRORI ---------*/
/*-----------------------------------------------*/

function handleErrFullPage(strIn) {	

        var errorWin;

        // Create new window and display error
        try {
			errorWin = window.open('', 'errorWin');
			errorWin.document.body.innerHTML = strIn;
        }
        // If pop-up gets blocked, inform user
        catch(e) {
			alert(strIn);
		}

}

/*-----------------------------------------------*/
/*-----------------------------------------------*/
/*-----------------------------------------------*/

/*-----------------------------------------------------*/
/*----- SPLIT -----------------------------------------*/
/*-----------------------------------------------------*/
function Split(StringToSplit, CharToSplit) {
	return StringToSplit.split(CharToSplit); 
}
/*-----------------------------------------------------*/
/*-----------------------------------------------------*/
