showBasket = function() {
   $('#ECBasketContainer').show();
   return undefined;
;
}

RefreshBasket = function() {
  $('#ECBasket').load('/ECom/ECBasket.asp?Action=View');
  $.getJSON('/ECom/ECBasket.asp', {'action':'status'}, function(objBasket){
    if (objBasket.lngNbItems == 0) {
       $('p#ECBasketMsg').hide();
       $('p#ECBasketEmpty').show();
       $('#ECBasketNav').hide();
       $('#ECBasketContainer').hide();
    }
    else {
       $('#ECBasketContainer').show();
      $('#ECBasketNav').show();
      $('p#ECBasketEmpty').hide();
       $('p#ECBasketMsg').show();
    } 
  });
}
//jQuery to fill the basket
$(function(){
  RefreshBasket();
  $('#clearbasket').click(function(){
    $('#ECBasket').load('/ECom/ECBasket.asp?Action=Clear');
    RefreshBasket();
    return false;
  });
});

/*
$(document).ready(function(){
 $('.ECAdd').click(qsECAdd2); 
});



function qsECAdd2(){
	//Find the enclosing div tag with a ECArt class
	var nodeId = $('div.ECArt').get(0).id;
	//The id is supposed to be qsArtNNN
	//Extract the Node ID
	nodeId = nodeId.substring(5);
	var ECProperties = eval('ECProperties' + nodeId);
	var qty = 1
	//Find an element with ECQuantity class
	qty = $('.ECQuantity').get(0);
	if (qty) {
		qty = qty.value;
		if (qty == undefined) {
			qty = 1;
		}
	}
	else {
		qty = 1;
	}
	
	if (qty == 0 || qty < 0) {
		alert('Please enter correct quantity');
	}
	else {
	
		//Extend the ECProperties
		ECProperties.dblQuantity = qty;
		ECProperties.divResult = 'ECBasket';			

		// DTA v424 4.3.2008
		// obtient le prix selon la quantité et la date
		dblOldUnitPrice = ECProperties.dblUnitPrice;

		dblUnitPrice = qsGetDiscountQuantity(ECProperties);
		if(dblUnitPrice > -1)
			ECProperties.dblUnitPrice = dblUnitPrice;

		dblUnitPrice = qsGetDiscountTime(ECProperties);
		if(dblUnitPrice > -1)
			ECProperties.dblUnitPrice = dblUnitPrice;

		qsAddToBasket(ECProperties);
		ECProperties.dblUnitPrice = dblOldUnitPrice ;
		
	}		
}	

*/

$(document).ready(function() {
  $('#showCaddie').click(function() {
      $('#ECBasketContainer').show();
  });
});