$(document).ready( function(){

/**********************wyszukiwarka lista rozwijana *****************/
	
	$('#searchcat , #chooseCat').click(function(){	

		$('.searchCategory').slideToggle(200);

				
	return false;
	});
	
	$('body').click(function(){$('.searchCategory').css("display","none");});
	$('.categoryUl li a').click(function(){
		var categoryName = $(this).html();
		var categoryId = $(this).attr("class");
		$("#chooseCat").attr("value", categoryName);
		$(".hiddenId").attr("value", categoryId);
		

	});



/************************************************************************/
	$('.products_list').cycle({fx: 'scrollHorz',
		              speed: 800,
		              timeout: 0,
			      prev: '.products_prev a',
			      next: '.products_next a'});


	$('img', '.products_item').mouseover(function(){
		$(this).stop();
		if($(this).attr('rel') == undefined) $(this).attr('rel', $(this).height());

		$(this).animate({
			left:   "0px",
			bottom: "0px",
			width:  $(this).parent().width(),
			height: parseInt($(this).attr('rel'))*1.2962},
			275, function(){
					  $(this).attr('src', $(this).attr('med'));
			 	       }
		);
		
	});


	$('img', '.products_item').mouseout(function(){
		$(this).stop();
		$(this).attr('src', $(this).attr('sml'));

		$(this).animate({
			left:   "20px",
			bottom: "20px",
			width:  $(this).parent().width()-40,
			height: parseInt($(this).attr('rel'))},
			275, function(){

			 	       }
		);
	});


	$('img', '.products_item').click(function(){
		/*
        	$.ajax({
            		url: "/page.php",
			data: "cat="+$(this).attr('cat')+"&producthome=1",
            		type: "GET",
            		success: function(html){
				$('.right_content').html(html);
			}
        	});
		*/
	});

});
