﻿// shoppingbag
FastInit.addOnLoad(function () {

	$$('.productListingCellInCart, .productInfoCellInCart').each(function(elem){
		elem.onclick = function () {
			var url = this.readAttribute('href'); if (!url) return;
			this.setStyle({backgroundPosition:'top right',cursor:'default'})
			this.removeAttribute('href')
			this.blur();
			new Ajax.Request(url, { 
				method:'get',
				parameters:{ajaxRequest:true},
				onSuccess: function(transport) {
					$('cartCountContents').innerHTML = parseInt($('cartCountContents').innerHTML).succ();
				}.bind(this)
			}); 

			return false;
		}
	})
})



// doka
FastInit.addOnLoad(function () {
	$$('.productListingCellInDoka, .productInfoCellInDoka').each(function(elem){
		elem.onclick = function () {
			var url = this.readAttribute('href'); if (!url) return;
			this.setStyle({opacity:0.3,cursor:'default'})
			this.removeAttribute('href')
			this.blur();
			new Ajax.Request(url, { 
				onSuccess: function(transport) {
					$('dokaCountContents').innerHTML = parseInt($('dokaCountContents').innerHTML).succ();
				}.bind(this)
			}); 

			return false;
		}
	})

});