// JavaScript Document

	$(document).ready(function() {		
			
		var options = {
			target: '#main_content',
			cache: false
		};
		
		$("#left_nav ul li:not('.lnGradientTop','#lnChooseMore')").click(function(){
			if ($(this).children("input:checkbox").attr("checked")){
				if ($(this).attr("class") === "size_listings"){
					$(this).attr("style", "background-image: url(/images/ln_checkbox_xl_off.gif)")
				}
				else{
				 $(this).children("img").attr("src", "/images/ln_checkbox_off.gif");
				}
				 $(this).children("input:checkbox").attr("checked", "");
				 $("#lnForm").ajaxSubmit(options);
			}
			else{
				if ($(this).attr("class") === "size_listings"){
					$(this).attr("style", "background-image: url(/images/ln_checkbox_xl_on.gif)")
				}
				else{
				 $(this).children("img").attr("src", "/images/ln_checkbox_on.gif");
				}
				 $(this).children("input:checkbox").attr("checked", "checked");
				 $("#lnForm").ajaxSubmit(options);
			}
		});
				
				
		// for the view more button on the left nav
		$("#lnChooseMore").click(function(){
					$(this).siblings("li:not('.lnGradientTop')").removeClass();
					$(this).hide();
			});
		// end view more button on left nav
		// end new left nav on the category page
		
	// for the menu dropdowns
		function menuHoverOver(){
			$(this).children("div:has(div)").animate({height: "show", width: "show"}, 5);		
		}
		
		function menuHoverOut(){
				$(this).children("div:has(div)").animate({height: "hide", width: "hide"}, 5);
		}
		var config = {    
				 sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
				 interval: 200, // number = milliseconds for onMouseOver polling interval    
				 over: menuHoverOver, // function = onMouseOver callback (REQUIRED)    
				 timeout: 1000, // number = milliseconds delay before onMouseOut    
				 out: menuHoverOut // function = onMouseOut callback (REQUIRED)    
		};
		$("ul#header-nav2 li:has(div)").hoverIntent(config);
		// end menu dropdowns
		
	});
	

