	/********************************
	*
	*   CHIAMATE DALAL SEARCH BOX
	*
	*********************************/ 	

	// cambio box IMG | CD | SUBSCRIPTION
	function SB_send( section , view ){
		httpRequest("GET","/ajax/SB_send.php?section=" + section + "&view=" + view ,true,handleSend);
	}
	
	function handleSend(){
		
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("searchBoxBody");
				div.innerHTML = request.responseText;
				
			}else{
				alert("a problem occurred with the server..." + request.status);
			}
		}
	}
	
	
	
	// aggiornamento categorie dei fornitori (RICERCA CD)
	function SB_updateCategory( theSelect ){
		var ids = new Array();
		for(var n = 0 ; n < theSelect.options.length ; n++){
			if (theSelect.options[n].selected)
			ids.push(theSelect.options[n].value);
		}
		httpRequest("GET","/ajax/SB_updateCategory.php?ids=" + ids , true , updateCategory);
	}

	
	function updateCategory(){
		
		document.theCatLoader.src = "/img/loading.gif";
	
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("theCategory");
				div.innerHTML = request.responseText;
				document.theCatLoader.src = "/img/trasp.gif";
			}else{
				alert("a problem occurred with the server..." + request.status);
				document.theCatLoader.src = "/img/trasp.gif";
			}
		}
		
		
	}



	/********************************
	*
	*   CHIAMATE DALLA MEMO BOX
	*
	*********************************/ 	


	// cambio box carrello / lightbox
	function MB_view( view  ){
		httpRequest("GET","/ajax/MB_view.php?view=" + view ,true,handleMB_view);
	}
	
	
	function handleMB_view(){
		
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("memoBoxBody");
				div.innerHTML = request.responseText;
				
			}else{
				alert("a problem occurred with the server..." + request.status);
			}
		}
	}
	
	
	function MB_newLightbox(){
		name = document.getElementById('MbNewLb').value;
		httpRequest("GET","/ajax/MB_newLightbox.php?name=" + name ,true,handleMB_newLightbox);
	}
	
	function handleMB_newLightbox(){
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("memoBoxBody");
				div.innerHTML = request.responseText;
			}else{
				alert("a problem occurred with the server..." + request.status);
			}
		}
	}
	
	
	// scelta della lightbox..
	function MB_lightboxView( uid , lbn  ){
		httpRequest("GET","/ajax/MB_lightboxView.php?uid=" + uid + "&lbn=" + lbn ,true,handleMB_lightboxView);
	}
	
	
	function handleMB_lightboxView(){
		
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("memoBoxLBI");
				div.innerHTML = request.responseText;
				
			}else{
				alert("a problem occurred with the server..." + request.status);
			}
		}
	}

	
	/********************************
	*
	*   CHIAMATE generiche
	*
	*********************************/ 	
	
	function G_add2Lb ( uid , id , type ){
		httpRequest("GET","/ajax/G_add2Lb.php?uid=" + uid + "&id=" + id + "&type=" + type , true , handleG_add2Lb);
	}

	
	function handleG_add2Lb(){
		
		//document.theCatLoader.src = "/img/loading.gif";
	
		if(request.readyState == 4){
			if(request.status == 200){
				// var div = document.getElementById("memoBoxBody");
				// div.innerHTML = request.responseText;
				//document.theCatLoader.src = "/img/trasp.gif";
			}else{
				alert("a problem occurred with the server..." + request.status);
				//document.theCatLoader.src = "/img/trasp.gif";
			}
		}
		
		
	}
	
	
	function G_add2Cart (  id , type , rangeId, formatId ){
		//alert("/ajax/G_add2Cart.php?id=" + id + "&type=" + type + "&rangeId=" + rangeId + "&formatId=" + formatId);
		httpRequest("GET","/ajax/G_add2Cart.php?id=" + id + "&type=" + type + "&rangeId=" + rangeId + "&formatId=" + formatId , true , handleG_add2Cart);
	}

	
	function handleG_add2Cart(){
		
		if(request.readyState == 4){
			if(request.status == 200){
				// alert(request.responseText);// var div = document.getElementById("memoBoxBody");
				// div.innerHTML = request.responseText;
				// document.theCatLoader.src = "/img/trasp.gif";
			}else{
				alert("a problem occurred with the server..." + request.status);
				//document.theCatLoader.src = "/img/trasp.gif";
			}
		}
		
		
	}
	
	
	/*
	mostra il carrello nel box di SX
	*/
	function G_showMemoBox( view ){
			httpRequest("GET","/ajax/MB_view.php?view=" + view , true , handleG_showMemoBox);
	}
	
	function handleG_showMemoBox(){
		
		if(request.readyState == 4){
			if(request.status == 200){
				var div = document.getElementById("memoBoxBody");
				div.innerHTML = request.responseText;
			}else{
				alert("a problem occurred with the server..." + request.status);
				//document.theCatLoader.src = "/img/trasp.gif";
			}
		}
		
		
	}
	
	
	

	
	
	
	
