var showCarrello = null;
var showCarrellocontainer = null;
var showCart = null;
var showLogin = null;
var showCredito = null;


function refreshcarrelloajaxconparametri(test) {
        if(! $('carrelloajax')) {
                var carrelloajax = d.createElement('div');
                carrelloajax.id = 'carrelloajax'; carrelloajax.style.background = 'white';
                $('lista').insertBefore(carrelloajax,$('cont'));
                }
                var request = new Ajax('carrelloajax?'+ test);
                request.onload = function(content) {
                        $('carrelloajax').innerHTML = content;
                        showCart = new fx.Height('carrelloajax', { duration: 500 });
                        showCart.hide();
                        showCart.toggle();
                }
                request.send();
        
        if(showLogin) showLogin.hide();
        if(showSearch) showSearch.hide();
        if(showPreferences) showPreferences.hide();
        //if(showCart) showCart.toggle();
}

function refreshcreditoajaxconparametri(test) {
   if(! $('creditoajax')) {
var creditoajax = d.createElement('div');
    creditoajax.id = 'creditoajax'; 
    $('search').insertBefore(creditoajax,$('credito'));
            }
 var request = new Ajax('credito_ajax?cid='+ test);
     request.onload = function(content) {
     $('creditoajax').innerHTML = content;
     showCredito = new fx.Opacity('creditoajax', { duration: 1500 });
     showCredito.hide();
     showCredito.toggle();
        }
 request.send();
}
function refreshcarrelloajaxconparametriop(test) {
       if(! $('carrelloajax')) {
       var carrelloajax = d.createElement('div');
       carrelloajax.id = 'carrelloajax'; carrelloajax.style.background = 'white';
       $('lista').insertBefore(carrelloajax,$('cont'));
       }
       var request = new Ajax('carrelloajax?'+ test);
       request.onload = function(content) {
       $('carrelloajax').innerHTML = content;
       showCart = new fx.Opacity('carrelloajax', { duration: 1500 });
       showCart.hide();
       showCart.toggle();
       }
       request.send();
       if(showLogin) showLogin.hide();
       if(showSearch) showSearch.hide();
       if(showPreferences) showPreferences.hide();
       // if(showCart) showCart.toggle();
}
function mostracarrelloajax() {
        if(! $('carrelloajax')) {
        var carrelloajax = d.createElement('div');
        carrelloajax.id = 'carrelloajax'; carrelloajax.style.background = 'white';
        $('lista').insertBefore(carrelloajax,$('cont'));

                var request = new Ajax('carrelloajax');
        
                request.onload = function(content) {
                        $('carrelloajax').innerHTML = content;
                        showCart = new fx.Height('carrelloajax', { duration: 500 });
                        showCart.hide();
                        showCart.toggle();
                }
                
                request.send();
                
        }
        if(showLogin) showLogin.hide();
        //if(showSearch) showSearch.hide();
        if(showPreferences) showPreferences.hide();
        if(showCart) showCart.toggle();
}
//-->
function doCart(form) {
//coupon=form.coupon.value;
codice=form.codice.value;
var params='add=1&id='+codice;
refreshcarrelloajaxconparametri(params);
return false;
}

function progressOn() { document.getElementById('waitDiv').style.visibility = 'visible';  }
function progressOff() { document.getElementById('waitDiv').style.visibility = 'hidden';  }
