function seturl(){
	//alert(this.req.responseText);
	document.location.href=this.req.responseText;
	return false;
}
function ricercaurl(){
	var categoriapadre = document.frmcerca.categoriapadre.value;
	var costruttore = document.frmcerca.costruttore.value;
	var modello = document.frmcerca.modello.value;
	var produttore = document.frmcerca.produttore.value;
	var universale = document.frmcerca.universale.value;
	var testuale = (document.frmcerca.testuale.value!=DICTIONARY_cerca)?document.frmcerca.testuale.value:'';
	
	//alert(universale);
	//alert(DICTIONARY_cerca);
	var orderby = document.frmcerca.orderby.value;
	//alert('urlcatalogo&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&testuale='+testuale+'&orderby='+orderby+'&page=1');
	
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&universale='+universale+'&testuale='+testuale+'&produttore='+produttore+'&orderby='+orderby+'&page=1',seturl);
}

function ChangePage(newpage){
	page=newpage;
	//alert(costruttore);
	//alert(modello);
	
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&codiceprodotto='+codiceprodotto+'&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&testuale='+testuale+'&produttore='+produttore+'&orderby='+orderby+'&page='+page,seturl);
	return false;
}
function OrderBy(neworder){
	orderby=neworder;
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&codiceprodotto='+codiceprodotto+'&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&testuale='+testuale+'&produttore='+produttore+'&orderby='+orderby+'&page='+page,seturl);
	return false;
}
function setProduttore(newproduttore){
	produttore = newproduttore;
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&codiceprodotto='+codiceprodotto+'&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&testuale='+testuale+'&produttore='+produttore+'&orderby='+orderby+'&page=1',seturl);
	return false;
}

