$(document).ready(function(){
	
	$('#menuc').html($('#menub').html());
	
	screenshotPreview();
	
	$('#menu .kat').not('.active').hover(function(){
		$(this).addClass('active');
	},function(){
		$(this).removeClass('active');
	});
		
	$('#menu .kat2').not('.active2').hover(function(){
		$(this).addClass('active2');
	},function(){
		$(this).removeClass('active2');
	});
	
	
	$('#menu td.kat, #menu td.kat2').click(function(){
		window.location.href = $(this).find('a').attr('href');
	});

	
});
function startLoading($el,$fn)
{
	$("#"+$el).html('<img src="images/loading.gif">');
	$("#"+$el).show();
	
	if($fn){
		eval($fn);
	}
}
function stopLoading($el)
{
	$("#"+$el).hide();
}

var $poprzednia_tresc = new Array();
function zablokuj($id)
{
	$e = xajax.$($id);
	$poprzednia_tresc[$id] = $e.value;
	$e.value = 'Proszę czekać';
	$e.disabled = true;
}
function odblokuj($id)
{
	$e = xajax.$($id);
	$e.value = $poprzednia_tresc[$id];
	$e.disabled = ''; 
}
function jq($cont)
{
	eval($cont);
}
this.screenshotPreview = function(){	
		xOffset = 10;
		yOffset = 10;
	$("a.screenshot").hover(function(e){
		
		$big = $(this).find('img').attr('srcbig');
		$t = "<br/>kod: " + $(this).find('img').attr('model');
		$("body").append("<p id='screenshot'><img src='"+ $big +"' alt='url preview' />"+ $t +" - WYCENA ON-LINE >></p>");
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
//			.show();
			.fadeIn("fast");						
    },
	function(){
//		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

function zapytanieWyslij(){
	xajax_zapytanie(xajax.getFormValues('cart_quantity'));
}
