jQuery(document).ready(function() { //products menu
	var productsConfig = {   
		sensitivity: 3,  // number = sensitivity threshold (must be 1 or higher) 
    	over: openDropProducts, // function = onMouseOver callback (REQUIRED)    
    	timeout: 400, // number = milliseconds delay before onMouseOut    
    	out: closeDropProducts // function = onMouseOut callback (REQUIRED)    
	};
	
	var manuConfig = {   
		sensitivity: 3,  // number = sensitivity threshold (must be 1 or higher) 
    	over: openDropManu, // function = onMouseOver callback (REQUIRED)    
    	timeout: 400, // number = milliseconds delay before onMouseOut    
    	out: closeDropManu // function = onMouseOut callback (REQUIRED)    
	};
	
	jQuery('#header_products').hoverIntent(productsConfig);
	jQuery('#header_manufacturers').hoverIntent(manuConfig);
	
	jQuery('ul#products.dropdown li a').mouseover(function () {
		jQuery(this).stop().animate({ paddingLeft: "23px" }, 100 );
	});

	jQuery('ul#products.dropdown li a').mouseout(function () {
		jQuery(this).stop().animate({ paddingLeft: "13px" }, 250 );
	});
});


jQuery(document).ready(function() { //search box
	jQuery('#nav_search').focus(function(){  
		if(jQuery(this).attr("value") == "search") jQuery(this).attr("value", "");  
	});  
	jQuery('#nav_search').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "search");  
	});
});

jQuery(document).ready(function() { //Questions Form
	jQuery('#sidetabContent input[name="name"]').focus(function(){  
		if(jQuery(this).attr("value") == "Name") jQuery(this).attr("value", "");
	});
	jQuery('#sidetabContent input[name="name"]').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "Name");  
	});
	
	jQuery('#sidetabContent input[name="company"]').focus(function(){  
		if(jQuery(this).attr("value") == "Company") jQuery(this).attr("value", "");
	});
	jQuery('#sidetabContent input[name="company"]').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "Company");  
	});
	
	jQuery('#sidetabContent input[name="phone"]').focus(function(){  
		if(jQuery(this).attr("value") == "Phone Number") jQuery(this).attr("value", "");
	});
	jQuery('#sidetabContent input[name="phone"]').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "Phone Number");  
	});
	
	jQuery('#sidetabContent input[name="email"]').focus(function(){  
		if(jQuery(this).attr("value") == "Email Address") jQuery(this).attr("value", "");
	});
	jQuery('#sidetabContent input[name="email"]').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "Email Address");  
	});
	
	jQuery('#sidetabContent textarea[name="message"]').focus(function(){  
		if(jQuery(this).attr("value") == "How Can We Help You?") jQuery(this).attr("value", "");
	});
	jQuery('#sidetabContent textarea[name="message"]').blur(function(){  
    	if(jQuery(this).attr("value") == "") jQuery(this).attr("value", "How Can We Help You?");  
	});
	
	jQuery('#form_clear').click(function() {
		jQuery('#sidetabContent input[name="name"]').attr("value", "Name");
		jQuery('#sidetabContent input[name="company"]').attr("value", "Company");  
		jQuery('#sidetabContent input[name="phone"]').attr("value", "Phone Number");  
		jQuery('#sidetabContent input[name="email"]').attr("value", "Email Address");  
		jQuery('#sidetabContent textarea[name="message"]').attr("value", "How Can We Help You?");  
	});
});

function openDropProducts() {
	jQuery('#products.dropdown').stop(true,true).slideDown(500);
	jQuery('#header_nav #header_products').css('background-position','0 0');
}

function closeDropProducts() {
	jQuery('#products.dropdown').stop(true,true).fadeOut(250);
	jQuery('#header_nav #header_products').css('background-position','0 -30px');
}

function openDropManu() {
	jQuery('#manufacturers.dropdown').stop(true,true).slideDown(1250);
	jQuery('#header_nav #header_manufacturers').css('background-position','-92px 0');
}
function closeDropManu() {
	jQuery('#manufacturers.dropdown').stop(true,true).fadeOut(250);
	jQuery('#header_nav #header_manufacturers').css('background-position','-92px -30px');
}


jQuery(document).ready(function() {
	jQuery('#sidetabButton').click(function() {
		if (jQuery('#blackness').css('opacity')<.7){
			jQuery('#blackness').css('display','block');
			jQuery('#blackness').stop().animate({ opacity: ".7" }, 500);
		}
		else {
			jQuery('#blackness').stop().animate({ opacity: "0" }, 500, function() {
				jQuery('#blackness').css('display','none');
			});
		}
    	var jQuerylefty = jQuery('#sidetab');
        jQuerylefty.animate({
        	left: parseInt(jQuerylefty.css('left'),10) == 0 ? (-jQuerylefty.outerWidth()+50) : 0
        }, 500);
    });
    
    jQuery('.product_gallery_button').click(function() {
   	 if (jQuery(this).siblings('.product_container').children('.product_gallery').is(':hidden')){
			jQuery(this).siblings('.product_container').children('.product_gallery').slideDown(250);
		}
		else {
			jQuery(this).siblings('.product_container').children('.product_gallery').slideUp(250);
		}
		
		
    });
    
    jQuery('#blackness').click(function() {
    	if (jQuery('#blackness').css('opacity')==.7){
    		jQuery('#blackness').stop().animate({ opacity: "0" }, 500, function() {
				jQuery('#blackness').css('display','none');
			});
			var jQuerylefty = jQuery('#sidetab');
        	jQuerylefty.animate({
        		left: parseInt(jQuerylefty.css('left'),10) == 0 ? (-jQuerylefty.outerWidth()+50) : 0
        	}, 500);
        }
    });
});




jQuery(document).ready(function(){
	jQuery('ul#sitemap_list li ul li a').click(function(e) {
    	e.preventDefault();
	});
});


