$(document).ready(function(){
	
	/*
	----------------------------------------------------------
	GENERAL
	---------------------------------------------------------- */
	
	// CLEAR VALUE ON FOCUS
	$('.labelvalue').each(function() {
	    var default_value = this.value;
	    $(this).focus(function() {
	        if(this.value == default_value) {
	            this.value = '';
	        }
	    });
	    $(this).blur(function() {
	        if(this.value == '') {
	            this.value = default_value;
	        }
	    });
	});
	
	
	// EXTERNAL WINDOWS
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });



	// MAKE ENTIRE AREA CLICKABLE
	$("div.highlight").click(function(){
		if($(this).find("a").attr("rel") == "external") {
		    window.open($(this).find("a").attr("href"))
		} else{
		    window.location=$(this).find("a").attr("href"); return false;
		    return;
		}
	});
	
	
	// MONCUR LOGO ANIM
	$("#moncur a").hover(function() {
		$(this).next("span").animate({opacity: "show"}, "slow");
	}, function() {
		$(this).next("span").animate({opacity: "hide"}, "fast");
	});
	
	
	
	// BUY NOW ANIM
	$("#banner a span").hide();
	$("#banner a").hover(function() {
		$("#banner a span").animate({opacity: "show"}, "fast");
	}, function() {
		$("#banner a span").animate({opacity: "hide"}, "fast");
	});

	
	// SUBMIT BUTTON
	$("fieldset.submit input.submit").hover(function() {
		$(this).animate({ backgroundColor:"#000", color:"#ccc" }, 300);
	},function() {
		$(this).animate({ backgroundColor:"#191617", color:"#fff" }, 300);
	});
	
	
	$(".tab-content").hide(); //Hide all content
			$("ul.tabs li:first").addClass("active").show(); //Activate first tab
			$(".tab-content:first").show(); //Show first tab content

			$("div.tab-content ul li:first").addClass("first"); 


		//On Click Event
		$("ul#videos-toggle.tabs li").click(function() {

			$("ul#videos-toggle.tabs li").removeClass("active"); // Remove any "active" class
			$(this).addClass("active"); // Add "active" class to selected tab
			$(".tab-content").hide(); // Hide all tab content

			var activeTab = $(this).find("a").attr("href"); // Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn("normal"); // Fade in the active ID content
			return false;

		});
		
		
		$("#home #nav-main li:first").addClass("active"); 
		
	


	
	/*
	----------------------------------------------------------
	04. FONT REPLACEMENT
	---------------------------------------------------------- 
	Cufon.replace('#home blockquote', { fontFamily:'VistaSans' });
	Cufon.replace('h1')('h2:not(".plain")')('h3')('#home blockquote strong')('#product-info dt'); // Vista Sans Bold
	Cufon.replace('div.callout h3', { fontFamily:'VistaSans' });
	Cufon.replace('h1#header-section', { fontFamily:'VistaSans' });
	Cufon.replace('p#phone', { fontFamily:'VistaSans' });
	Cufon.replace('h3 a', { hover:true });
*/
	
	$("ul.errors").hide();

	flowplayer("a.player", "/assets/swf/flowplayer-3.2.2.swf");

	$("img[rel]").overlay({
		expose: { 
	        color: '#000',  // bg color
	        loadSpeed: 200, 
	        opacity: 0.7 
	    },

		onClose: function(content) {
			$f(0).stop();
			$f(0).unload();
			$f(1).stop();
			$f(1).unload();
		}
		
	});
	
	
	
	// Checkout sales tax
	/*
	$("#shipping-state").change(function() {
	
		if ( $("#shipping-state").val() == 'Texas' ) {
			$("#sales-tax-texas").show();
		} else {
			$("#sales-tax-texas").hide();
		}
		
	});
*/
		
});



    





