jQuery(document).ready(function($) {
	
	/*flyout.js code*/
	$('.category_items li').mouseover(function(){
		$(this).css('backgroundColor','#f0f0f0');
	});
	$('.category_items li').mouseout(function(){
		$(this).css('backgroundColor','');
	});
	
	if($('.dropdown').length==0) {
		$('.category_items').each(function(i) {
			if(i<3) {
				$(this).prev('div').addClass('flyers');
				$(this).prev('div').wrap('<div id="drop'+i+'" class="cleared"></div>');
				$(this).addClass('flyOut');
				$(this).appendTo('#drop'+i+'');
				$(this).hide();
			}

			$('.flyers').mouseover(function(){
				$(this).next('div').show('slow', function(){
				var thisVar = $(this);
				$(this).mouseout(function() {
					thisVar.hide();
					});
				$(this).mouseover(function() {
					thisVar.show();
					});
				$(this).prev('div').mouseout(function() {
					thisVar.hide();
					});
				});
			});
		});
	}

/*
$('.category_items').each(function(i) {
    if(i<3) {
        $(this).prev('div').addClass('flyers');
        $(this).prev('div').wrap('<div id="drop'+i+'" class="cleared"></div>');
        $(this).addClass('flyOut');
        $(this).appendTo('#drop'+i+'');
        $(this).hide();
    }
        $('.flyers').mouseover(function(){
            $(this).next('div').show('slow');
        });
        $('.flyers').mouseout(function(){
            $(this).next('div').hide('slow');
        });
});

*/

	/*p7popmenu.js code*/
	/*try {
		var cartSummary = $('.cartSummaryItem').html();
		if(cartSummary!='Shopping cart is empty.') {
			$('.cartSummaryItem').css('display', 'block');
		} else {
			$('.cartSummaryItem').css('display', 'none');
		}
	} catch(e) {
		
	}*/
	if($('.dropdown').length==0) {
		$('.category_items').each(function(i) {
			if(i<3) {
				$(this).prev('div').addClass('flyers');
				$(this).prev('div').wrap('<div id="drop'+i+'" class="cleared"></div>');
				$(this).addClass('flyOut');
				$(this).appendTo('#drop'+i+'');
				$(this).hide();
			} else if(i===3){
				$(this).prev('div').addClass('titleHeader');
			}

			$('.flyers').mouseover(function(){
				$('.flyOut').hide();
				$(this).next('div').show('slow', function(){
				var thisVar = $(this);
				$(this).mouseout(function() {
					thisVar.hide();
					});
				$(this).mouseover(function() {
					thisVar.show();
					});
				$(this).prev('div').mouseout(function() {
					thisVar.hide();
					});
				});
			});
		});
	}
	if($('#breadcrumbs_container div:first').attr( 'id')!=null) {
		var sPBC = $("#product_breadcrumbs").html();
		var chBCH = $('#breadcrumbs_hold').html();
		if(sPBC!=null) {
			if(chBCH==null) {
					newSpBC = '<div id="breadcrumbs_hold" class="left col_right">'+sPBC+'</div>';
					$('#breadcrumbs_container div:first').before(newSpBC);
			}else {
					$('#breadcrumbs_hold').html(sPBC);
			}
			$("#product_breadcrumbs").html('');
		}
	}

	/*shopping cart info*/
	try {
		$('.productSubmitInput').val('');
	 } catch(e) {

	}
	try {
		if($(".shop-product-large").length) {
			/*console.log(' there is something wrong her*/
			$('#tag_description2').css('display', 'none');
		} else {
			$('#tag_description2').show();
		}
	} catch(e) { }
	
	/*try {
		 $(".image").each(function(){
			$(this).has("a").css("background", 'none');
		})
	} catch(e) {

	}
	$('.col_right img').each(function(index){
		if(typeof this.naturalWidth!='undefined' && this.naturalWidth == 0) {
			console.log($(this).naturalWidth+' '+$(this).attr('id'));
			$(this).attr('src', '/images/no_image_icon_med.gif');	
			$(this).attr('src', '/images/no_image_icon_');
		}
	});*/
	
	/*shopping cart reload*/
	/*$(".productSubmitInput").click(function() {*/
         /*location.reload();
		 $('.cartSummaryItem').load(location.href + " .cartSummaryItem > *");
         evt.preventDefault();*/
      /*});*/
	  
});

