
function getBasket(){
	 new Request.HTML({
		method: 'post',  
		url: '/index.php',
		data: {'action_ajax':'show_product_cart'},
		update: $('topMenuBasket'),
		 onRequest: 
			function(){
				$('topMenuBasket').addClass('ajax_loading');
				$('topMenuBasket').set('text','');
			},
		onComplete:
		 function(){
				$('topMenuBasket').removeClass('ajax_loading');
					$('topMenuBasket').highlight('#ffffff', '#fff');
//					$('topMenuBasket').set('tween', {}).tween('height', '0px');
					<!-- pridal som koli tomu, ze zostaval otvoreny,. mozno bude blbnut pri pridanie produktu do kosiku -->
				}
	}).send();
}

	 

/*--------------------------*/
/*--------BASKET --------*/
/*--------------------------*/

window.addEvent('domready', function(){
	getBasket();
	// The same as before: adding events
//	$('topMenuBasket_btn').addEvents({
//		'mouseenter': function(){
//			// Always sets the duration of the tween to 1000 ms and a bouncing transition
//			// And then tweens the height of the element
//			$('topMenuBasket').set('tween', {
//				duration: 1000,
//				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
//			}).tween('height', $('topMenuBasket').getScrollSize().y );
//		},
//		'mouseleave': function(){
//			// Resets the tween and changes the element back to its original size
//			$('topMenuBasket').set('tween', {}).tween('height', '0px');
//		}
//	});
});

function addProduct(id){
	new Request.HTML({  
		 method: 'post',  
		 url: 'index.php',
		 data: {'action_ajax' : 'addProduct', 'id_product':id},
		 update: 'productCart'
	 }).send(); 
	getBasket();
	
}

function deleteProduct(id){
	new Request.HTML({  
		 method: 'post',  
		 url: 'index.php',
		 data: {'action_ajax' : 'deleteProduct', 'id_cart':id},
		 onSuccess:function(){
		 }
	 }).send();
}
