	
	//////////////MOSTRA CARRELLO////////////////////////
	function myHandler_mostra_carrello()
	{
			if(myRequest_mostra_carrello.readyState==4&&myRequest_mostra_carrello.status==200)
			{
				document.getElementById("store_carrello").innerHTML=myRequest_mostra_carrello.responseText;
			}
			else
			{
				//document.getElementById("store_carrello").innerHTML="LOADing...";
			}
	}
		
	function mostra_carrello(start)
	{
		myRequest_mostra_carrello = CreateXmlHttpReq2(myHandler_mostra_carrello);
		myRequest_mostra_carrello.open("GET","store/carrello/carrello.php?start="+start+"",true);
		myRequest_mostra_carrello.send(null);
	}
	//////////////////////////////////////////////////////////////////////////////
	
	//////////////////AGGIUNGI DAL CARRELLO/////////////////////////////////
	function myHandler_Store_put()
	{
			if(myRequest_Store_put.readyState==4&&myRequest_Store_put.status==200)
			{
				var arraySplit = myRequest_Store_put.responseText.split("|||");
			
				//IMPOSTO TOTALI carrrello e TOTALE PREZZO E PASSI
				if (document.getElementById("store_carrello_totale_elementi_carrello"))
				{
					document.getElementById("store_carrello_totale_elementi_carrello").innerHTML = arraySplit[1];
				}
				
				if (document.getElementById("store_carrello_totale_prezzo"))
				{
					document.getElementById("store_carrello_totale_prezzo").innerHTML = arraySplit[2];
				}
				
				if (document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita))
				{
					document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita).innerHTML=arraySplit[0];
				}
			}
			else
			{
				//document.getElementById("store_carrello").innerHTML="LOADing...";
			}
	}
		
	function Store_put(id)
	{
		Store_carrello_id_quantita=id;
		myRequest_Store_put = CreateXmlHttpReq2(myHandler_Store_put);
		myRequest_Store_put.open("GET","store/carrello/aggiungi.php?id="+id+"",true);
		myRequest_Store_put.send(null);
	}
	////////////////////////////////////////////////////////////////////////
	
	
	
	
	//////////////////ELIMINA DAL CARRELLO///////////////////////////////
	function myHandler_elimina_dal_carrello()
	{
		if(myRequest_elimina_dal_carrello.readyState==4&&myRequest_elimina_dal_carrello.status==200)
		{
			
			var arraySplit = myRequest_elimina_dal_carrello.responseText.split("|||");
			
				/*if (arraySplit[0]=="null")
				{
				document.getElementById("copertina_mov_aq_"+id_quantita_el_c).style.visibility="hidden";
				document.getElementById("copertina_mov_aq_"+id_quantita_el_c).style.display="none";
				}*/
			
			//IMPOSTO TOTALI carrello TOTALE PREZZO E PASSI
			
				if (document.getElementById("store_carrello_totale_elementi_carrello"))
				{
					document.getElementById("store_carrello_totale_elementi_carrello").innerHTML = arraySplit[1];
				}
				
				
				tot_passi_aq=arraySplit[2];
				if (document.getElementById("store_carrello_tot_passi_aq_ag"))
				{
					document.getElementById("store_carrello_tot_passi_aq_ag").innerHTML = arraySplit[2];
				}
			
				if (document.getElementById("store_carrello_totale_prezzo"))
				{
					document.getElementById("store_carrello_totale_prezzo").innerHTML = arraySplit[4];
				}
			
				if (document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita_x))
				{
					if (arraySplit[0]=="null")
					{
						document.getElementById("riga_carrello_"+Store_carrello_id_quantita_x).style.display="block";
						document.getElementById("riga_carrello_"+Store_carrello_id_quantita_x).style.visibility="hidden";
					}
					else
					{
						document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita_x).innerHTML=arraySplit[0];
					}
				}
			
				
				//VADO INDIETRO SE LO START é ???
				/*if (arraySplit[3]==1)
				{
				sin_aq();
				}*/
				
				
				// SE IL CARRELLO è VUOTO
				/*if (isNaN(arraySplit[1]))
				{
				chiudi('acquista','','closed');
				}*/
			
		}
		else
		{
		//document.getElementById("carrello").innerHTML="<p align=\"center\"><img src=\"immagini/ajax-loader.gif\" /></p>";
		}
	}
	
	function elimina_dal_carrello(id)
	{
	Store_carrello_id_quantita_x=id;
	myRequest_elimina_dal_carrello=CreateXmlHttpReq2(myHandler_elimina_dal_carrello);
	myRequest_elimina_dal_carrello.open("GET","store/carrello/elimina.php?id="+id+"",true);
	myRequest_elimina_dal_carrello.send(null);
	}
	
	////////////////////////////////////////////////////////////////////////
	
	///////////////////SVUOTA CARRELLO//////////////////////////////
	
	function myHandler_svuota_carrello()
	{
		if(myRequest_svuota_carrello.readyState==4&&myRequest_svuota_carrello.status==200)
		{
		mostra_carrello();
		}
	}
	
	function svuota_carrello(end)
	{
	myRequest_svuota_carrello = CreateXmlHttpReq2(myHandler_svuota_carrello);
	myRequest_svuota_carrello.open("POST","store/carrello/svuota_carrello.php?end="+end+"",true);
	myRequest_svuota_carrello.send(null);
	}
	////////////////////////////////////////////////////////////////////////
	
	
	///???///
	//temp_mumble_aq=0;
	//tot_passi_aq_ag = div id da cui prendere numero passi
	function myHandler_aggiungi_al_carrello()
	{
		if(myRequest_aggiungi_al_carrello.readyState==4&&myRequest_aggiungi_al_carrello.status==200)
		{
		document.getElementById("store_carrello").innerHTML=myRequest_aggiungi_al_carrello.responseText;
		//tot_passi_aq=document.getElementById("tot_passi_aq_ag").innerHTML;
		
		//QUI TOCCA METTERE IL NUMERO DI PAGINA.
		mostra_carrello('0');
		}
		else
		{
		//document.getElementById("carrello").innerHTML="<p align=\"center\"><img src=\"immagini/ajax-loader.gif\" /></p>";
		}
	}

	
	function aggiungi_al_carrello(id)
	{
		/*if (document.all)
		{
		var start=0;
		var ie=1;
		}
		else
		{
		var start=null;
		var ie=0;
		}*/
	myRequest_aggiungi_al_carrello = CreateXmlHttpReq2(myHandler_aggiungi_al_carrello);
	myRequest_aggiungi_al_carrello.open("GET","store/carrello/carrello.php?aggiungi&id="+id+"",true);
	myRequest_aggiungi_al_carrello.send(null);
	}
	
	
	
	function myHandler_aggiungi_dal_carrello()
	{
		if(myRequest_aggiungi_dal_carrello.readyState==4&&myRequest_aggiungi_dal_carrello.status==200)
		{
			
			var arraySplit = myRequest_aggiungi_dal_carrello.responseText.split("|||");
			
			//IMPOSTO TOTALI LIBRI TOTALE PREZZO E PASSI
			//document.getElementById("totale_libri_carrello").innerHTML = arraySplit[1];
			//document.getElementById("totale_prezzo").innerHTML = arraySplit[2];
			//document.getElementById("quantita_"+id_quantita_el_c2).innerHTML=arraySplit[0];
			
				if (document.getElementById("store_carrello_totale_elementi_carrello"))
				{
					document.getElementById("store_carrello_totale_elementi_carrello").innerHTML = arraySplit[1];
				}
				
				
				tot_passi_aq=arraySplit[2];
				if (document.getElementById("store_carrello_tot_passi_aq_ag"))
				{
					document.getElementById("store_carrello_tot_passi_aq_ag").innerHTML = arraySplit[2];
				}
			
				if (document.getElementById("store_carrello_totale_prezzo"))
				{
					document.getElementById("store_carrello_totale_prezzo").innerHTML = arraySplit[2];
				}
			
				if (document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita_p))
				{
					document.getElementById("store_carrello_quantita_"+Store_carrello_id_quantita_p).innerHTML=arraySplit[0];
				}
			
			
		}
		else
		{
		//document.getElementById("carrello").innerHTML="<p align=\"center\"><img src=\"immagini/ajax-loader.gif\" /></p>";
		}
	}
	
	function aggiungi_dal_carrello(id)
	{
	Store_carrello_id_quantita_p=id;
	myRequest_aggiungi_dal_carrello= CreateXmlHttpReq2(myHandler_aggiungi_dal_carrello);
	myRequest_aggiungi_dal_carrello.open("GET","store/carrello/aggiungi.php?id="+id+"",true);
	myRequest_aggiungi_dal_carrello.send(null);
	}
	
	
	
	
	
	
	
	///PROCEDURE
	////////////////////////////////PROCEDI////////////////////////////////
		function myHandler_carrello_procedi()
		{
			if(myRequest_carrello_procedi.readyState==4&&myRequest_carrello_procedi.status==200)
			{
			document.getElementById("store_contenitore_col2").innerHTML=myRequest_carrello_procedi.responseText;
			}
			else 
			{
			//document.getElementById("contenuti_acquista").innerHTML=" <img src=\"immagini/ajax-loader_b.gif\" height=\"14\" />";
			}
		}
		
		function carrello_procedi() 
		{
		myRequest_carrello_procedi = CreateXmlHttpReq2(myHandler_carrello_procedi);
		myRequest_carrello_procedi.open("GET","store/carrello/procedi.php");
		myRequest_carrello_procedi.send(null);
		}
	////////////////////////////////////////////////////////////////
	
	
	///////////////////SCELTA PAGAMENTO////////////////////////////////////////////////
	function scelta_pagamento()
		{
					
					if (document.modulo_opz_reg_ord.spese_spedizione[0].checked)
					{
					//corriere
					var s_s=0;
					}
					
					if (document.modulo_opz_reg_ord.spese_spedizione[1].checked)
					{
					//economy
					var s_s=1;
					}
					
					
					if (document.modulo_opz_reg_ord.tipo_pagamento[0].checked)
					{
					//paypal
					acquista_paypal(s_s);
					}
					
					if (document.modulo_opz_reg_ord.tipo_pagamento[1].checked)
					{
					//contrassegno
					acquista_contrassegno(s_s);
					}
					
		}
	////////////////////////////////////////////////////////////////
	
	
	////////////////////////////PAYPAL//////////////////////////
		function myHandler_acquista_paypal()
		{
			if(myRequest_acquista_paypal.readyState==4&&myRequest_acquista_paypal.status==200)
			{
			document.getElementById("store_contenitore_col2").innerHTML=myRequest_acquista_paypal.responseText;
			
			}
			else 
			{
			//document.getElementById("contenuti_acquista").innerHTML=" <img src=\"immagini/ajax-loader_b.gif\" height=\"14\" />";
			}
		}
		
		function acquista_paypal(s_s) 
		{
		myRequest_acquista_paypal = CreateXmlHttpReq2(myHandler_acquista_paypal);
		myRequest_acquista_paypal.open("GET","store/carrello/acquista_paypal.php?spese_spedizione="+s_s+"");
		myRequest_acquista_paypal.send(null);
		}
	//////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////////////////////////////////
	//////////////////////////CONTRASSEGNO////////////////////////////////////////////////////////////////
	////////////////////////////////////////////////////////////////////////////////////////////////////////
		function myHandler_acquista_contrassegno()
		{
			if(myRequest_acquista_contrassegno.readyState==4&&myRequest_acquista_contrassegno.status==200)
			{
			document.getElementById("store_contenitore_col2").innerHTML=myRequest_acquista_contrassegno.responseText;
			}
			else 
			{
			//document.getElementById("contenuti_acquista").innerHTML=" <img src=\"immagini/ajax-loader_b.gif\" height=\"14\" />";
			}
		}
		
		function acquista_contrassegno(s_s) 
		{
		myRequest_acquista_contrassegno = CreateXmlHttpReq2(myHandler_acquista_contrassegno);
		myRequest_acquista_contrassegno.open("GET","store/carrello/acquista_contrassegno.php?spese_spedizione="+s_s+"");
		myRequest_acquista_contrassegno.send(null);
		}
		////////////////////////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////SALVA ORDINE CONTRASSEGNO////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////////////////////////
		function myHandler_salva_contrassegno()
		{
			if(myRequest_salva_contrassegno.readyState==4&&myRequest_salva_contrassegno.status==200)
			{
			document.getElementById("store_contenitore_col2").innerHTML=myRequest_salva_contrassegno.responseText;
			}
			else 
			{
			//document.getElementById("contenuti_acquista").innerHTML=" <img src=\"immagini/ajax-loader_b.gif\" height=\"14\" />";
			}
		}
		
		function salva_contrassegno()
		{
			
		var nome = document.store_modulo_indirizzo.nome.value;
		var cognome = document.store_modulo_indirizzo.cognome.value;
		var indirizzo = document.store_modulo_indirizzo.indirizzo.value;
		var comune = document.store_modulo_indirizzo.comune.value;
		var provincia = document.store_modulo_indirizzo.provincia.value;
		var cap = document.store_modulo_indirizzo.cap.value;
		
		var strChars = /[\|\\\!\"\/\(\)\ç\°\§\<\>]/;
		var strLettere = /[a-zA-Z]|[']/;
		var strEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/;
		
		
		
		if ((nome == "") || (nome == "undefined")) {alert(tag_lingua["campo_nome"]);document.store_modulo_indirizzo.nome.focus();return false;}
		if (nome.match(strChars) != null) {alert(tag_lingua["car_nan_am"]); document.store_modulo_indirizzo.nome.focus(); return false; }
		
		if ((cognome == "") || (cognome == "undefined")) {alert(tag_lingua["campo_cognome"]);document.store_modulo_indirizzo.cognome.focus();return false;}
		if (cognome.match(strChars) != null) {alert(tag_lingua["car_nan_am"]); document.store_modulo_indirizzo.cognome.focus(); return false; }
		
		if ((indirizzo == "") || (indirizzo == "undefined")) {alert(tag_lingua["campo_indirizzo"]);document.store_modulo_indirizzo.indirizzo.focus();return false;}
		if (indirizzo.match(strChars) != null) {alert(tag_lingua["car_nan_am"]); document.store_modulo_indirizzo.indirizzo.focus(); return false; }
		
		if ((cap == "") || (cap == "undefined")) {alert(tag_lingua["campo_cap"]);document.store_modulo_indirizzo.cap.focus();return false;}
		if (cap.match(strChars) != null) {alert(tag_lingua["solo_num"]); document.store_modulo_indirizzo.cap.focus(); return false; }
		if (cap.match(strLettere) != null) {alert(tag_lingua["solo_num"]); document.store_modulo_indirizzo.cap.focus(); return false; }
		
		if ((comune == "") || (comune == "undefined")) {alert(tag_lingua["campo_comune"]);document.modulo.comune.focus();return false;}
		if ((provincia == "") || (provincia == "undefined")) {alert(tag_lingua["campo_provincia"]);document.modulo.provincia.focus();return false;}
		
		
		
		var parametri="nome="+nome+"&cognome="+cognome+"&indirizzo="+indirizzo+"&cap="+cap+"&comune="+comune+"&provincia="+provincia+"";
		myRequest_salva_contrassegno = CreateXmlHttpReq2(myHandler_salva_contrassegno);
		myRequest_salva_contrassegno.open("POST","store/carrello/salva_contrassegno.php",true);
		myRequest_salva_contrassegno.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
		myRequest_salva_contrassegno.setRequestHeader("Content-length", parametri.length);
		myRequest_salva_contrassegno.setRequestHeader("Connection", "close");
		myRequest_salva_contrassegno.send(parametri);
		}
		//////////////////////////////////////////////////////////////////////////////
		/////////////////////////////CONFERMA CONTRASSEGNO//////////////////////////
		//////////////////////////////////////////////////////////////////////////////
		
		function myHandler_conferma_contrassegno()
		{
			if(myRequest_conferma_contrassegno.readyState==4&&myRequest_conferma_contrassegno.status==200)
			{
			document.getElementById("store_contenitore_col2").innerHTML=myRequest_conferma_contrassegno.responseText;
			}
			else 
			{
			//document.getElementById("contenuti_acquista").innerHTML=" <img src=\"immagini/ajax-loader_b.gif\" height=\"14\" />";
			}
		}
		
		function conferma_contrassegno() 
		{
		myRequest_conferma_contrassegno = CreateXmlHttpReq2(myHandler_conferma_contrassegno);
		myRequest_conferma_contrassegno.open("GET","store/carrello/conferma_contrassegno.php",true);
		myRequest_conferma_contrassegno.send(null);
		
		setTimeout("store_aggiorna_page()",2000);
		
		}
		function store_aggiorna_page()
		{
		document.location.href='http://www.bimcineclub.com/index.php?sez=store';	
		}
		//////////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////
	
	
	
	/*///aggiungi_dal_carrello
	function myHandler_aggiungi_dal_carrello()
	{
		if(myRequest_aggiungi_dal_carrello.readyState==4&&myRequest_aggiungi_dal_carrello.status==200)
		{
			
			var arraySplit = myRequest_aggiungi_dal_carrello.responseText.split("|||");
			
			//IMPOSTO TOTALI LIBRI TOTALE PREZZO E PASSI
			document.getElementById("totale_libri_carrello").innerHTML = arraySplit[1];
			document.getElementById("totale_prezzo").innerHTML = arraySplit[2];
			document.getElementById("quantita_"+id_quantita_el_c2).innerHTML=arraySplit[0];
		}
		else
		{
		//document.getElementById("carrello").innerHTML="<p align=\"center\"><img src=\"immagini/ajax-loader.gif\" /></p>";
		}
	}
	
	function aggiungi_dal_carrello(id)
	{
	id_quantita_el_c2=id;
	myRequest_aggiungi_dal_carrello= CreateXmlHttpReq2(myHandler_aggiungi_dal_carrello);
	myRequest_aggiungi_dal_carrello.open("GET","includes/carrello/aggiungi.php?id="+id+"",true);
	myRequest_aggiungi_dal_carrello.send(null);
	}
	
	
	
	///ELIMINA DAL CARRELLO
	function myHandler_elimina_dal_carrello()
	{
		if(myRequest_elimina_dal_carrello.readyState==4&&myRequest_elimina_dal_carrello.status==200)
		{
			
			var arraySplit = myRequest_elimina_dal_carrello.responseText.split("|||");
			
				if (arraySplit[0]=="null")
				{
				document.getElementById("copertina_mov_aq_"+id_quantita_el_c).style.visibility="hidden";
				document.getElementById("copertina_mov_aq_"+id_quantita_el_c).style.display="none";
				}
			
			//IMPOSTO TOTALI LIBRI TOTALE PREZZO E PASSI
			document.getElementById("totale_libri_carrello").innerHTML = arraySplit[1];
			document.getElementById("tot_passi_aq_ag").innerHTML = arraySplit[2];
			document.getElementById("totale_prezzo").innerHTML = arraySplit[4];
			tot_passi_aq=arraySplit[2];
			document.getElementById("quantita_"+id_quantita_el_c).innerHTML=arraySplit[0];
			
				
				//VADO INDIETRO SE MULTIPLO DI SEI
				if (arraySplit[3]==1)
				{
				sin_aq();
				}
				
				
				// SE IL CARRELLO è VUOTO
				if (isNaN(arraySplit[1]))
				{
				chiudi('acquista','','closed');
				}
			
		}
		else
		{
		//document.getElementById("carrello").innerHTML="<p align=\"center\"><img src=\"immagini/ajax-loader.gif\" /></p>";
		}
	}
	
	function elimina_dal_carrello(id)
	{
	id_quantita_el_c=id;
	myRequest_elimina_dal_carrello = CreateXmlHttpReq2(myHandler_elimina_dal_carrello);
	myRequest_elimina_dal_carrello.open("GET","includes/carrello/elimina.php?id="+id+"",true);
	myRequest_elimina_dal_carrello.send(null);
	}
	
	}*/