function setLanguage(lan){
	if(codiceprodotto || categoriapadre){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&newlang='+lan+'&codiceprodotto='+codiceprodotto+'&categoriapadre='+categoriapadre+'&costruttore='+costruttore+'&modello='+modello+'&testuale='+testuale+'&produttore='+produttore+'&orderby='+orderby+'&page='+page,seturl);
	}else{
	var qs = document.location.search;
	if(qs){
		var nqs = qs.replace(/&lg=\S+/,"");
		var nqs = nqs.replace(/lg=\S+/,"");
		var newqs = (nqs!='?')?nqs+"&lg="+lan:"?lg="+lan;
	}else{
		var newqs='?lg='+lan;	
	}
	var loc=document.location.href.replace(qs,"");
	document.location.href=loc+newqs;
	}
}
function ChangePageProd(newpage,prodotto){
	page=newpage;
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=urlcatalogo&prodotto='+prodotto+'&page='+page,seturl);
	return false;
}
//QUERY COMUNI
function getSelect(what,value,stile){
	if(what=='regione'){
		AyaxRequest('../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectRegione_html);
	}
	if(what=='provincia'){
		AyaxRequest('../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectProvincia_html);
	}
	if(what=='citta'){
		AyaxRequest('../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectCitta_html);
	}
	if(what=='cap'){
		AyaxRequest('../../ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectCAP_html);
	}
}
function SelectRegione_html(){
	vResult=PHP_Unserialize(this.req.responseText);
	document.getElementById('regione_container').innerHTML=vResult.regione;
	document.getElementById('provincia_container').innerHTML=vResult.provincia;
	document.getElementById('citta_container').innerHTML=vResult.citta;
	if(vResult.nazione!='IT'){
		document.getElementById('cap').value='';
		document.getElementById('cap').disabled=false;
	}else{
		document.getElementById('cap').value='';
		document.getElementById('cap').disabled=true;
	}
}

function SelectProvincia_html(){
	document.getElementById('provincia_container').innerHTML=this.req.responseText;
	document.getElementById('citta').value='';
	document.getElementById('citta').disabled=true;
	document.getElementById('cap').disabled=true;
	document.getElementById('cap').value='';
}
function SelectCitta_html(){
	document.getElementById('citta').disabled=false;
	document.getElementById('cap').disabled=false;
	document.getElementById('cap').value='';
	document.getElementById('citta_container').innerHTML=this.req.responseText;
}
function SelectCAP_html(){
	document.getElementById('cap').disabled=false;
	document.getElementById('cap').value=this.req.responseText;
}

function showloading(contenuto){
	var vPageSize=getPageSize();
	var objOverlayShadow = document.createElement("div");
	objOverlayShadow.setAttribute('id','overlayshadowloading');
	var objBody = document.getElementsByTagName("body").item(0);
	objBody.appendChild(objOverlayShadow);
	objOverlayShadow.style.height=vPageSize[1]+'px';
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','overlayloading');
	var objBody = document.getElementsByTagName("body").item(0);
	objBody.appendChild(objOverlay);
	if(!contenuto){
		objOverlay.innerHTML=document.getElementById('_loading').innerHTML;
	}else{
		objOverlay.innerHTML=contenuto;
	}
	//FadeIn('overlayloading',100);
}
function hideloadingfunc(){
		var objBody = document.getElementsByTagName('body').item(0);
	try{
		objBody.removeChild(document.getElementById('overlayshadowloading'));
		objBody.removeChild(document.getElementById('overlayloading'));
	}catch(e){}
}
function hideloading(){
	//FadeOut('overlayloading',200);
	//setTimeout('hideloadingfunc()',210);
	hideloadingfunc();
}
function Accedi(where){
		try{
		hideOverPageWithoutShadow('overlayrecuperopassword');
		}catch(e){}
	var qs = (where)?"&where="+where:"";
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=accedi'+qs, Accedi_HTML);
}
function Accedi_HTML(){
	showOverPage('overlayaccedi',700,0,'overlay');	
	document.getElementById('overlayaccedi').innerHTML=this.req.responseText;
}
function showmessage(message,position,width){
	initOverlayShadow();
	showOverlayShadow();
	document.getElementById('overlayshadow').className='shadowtrasparent';
	document.getElementById('overlayshadow').onclick = function(){hidemessage()}
	initOverlayCart('message_cart');
	var vScroll = getPageScroll();
	var objOverlay = document.getElementById('message_cart');
	objOverlay.innerHTML='<div class="top-left"></div><div class="top-right"></div><div class="inside"><div id="content_message_cart" style="text-align:left; padding:5px;"></div></div><div class="bottom-left"></div><div class="bottom-right"></div>';
	if(!position){
		objOverlay.style.top = "50%";
		objOverlay.style.left = "50%";
		objOverlay.style.margin = "-15% 0 0 -125px";
	}else{
		if(navigator.userAgent.indexOf("MSIE")!=-1){
		objOverlay.style.top = coordsXY[1]+vScroll[1]+"px";
		objOverlay.style.left = coordsXY[0]+"px";
		}else{
		objOverlay.style.top = coordsXY[1]+"px";
		objOverlay.style.left = coordsXY[0]+"px";
		}
	}
	objOverlay.style.width = "250px";
	objOverlay.style.position = "absolute";
	objOverlay.style.zIndex = 120;
	if(width)	
		objOverlay.style.width = width+"px";
	
	document.getElementById('content_message_cart').innerHTML = message;
	objOverlay.style.display = '';
	//setTimeout("hidemessage();",2000);
}

function hidemessagefunc(){
	var objBody = document.getElementsByTagName('body').item(0);
	try{
		objBody.removeChild(document.getElementById('overlayshadow'));
		objBody.removeChild(document.getElementById('message_cart'));
	}catch(e){}
}
function hidemessage(){
	clearTimeout();
	FadeOut('message_cart',450);
	setTimeout('hidemessagefunc()',500);
}
function acquista(idprodotto){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello&idprodotto='+idprodotto, acquista_result);
}

function acquista_result(){
	//alert(this.req.responseText);
	var vResult = converti_in_array(PHP_Unserialize(this.req.responseText));
	if(vResult.acquisto==1){
		//specificaquantita(vResult.idprodotto);
		//showmessage('prova');
		acquistaquantita(vResult.idprodotto,1);
	}else{
		document.getElementById('totcarteuro').innerHTML=vResult.totalecarrello;
		document.getElementById('totcart').innerHTML=vResult.totalecarrelloprodotti;
		document.getElementById('btcart'+vResult.idprodotto).innerHTML=vResult.pulsante;
		document.getElementById('btcartbt'+vResult.idprodotto).className ='button';
		showmessage(vResult.messaggio,true);
	}
}
function specificaquantita(idprodotto){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=specificaquantita&idprodotto='+idprodotto, specificaquantita_HTML);
}
function specificaquantita_HTML(){
	showOverPage('overlayquantita',250,0,'overlay');
	document.getElementById('overlayquantita').innerHTML=this.req.responseText;
}

function acquistaquantita(idprodotto,quantita){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello&idprodotto='+idprodotto+'&quantita='+quantita, acquistaquantita_result);
}
function acquistaquantita_result(){
	var vResult = converti_in_array(PHP_Unserialize(this.req.responseText));
	if(vResult.acquisto==1){
		try{
		hideOverPage('overlayquantita');
		}catch(e){}
		document.getElementById('totcarteuro').innerHTML=vResult.totalecarrello;
		document.getElementById('totcart').innerHTML=vResult.totalecarrelloprodotti;
		document.getElementById('btcart'+vResult.idprodotto).innerHTML=vResult.pulsante;
		document.getElementById('btcartbt'+vResult.idprodotto).className='button sat';
		showmessage(vResult.messaggio,true);
	}
}

//VISUALIZZA ELENCO PRODOTTI NEL CARRELLO
function elencoProdottiCart(){
	if(!prodotticartwindow){
		var vScroll = getPageScroll();
		initOverlayCart('prodotticart_window');
		if(navigator.userAgent.indexOf("MSIE")!=-1){
		showOverlayCart('prodotticart_window',coordsXY[1]+10+vScroll[1],coordsXY[0]-150);
		}else{
		showOverlayCart('prodotticart_window',coordsXY[1]+10,coordsXY[0]-150);
		}
		document.getElementById('prodotticart_window').style.display='none';
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=elencoprodotticarrello',elencoProdottiCartHTML);
		prodotticartwindow=true;
	}
}
function elencoProdottiCartHTML(){
	try{
	document.getElementById('content_prodotticart_window').innerHTML=this.req.responseText;
	}catch(e){}
}
function carrello(){
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello', carrello_HTML);
}
function carrello_HTML(){
	try{
		hideOverPageWithoutShadow("overlayanteprimaordine");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlaypreferiti");
	}catch(e){}
	try{
		hidemessagefunc();	
	}catch(e){}
	showOverPage('overlaycarrello',700,0,'overlay');
	//document.getElementById('overlaycarrello').style.top='35%';
	document.getElementById('overlaycarrello').innerHTML=this.req.responseText;
}
function preferiti(){
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=preferiti', preferiti_HTML);
}
function preferiti_HTML(){
	try{
		hideOverPageWithoutShadow("overlayprofilo");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlaycarrello");
	}catch(e){}
	try{
		hidemessagefunc();	
	}catch(e){}
	showOverPage('overlaypreferiti',700,0,'overlay');
	//document.getElementById('overlaypreferiti').style.top='35%';
	document.getElementById('overlaypreferiti').innerHTML=this.req.responseText;
}
function eliminaprodottopreferito(id){
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=preferiti&elimina='+id,preferiti_HTML);
}

function setpreferito(idprodotto){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=preferiti&idprodotto='+idprodotto, setpreferito_result);
}

function setpreferito_result(){
	var vResult = converti_in_array(PHP_Unserialize(this.req.responseText));
	if(vResult.preferito==1){
		showmessage(vResult.messaggio,true);
	}
}


function aggiornaquantita(id){
	var quantita = document.getElementById('qta'+id).value;
	if(quantita<=0){
		eliminaprodottodalcarrello(id);
	}else{
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello&aggiornaqta='+id+'&quantita='+quantita,aggiornaquantitaresult);
		document.getElementById('messaggicarrello').innerHTML=DICTIONARY_quantitaaggiornata;
	}
	setTimeout("document.getElementById('messaggicarrello').innerHTML='&nbsp;'",2000);
}
function aggiornaquantitaresult(){
	vResult=PHP_Unserialize(this.req.responseText);
	document.getElementById("importo"+vResult.id).innerHTML=vResult.importo;
	document.getElementById("totalecarrello").innerHTML=vResult.totale;
	document.getElementById('totcarteuro').innerHTML=vResult.totale;
	document.getElementById('totcart').innerHTML=vResult.totalequantita;
	if(vResult.totalenetto){
		document.getElementById('subtotalecredito').style.display='';
		document.getElementById('subtotalenetto').innerHTML=vResult.totalenetto;
		document.getElementById('subtotalenettocontainer').style.display='';
	}else{
		document.getElementById('subtotalecredito').style.display='none';
		document.getElementById('subtotalenettocontainer').style.display='none';
	}
}
function eliminaprodottodalcarrello(id){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello&elimina='+id,eliminaprodottodalcarrelloresult);
}

function eliminaprodottodalcarrelloresult(){
	//alert(this.req.responseText);
	vResult=PHP_Unserialize(this.req.responseText);
	document.getElementById('totcarteuro').innerHTML=vResult.totale;
	document.getElementById('totcart').innerHTML=vResult.totalequantita;
	try{
	document.getElementById('btcart'+vResult.idprodotto).innerHTML=vResult.pulsante;
	document.getElementById('btcartbt'+vResult.idprodotto).className ='button';
	}catch(e){}
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=carrello',carrello_HTML);
}
function registrazione(){
	try{
	hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	try{
	hideOverPageWithoutShadow("overlayrecuperopassword");
	}catch(e){}
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=registrazione', registrazione_HTML);
}
function registrazione_HTML(){
	showOverPage('overlayregistrazione',700,0,'overlay');
	//document.getElementById('overlayregistrazione').style.top='30%';
	document.getElementById('overlayregistrazione').innerHTML=this.req.responseText;
}
function Profilo(){
	try{
	hideOverPageWithoutShadow('overlayregistrazione');
	}catch(e){}
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=profilo',profilo_result);
}
function profilo_result(){
	try{
		hideOverPageWithoutShadow("overlayordini");
	}catch(e){}
	vResult=PHP_Unserialize(this.req.responseText);
	if(vResult && vResult[0]==0){
		Accedi();	
	}else{	
	try{
		hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	showOverPage('overlayprofilo',700,0,'overlay');
	document.getElementById('overlayprofilo').innerHTML=this.req.responseText;
	}
}
function modificaprofilo(){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=modificadati',modificaprofilo_HTML);
}
function modificaprofilo_HTML(){
	//alert(this.req.responseText);
	try{
		hideOverPageWithoutShadow("overlayprofilo");
	}catch(e){}
	showOverPage('overlaymodificaprofilo',700,0,'overlay');
	//document.getElementById('overlaymodificaprofilo').style.top='30%';
	document.getElementById('overlaymodificaprofilo').innerHTML=this.req.responseText;
}
function anteprimaordine(){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=anteprimaordine',anteprimaordine_HTML);
}
function anteprimaordine_HTML(){
	try{
		hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayprofilo");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlaycarrello");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayriepilogoordine");
	}catch(e){}
	vResult=PHP_Unserialize(this.req.responseText);
	if(vResult && vResult[0]==0){
		Accedi('ordine');	
	}else{	
		showOverPage('overlayanteprimaordine',700,0,'overlay');
		//document.getElementById('overlayanteprimaordine').style.top='30%';
		document.getElementById('overlayanteprimaordine').innerHTML=this.req.responseText;
	}
}
function riepilogoordine(){
	if(!paytype){
		alert(DICTIONARY_selezionalamodalitadipagamento);
	}else{
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=riepilogoordine&paytype='+paytype,riepilogoordine_HTML);
	}
}
function riepilogoordine_HTML(){
	try{
		hideOverPageWithoutShadow("overlayanteprimaordine");
	}catch(e){}
		showOverPage('overlayriepilogoordine',700,0,'overlay');
		//document.getElementById('overlayriepilogoordine').style.top='30%';
		document.getElementById('overlayriepilogoordine').innerHTML=this.req.responseText;
	}
function concludiordine(idordine,ordineprocedure){
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=confermaordine&idordine='+idordine,concludiordine_HTML);
}
function concludiordine_HTML(){
	try{
		hideOverPageWithoutShadow("overlayordini");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayriepilogoordine");
	}catch(e){}
	vResult=PHP_Unserialize(this.req.responseText);
	if(vResult && vResult[0]==0){
		Accedi('storicoordini');	
	}else{	
		showOverPage('overlayconcludiordine',700,0,'overlay');
		//document.getElementById('overlayconcludiordine').style.top='30%';
		document.getElementById('overlayconcludiordine').innerHTML=this.req.responseText;
	}
}
function pagacon(idordine,paytype){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=ordini&idordine='+idordine+'&paytype='+paytype,pagacon_result);
}
function pagacon_result(){
	//alert(this.req.responseText);
	obj=PHP_Unserialize(this.req.responseText);
	vResult = converti_in_array(obj);
	concludiordine(vResult.idordine);
}
function ordini(){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=ordini',ordini_HTML);
}
function ordini_HTML(){
	try{
		hideOverPageWithoutShadow("overlayconcludiordine");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayprofilo");
	}catch(e){}
	vResult=PHP_Unserialize(this.req.responseText);
	if(vResult && vResult[0]==0){
		Accedi('storicoordini');	
	}else{	
		showOverPage('overlayordini',700,0,'overlay');
		//document.getElementById('overlayordini').style.top='30%';
		document.getElementById('overlayordini').innerHTML=this.req.responseText;
	}
}

function dettaglioordine(idordine){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=ordini&idordine='+idordine,dettaglioordine_HTML);
}
function dettaglioordine_HTML(){
	try{
		hideOverPageWithoutShadow("overlayconcludiordine");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	try{
		hideOverPageWithoutShadow("overlayprofilo");
	}catch(e){}
	vResult=PHP_Unserialize(this.req.responseText);
	if(vResult && vResult[0]==0){
		Accedi('storicoordini');	
	}else{	
		//alert('');
		showOverPage('overlayordini',700,0,'overlay');
		//document.getElementById('overlayordini').style.top='30%';
		document.getElementById('overlayordini').innerHTML=this.req.responseText;
	}
}
function recuperopassword(){
	try{
		hideOverPageWithoutShadow("overlayaccedi");
	}catch(e){}
	showloading();
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=recuperopassword', recuperopassword_HTML);
}
function recuperopassword_HTML(){
	showOverPage('overlayrecuperopassword',700,0,'overlay');	
	document.getElementById('overlayrecuperopassword').innerHTML=this.req.responseText;
}
function prodottoCommenti(prodotto){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=commenti&id='+prodotto, prodottoCommenti_HTML);
}
function prodottoCommenti_HTML(){
	document.getElementById('commenti_container').innerHTML=this.req.responseText;
}
function lasciacommento(prodotto,qs){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=lasciacommento&id='+prodotto+'&qs='+encodeURIComponent(qs), lasciacommento_HTML);
}
function lasciacommento_HTML(){
	showOverPage('commentoverlay',700,0,'overlay');
	document.getElementById('commentoverlay').style.marginTop='0';
	//document.getElementById('commentoverlay').style.top='auto';
	document.getElementById('commentoverlay').style.position='fixed';
	document.getElementById('commentoverlay').innerHTML=this.req.responseText;
}
function getModelli(costruttore){
	//alert(costruttore);
	if(!costruttore){
		document.getElementById('modelloselcontainer').innerHTML='<select class="input_text" style="width:135px; font-size:11px;" disabled="disabled"><option>'+DICTIONARY_selezionamodello+'</option></select>';
	
		return false;
	}
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=modelli&costruttore='+costruttore, getModelli_HTML);
}
function getModelli_HTML(){
	//alert(this.req.responseText);
	document.getElementById('modelloselcontainer').innerHTML=this.req.responseText;	
	//document.getElementById('modellosel').disabled = false;
}
function richiedipreventivo(codprodpreventivo){
	var strcodprod=(codprodpreventivo)?'&codprod='+codprodpreventivo:'';
	showOverPage('overlaypreventivo',700,0,'overlay');
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=richiedipreventivo'+strcodprod,richiedipreventivo_HTML);
}
function richiedipreventivo_HTML(){
	document.getElementById('overlaypreventivo').innerHTML=this.req.responseText;
}

function carrellotopreventivo(){
	try{
		hideOverPageWithoutShadow("overlaycarrello");
	}catch(e){}
	showOverPage('overlaypreventivo',700,0,'overlay');
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=richiedipreventivo&fromcarrello=true',richiedipreventivo_HTML);
}

function bannerguida(url){
	AyaxRequest('ajax_request.php', 'POST', 'filetocall=bannerguida&url='+url,bannerguida_result);
}
function show_bannerguida(){
	try{
	document.getElementById('bannerbottom').style.display='';
	changeOpac(0, 'bannerbottom');
	opacity('bannerbottom', 0, 100, 2000);
	}catch(e){}
}

function bannerguida_result(){
	vResult=converti_in_array(PHP_Unserialize(this.req.responseText));
	
	if(vResult.show){
		var objBody = document.getElementsByTagName("body").item(0);
		var objOverlayParent = document.createElement("div");
		objOverlayParent.setAttribute('id','bannerbottom');
		objBody.appendChild(objOverlayParent);
		
		var objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','bannerbottomshadow');

		objOverlayParent.appendChild(objOverlay);
		
		var objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','bannerbottomcontainer');

		objOverlayParent.appendChild(objOverlay);
		objOverlay.innerHTML=stripslashes(vResult.contenuto);
		
		if(vResult.ritardo>0){
			setTimeout('show_bannerguida();',vResult.ritardo);
		}else{
			show_bannerguida();	
		}
	}
}
