function shop_highlight(div){
	new Effect.Highlight(div);
}

function shop_card_count(id,count,div){
	var ilosc =  prompt ("Podaj ilość zamawianych produktów:", count );		
	if ( !isNaN(parseInt(ilosc)) ) {
		xajax_shop_card_count(id,ilosc,div);
	}
}

function shop_card_count2(id,count,div){
	var ilosc =  prompt ("Podaj ilość zamawianych produktów:", count );		
	if ( !isNaN(parseInt(ilosc)) ) {
		xajax_shop_card_count2(id,ilosc,div);
	}
}

function shop_komunikat_dodania(){
	if (jQuery) {
		if (jQuery('#koszyk-dymek').length==0) jQuery('<div id="koszyk-dymek"></div>').appendTo('body');
		show_overlay();
		jQuery('#koszyk-dymek').html('<div class="wrapper"><h1>Pozycja została dodana do koszyka z zakupami</h1><p>Gdy już skończysz wybierać produkty, naciśnij przycisk <span><a href="index.php?k_d=515">formularz zamówienia</a></span></p><p>Uwaga! Nie musisz się rejestrować, wprowadzać haseł itp. Wystarczy wypełnić formularz z adresem dostawy.</p><p><b>Możesz zapłacić przy odbiorze</b> przesyłki. Towar wysyłany jest zazwyczaj w dniu złożenia zamówienia lub w następnym dniu roboczym.</p><a href="#" class="button button1">ZAMKNIJ</a><a class="button2" href="index.php?k_d=515">składam zamówienie</a></div>')
		.css({ top:jQuery('#card2 .more-wrapper').offset().top - 97, left:jQuery('#card2 .more-wrapper').offset().left + 180 }).css('z-index',101).fadeIn();
		jQuery('#koszyk-dymek .button').unbind('click').bind('click',function(){ jQuery('#koszyk-dymek').hide().empty(); jQuery('#instrukcja-overlay').fadeOut(); return false; });
		//location.href='#koszyk';
		//jQuery(document).scrollTop(300);
		if (jQuery.browser.opera || jQuery.browser.mozilla) jQuery('html').animate({scrollTop:jQuery('#card2').offset().top - 100 }, 1000); else jQuery('html, body').animate({scrollTop:jQuery('#card2').offset().top -100 }, 1000); 
	}
}

function shop_message_top(message){
	if (jQuery) {
		jQuery(function(){
		if (jQuery('#message-top').length==0) jQuery('<div id="message-top"></div>').appendTo('body');
		show_overlay();
		jQuery('#message-top').html(message).css({ top:30, left:jQuery(window).width()/2-jQuery('#message-top').width()/2+30 }).css('z-index',101).fadeIn();
		jQuery('#message-top .button').unbind('click').bind('click',function(){ jQuery('#message-top').hide().empty();jQuery('#instrukcja-overlay').fadeOut(); return false; });
		});
	}
}

function show_overlay(){
	if (jQuery) {
		if (jQuery('#instrukcja-overlay').length==0) jQuery('<div id="instrukcja-overlay"></div>').appendTo('body');
		jQuery('#instrukcja-overlay').css({ 'z-index':100, width:jQuery('body').width(), height:jQuery(document).height(), opacity:0.7 }).show();
	}
}

function instrukcja(message){
	//return;
	if (jQuery) {
		jQuery(function(){
			if (jQuery('#instrukcja').length==0) jQuery('<div id="instrukcja"></div>').appendTo('body');
			show_overlay();
			jQuery('#instrukcja').empty().show();
			//alert(jQuery('body').width()/2);
			//alert(jQuery('#instrukcja').width()/2);
			//alert(jQuery('body').width()/2-753/2-70);
			//jQuery('#instrukcja').html(message).css({ top:20, left:jQuery('body').width()/2-jQuery('#instrukcja').width()/2-70 }).css('z-index',101).show();
			jQuery('#instrukcja').html(message).css({ top:20, left:jQuery('body').width()/2-753/2-70 }).css('z-index',101).show();
			jQuery('#instrukcja .button, #instrukcja, #instrukcja-overlay').unbind('click').bind('click',function(){ jQuery('#instrukcja').hide().empty(); jQuery('#instrukcja-overlay').fadeOut(); return false; });
		});
	}
}

jQuery(function(){

jQuery('.cells .shop_product_cell_mode1').each(function(){
	return;
	jQuery(this).hover(function(){ 
			//var buy = jQuery('.buy', this);
			//jQuery(buy).stop().animate({ 'margin-right':15 });
			var lego = jQuery('.lego', this);
			jQuery(lego).stop().animate({ 'padding':6 });
		}, 
		function(){ 
			//var buy = jQuery('.buy', this);
			//jQuery(buy).stop().animate({ 'margin-right':5 });
			var lego = jQuery('.lego', this);
			jQuery(lego).stop().animate({ 'padding':2 });
		});
});

});

