$(document).ready(function(){
	
	// Tabs
	$(function() {
		$( "#tabs" ).tabs();
	});
	
	// Product Filter
	$("#tabs_products > #cat_selector > li").click(function(e) {
		$("#tabs_products > #cat_selector > li").removeClass("active");
		$("#product_list > .item").fadeIn();
	    $(this).addClass("active");
		e.preventDefault();
		var currentCat = $(this).attr("id");
		if( currentCat == "all"){
			$("#product_list > .item").removeClass("hide");
		}else{
			$("#product_list > .item").addClass("hide");
			$("#product_list > .item." + currentCat).removeClass("hide");
		};
	});
	
	//International Shipping
	$("#shipping_locale").change(function() {
		var ship_usa = $("#shipping_locale > #usa").val();
		var ship_int = $("#shipping_locale > #int").val();
		if($("#shipping_locale :selected").text() == "United States") {
			$(".add_cart > #paypal_ship").val(ship_usa);
			$("#add_cart_button").removeAttr("disabled");
			$("#add_cart_button").removeClass("disabled");
		};
		if($("#shipping_locale :selected").text() == "International") {
			$(".add_cart > #paypal_ship").val(ship_int);
			$("#add_cart_button").removeAttr("disabled");
			$("#add_cart_button").removeClass("disabled");
		};
		if($("#shipping_locale :selected").text() == "Select your shipping location...") {
			$("#add_cart_button").attr("disabled", "disabled");
			$("#add_cart_button").addClass("disabled");
		};
	});
	
	//Searchbox
	$("#access_bar #keywords").focus(function() {
		if( $(this).val() == "Search" ) {
			$(this).val("");
		};
	});
	$("#access_bar #keywords").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Search");
	    };
	});

	//Mailing List
	$("#mc_embed_signup #mce-EMAIL").focus(function() {
		if( $(this).val() == "Your Email" ) {
			$(this).val("");
		};
	});
	$("#mc_embed_signup #mce-EMAIL").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Your Email");
	    };
	});
	
	//Forms
	$("#contact_form #name").focus(function() {
		if( $(this).val() == "Your Name..." ) {
			$(this).val("");
		};
	});
	$("#contact_form #name").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Your Name...");
	    };
	});
	$("#contact_form #from").focus(function() {
		if( $(this).val() == "Your Email..." ) {
			$(this).val("");
		};
	});
	$("#contact_form #from").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Your Email...");
	    };
	});
	$("#contact_form #message").focus(function() {
		if( $(this).val() == "Type your message here..." ) {
			$(this).val("");
		};
	});
	$("#contact_form #message").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Type your message here...");
	    };
	});
	$("#contact_form #phone").focus(function() {
		if( $(this).val() == "Your Phone Number..." ) {
			$(this).val("");
		};
	});
	$("#contact_form #phone").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Your Phone Number...");
	    };
	});
	$("#contact_form #location").focus(function() {
		if( $(this).val() == "Your Location..." ) {
			$(this).val("");
		};
	});
	$("#contact_form #location").blur(function() {
	    if( $(this).val() == "" ) {
	      $(this).val("Your Location...");
	    };
	});
	
	//Fancybox
	$("a#single_image").fancybox();

	/* Using custom settings */

	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */

	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'easingIn'		: 	'swing',
		'easingOut'		: 	'swing',
		'speedIn'		:	300, 
		'speedOut'		:	200,
		'overlayShow'	:	true,
		'overlayColor'	:	'#000',
		'centerOnScroll': 	'true',
		'overlayOpacity':	.7,
		'titleShow'		: 	'true',
		'titlePosition'	: 	'inside'
	});

	//Cycle
	$('#promo_home').cycle({
		timeout: 8000,
		speed:  800,
		sync: 1,
		pause: 1
	});
 });3
