$j(document).ready(function(){
	/* Hide subnavigation on load */
	$j("#subNavContainer").hide();	
	
	/* Holder for current subnav item */
	var src = "";
	var current = "";
	
	/* Hide subnav */
    $j("#nav img.hide")
        .mouseover(function() { 
			/* Rollovers */
			if(current != this.id){
				if(current != ""){
					src = $j("#"+current).attr("src").replace("_over", "");
					$j("#"+current).attr("src", src);
				}
				
				current = this.id;
			}
			
            src = $j(this).attr("src").match(/[^\.]+/) + "_over.jpg";
            $j(this).attr("src", src);
					
			/* Remove sub nav items */
			$j("#subNav").html("");
			
			/* Hide sub nav */
			$j("#subNavContainer").hide();		
        })
        .mouseout(function() {
			/* Rollovers */
            src = $j(this).attr("src").replace("_over", "");
            $j(this).attr("src", src);
			
			current = "";
        });
	/* Hide subnav end */
	
	
	/* Show subnav */
	$j("#nav img.show").mouseover(function() { 
		/* Rollovers - reset then apply rollover */
		if(current != this.id){
			if(current != ""){
				src = $j("#"+current).attr("src").replace("_over", "");
				$j("#"+current).attr("src", src);
			}
			
			src = $j(this).attr("src").match(/[^\.]+/) + "_over.jpg";
			$j(this).attr("src", src);
			
			current = this.id;
		}
				
		/* Hide sub nav */
		$j("#subNavContainer").hide();
			
		/* Grab correct sub nav */
		$j("#subNav").load("includes/nav/"+this.id+".html");
			
		/* Show sub nav */
		$j("#subNavContainer").show();	
 	})
	/* Show subnav end */
		
});
