

$(document).ready(function(){
	jQuery(function(){
		jQuery('ul.sf-menu').superfish();
	});
	$.fn.search = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
			}
		});
	};
	$("input[type=text]").search();
	
	
	$(".catagory").click(function(){
		$(this).next().toggleClass("active");
		$(this).toggleClass("open");
	});
	
	// Facts Revolver
	$(".facts span").quovolver();
	$(".testimonials blockquote").quovolver();
	//$('marquee').marquee();

	// Homepage Feature Navigation
	// Hide all sub-nav
	$(".subs").hide();
	
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
		return this.animate({opacity: 'toggle'}, speed, easing, callback);
	};
    
	$(".home .subnav a.btn").mouseover(function () {
		$(".subs").hide();
		$(".open").removeClass("open");
		$(this).next().fadeToggle();
		$(this).addClass("open");
    }); 

	$("#sub1").mouseleave(function(){ $("#sub1").fadeOut(); });
	$("#sub2").mouseleave(function(){ $("#sub2").fadeOut(); });
	$("#sub3").mouseleave(function(){ $("#sub3").fadeOut(); });
	$("#sub4").mouseleave(function(){ $("#sub4").fadeOut(); });
	$("#sub5").mouseleave(function(){ $("#sub5").fadeOut(); });
	$("#sub6").mouseleave(function(){ $("#sub6").fadeOut(); });
	
	$(".seemore").click(function(){ 
								 $(".more").hide();
								 $(this).next().slideDown("slow"); 
								 });
	$(".showless").click(function(){ 
								
								 $(this).parent().slideUp("slow"); 
								 });
	
});