
function getLoadingImage(){
		return '<div align="center" style="padding:20px"><img src="images/loading.gif" alt="" align="absmiddle" id="loading3" /></div>';
	}
//----------------------PathCatalogo-----------------------------	
function getPathCatalogo(id){
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=path_catalogo&id_categoria='+id, setPathCatalogo_html);
}
function setPathCatalogo_html(){
		document.getElementById('path_catalogo').innerHTML=this.req.responseText;
	}
//----------------------Categorie--------------------------------
	
function getCategorie(id){	
		document.getElementById('category_content').innerHTML=getLoadingImage();
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=catalogo_categorie&id_categoria='+id, setCategorie_html);
		getPathCatalogo(id);
		getProdotti(id,1);
	}
function setCategorie_html(){
		document.getElementById('category_content').innerHTML=this.req.responseText;
	}
//----------------------Prodotti--------------------------------
	
function getProdotti(id_cat,page){	
		document.getElementById('catalogo_content').innerHTML=getLoadingImage();
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=catalogo_prodotti&id_categoria='+id_cat+'&page='+page, setProdotti_html);
	}
function setProdotti_html(){
		document.getElementById('catalogo_content').innerHTML=this.req.responseText;
	}
//----------------------DettaglioProdotto------------------------------------
function getProdottoDettaglio(id){
	document.getElementById('overlay').innerHTML=getLoadingImage();
	AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=prodotto&id='+id, Prodotto_html);
}
function Prodotto_html(){
	document.getElementById('overlay').innerHTML=this.req.responseText;
}
function DettaglioProdotto(id){
	showOverPage();
	getProdottoDettaglio(id);		
}
//---------------------Indirizzo----------------------------------------------------
function getSelect(what,value){
	document.getElementById(what+'_container_loader').innerHTML='<div align="left"><img src="images/loading.gif" width="14" alt="" align="absmiddle" id="loading" /></div>';
	if(what=='provincia'){
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value, SelectProvincia_html);
	}
	if(what=='citta'){
		document.getElementById('provincia').value=value;
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value, SelectCitta_html);
	}
	if(what=='cod_postale'){
		document.getElementById('citta').value=value;
		AyaxRequest('../../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value, SelectCAP_html);
	}
}
function SelectProvincia_html(){
	document.getElementById('provincia_container').innerHTML=this.req.responseText;
	document.getElementById('provincia_container_loader').innerHTML='&nbsp;';
	document.getElementById('provincia').value='';
	document.getElementById('citta_dyn').value='';
	document.getElementById('citta').value='';
	document.getElementById('cod_postale').value='';
	document.getElementById('citta_dyn').disabled=true;
	document.getElementById('cod_postale').disabled=true;
}
function SelectCitta_html(){
	document.getElementById('citta_container').innerHTML=this.req.responseText;
	document.getElementById('citta_container_loader').innerHTML='&nbsp;';
	document.getElementById('cod_postale').value='';
	document.getElementById('cod_postale').disabled=true;
}
function SelectCAP_html(){
	document.getElementById('cod_postale').disabled=false;
	document.getElementById('cod_postale_container_loader').innerHTML='&nbsp;';
	document.getElementById('cod_postale').value=this.req.responseText;
}

