$(document).ready(function(){
	//Fix png files
	$(document).pngFix();
	//$("div#main-menu ul li").pngFix();
	
	//Preload All Images from CSS
	$.preloadCssImages();
	
	//Hide All products in menu view
	$("ul.subnav:not(.currentCategory)").hide();
	//	$("ul.currentCategory").slideToggle("slow");
	
	//Show products based on category choice
	$("li.catLink a").click(function(){
		var chosenSub = $(this).parent().next().children('ul.subnav');
		if(!chosenSub.hasClass('currentCategory'))
		{
			$("ul.currentCategory").removeClass('currentCategory');
			//First Hide Main Content
			$("div#content").wrapInner("<div id='oldContent'></div>");
			$("div#oldContent").livequery('',function(){
				$(this).fadeOut();
			});
			//Hide All Sub Navs
			$("ul.subnav").slideUp();
			//Show the one chosen
			chosenSub.slideToggle("slow");
			//Add currentCategory Class
			chosenSub.addClass('currentCategory');
		}
		return false;
	});
	
	//Main menu imageSwap
	$("#homeLink a:not(.current)").hover(
		function(){
			$(this).parent().toggleClass("homeIcon_ON");
		},	
		function(){
			$(this).parent().toggleClass("homeIcon_ON");
		}
	);
	$("#storeLink a:not(.current)").hover(
		function(){
			$(this).parent().toggleClass("storeIcon_ON");
		},	
		function(){
			$(this).parent().toggleClass("storeIcon_ON");
		}
	);
	$("#offersLink a:not(.current)").hover(
		function(){
			$(this).parent().toggleClass("offersIcon_ON");
		},	
		function(){
			$(this).parent().toggleClass("offersIcon_ON");
		}
	);
	$("#newsLink a:not(.current)").hover(
		function(){
			$(this).parent().toggleClass("newsIcon_ON");
		},	
		function(){
			$(this).parent().toggleClass("newsIcon_ON");
		}
	);
	$("#contactLink a:not(.current)").hover(
		function(){
			$(this).parent().toggleClass("contactIcon_ON");
		},	
		function(){
			$(this).parent().toggleClass("contactIcon_ON");
		}
	);
});