// JavaScript Document

function load_item_cat_z(category_id, submenu)
{
	//alert("#z_category_"+category_id);
	//alert(post_id);
	//alert(category_id);z_category_active
	if(submenu)
	{
		if(!(jQuery("#z_category_posts_"+category_id).hasClass("open")))
		{
			jQuery(".open").slideUp();
			jQuery("#z_category_posts_"+category_id).slideDown();
			jQuery(".open").removeClass("open");
			jQuery("#z_category_posts_"+category_id).addClass("open");
			
		}
	}
	else
	{
		
		if((jQuery("#z_category_"+category_id).hasClass("level_1")))
		{
			
			jQuery(".open").slideUp();
			
			jQuery(".open").removeClass("open");
			
			
		}
	}
	jQuery("#post_b").empty();
	jQuery("#col_bob").slideUp(500);
	jQuery("#post_b").append('<div id="loading_z"></div>');
	
	jQuery.post('wp-content/themes/cicrespi-new/load_item_cat_z.php', {product_category: category_id, product_safety: 1}, function(data) {
		
		jQuery("#post_b").replaceWith('<div id="post_b" class="post col_home" style="display:none;">'+data+'</div>');
		jQuery("#post_b").slideDown();
		
	});
	
	
}


jQuery(document).ready(function() {
	jQuery(".home_item_category").hover(
		function () 
		{
			
			
			jQuery(this).find(".home_item_descritpion").stop().animate({
				marginTop: "-60px"	}, 500, function() {
					
				});
			
		}, 
		function () 
		{
			jQuery(this).find(".home_item_descritpion").stop().animate({
				marginTop: "0px"
				}, 500, 
				function() {
					
				}
			);
		}
	);
	jQuery(".ie_link").hover(
		function () 
		{
			var id = jQuery(this).attr("rel");
			//alert(id);
			var content = 
			jQuery(this).prev().find(".home_item_descritpion").stop().animate({
				marginTop: "-60px"	}, 500, function() {
					
				});
			
		}, 
		function () 
		{
				var id = jQuery(this).attr("rel");
				jQuery(this).prev().find(".home_item_descritpion").stop().animate({
				marginTop: "0px"
				}, 500, 
				function() {
					
				}
			);
		}
	);

});


