if(!$chk(HKM)) {
	HKM = {};
}

HKM.pageBasketContainer = null;
HKM.pageBasketFx = null;

HKM.initPageBasket = function() {
	var pageBasketCandidates = $$('.shoppingBasket');
	if(pageBasketCandidates.length > 0) {
		HKM.pageBasketContainer = pageBasketCandidates.pop();
	}
}

HKM.updatePageBasket = function(newEntryCount) {

	
	if(HKM.pageBasketContainer !== null) {
	 
		var countDisplayCandidates = $ES('#BasketCount', HKM.pageBasketContainer);
	    if(countDisplayCandidates.length > 0) {
			var countDisplay = countDisplayCandidates.pop();
			countDisplay.setText(newEntryCount.toString()); 
			HKM.startUpdatedBasketFX(countDisplay);
		}
	}
}

HKM.startUpdatedBasketFX = function(target) {
	
	if(HKM.pageBasketFx !== null) {
		HKM.pageBasketFx.cancel();
	}
	
	HKM.pageBasketFx = new Fx.Styles(target, {onComplete:function(){HKM.pageBasketFx = null}, duration:500});
	target.setStyle('color','#48575E');
	HKM.pageBasketFx.start.delay(2000, HKM.pageBasketFx, {'color': ['#48575E', '#ADACA9']});
	
}

window.addEvent('domready', HKM.initPageBasket);