$(document).ready(function(){
	$("form.opt_in input.opt_in_button").click(function() {
		var opt_in = $('form.opt_in input[name="opt_in"]').val();
		if ((opt_in == "") || (opt_in == "Enter Your Email")) {
			alert("Please enter a valid email address");
		}
		else {
			var dataString = "opt_in=" + opt_in + "&opt_in_submitted=1";
			$.ajax({
		  		type: "POST",
		  		url: "../email-signup.php",
		  		data: dataString,
		  		success: function(response) {
		  			$('form.opt_in input[name="opt_in"]').val("Enter Your Email");
		      		alert("Thank you for signing up! You will be receiving a confirmation email shortly.");
		  		}
			});
		}
		return false;
	});
});

$(document).ready(function(){
	$("a.marketplace").click(function(event){
		if (confirm("You are now leaving the Mrs. Cubbison's website. Please click OK to go to our partner site."))
			window.open('http://traderbob.com/generalstore/index.php?cPath=1_16','_blank');
		return false;
	});
});

$(document).ready(function(){
	$(".buy_product").click(function(event){
		if (confirm("You are now leaving the Mrs. Cubbison's website. Please click OK to go to our partner site."))
			window.open('http://traderbob.com/generalstore/index.php?cPath=1_16','_blank');
		return false;
	});
});

$(document).ready(function() {
	$('a.print').click(
		function() {
			window.print();
		});
});

$(document).ready(function() {
	$('form.search input.text_field').click(
		function() {
			if (this.value == this.defaultValue) {
				this.value = '';
			}
		});
	$('form.search input.text_field').blur(
		function() {
			if (this.value == '') {
				this.value = this.defaultValue;
			}
		}
	);
	
	$('form.opt_in input.text_field').click(
			function() {
				if (this.value == this.defaultValue) {
					this.value = '';
				}
			});
	$('form.opt_in input.text_field').blur(
		function() {
			if (this.value == '') {
				this.value = this.defaultValue;
			}
		}
	);
});

$(document).ready(function() {
	$('div.store_locator input.zip_code').click(
		function() {
			if (this.value == this.defaultValue) {
				this.value = '';
			}
		});
	$('div.store_locator input.zip_code').blur(
		function() {
			if (this.value == '') {
				this.value = this.defaultValue;
			}
		}
	);
});

$(document).ready(function() {
	$('form.contact_us input').click(
		function() {
			if (this.value == '') {
				this.value = '';
			}
		});
	$('form.contact_us input').blur(
		function() {
			if (this.value == '') {
				this.value = this.defaultValue;
			}
		}
	);
	
	$('form.contact_us textarea').click(
			function() {
				if (this.value == '') {
					this.value = '';
				}
			});
		$('form.contact_us textarea').blur(
			function() {
				if (this.value == '') {
					this.value = this.defaultValue;
				}
			}
		);
});

$(document).ready(function() {
	//On Hover Over
	function megaHoverOver(){
	    $(this).find("div.submenu").stop().fadeTo(300, 1).show(); //Find sub and fade it in
	}
	//On Hover Out
	function megaHoverOut(){
	  $(this).find("div.submenu").stop().fadeTo(200, 0, function() { //Fade to 0 opactiy
	      $(this).hide();  //after fading, hide it
	  });
	}
	
	//Set custom configurations
	var config = {
	     sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
	     interval: 15, // number = milliseconds for onMouseOver polling interval
	     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
	     timeout: 0, // number = milliseconds delay before onMouseOut
	     out: megaHoverOut // function = onMouseOut callback (REQUIRED)
	};

	//$("ul.main li div.submenu").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
	$("ul.main li").hoverIntent(config); //Trigger Hover intent with custom configurations
});

$(document).ready(function(){
	$('div.recipe').hover(function() { 
	    $(this).find('img.recipe_photo:first').stop().animate({"opacity": .5}); 
	},function() { 
		$(this).find('img.recipe_photo:first').stop().animate({"opacity": 1}); 
	});
});

$(document).ready(function(){
	$('a.fat_free').hover(function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_fat_free_seasoned_croutons.png");}, function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_fat_free_seasoned_croutons.png");
	});
	$('a.cheese_garlic').hover(function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_cheese_garlic_croutons.png");}, function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_cheese_garlic_croutons.png");
	});
	$('a.caesar_salad').hover(function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_caesar_salad_croutons.png");}, function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_caesar_salad_croutons.png");
	});
	$('a.butter_garlic').hover(function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_butter_garlic_croutons.png");}, function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_butter_garlic_croutons.png");
	});
	$('a.classic_seasoned').hover(function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_classic_seasoned_croutons.png");}, function() {
	    $('div.wrapper.products div.one img').attr("src","../images/products_classic_seasoned_croutons.png");
	});
	
	$('div.content.subpage.stuffing a.classic-seasoned').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_classic_seasoned_dressing.jpg");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_classic_seasoned_dressing.jpg");
	});
	$('div.content.subpage.stuffing a.seasoned-cornbread').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_seasoned_corn_bread_stuffing.jpg");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_seasoned_corn_bread_stuffing.jpg");
	});
	$('div.content.subpage.stuffing a.herb-seasoned').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_herb_seasoned_cube_stuffing.jpg");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_herb_seasoned_cube_stuffing.jpg");
	});
	$('div.content.subpage.stuffing a.multi-grain-stuffing').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_multi-grain-stuffing-cranberries.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_multi-grain-stuffing-cranberries.png");
	});
	
	$('div.content.subpage.texas_toast_croutons a.seasoned_texas_toast_croutons').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/product_seasoned_texas_toast_croutons.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/product_seasoned_texas_toast_croutons.png");
	});
	$('div.content.subpage.texas_toast_croutons a.butter_garlic_texas_toast_croutons').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_butter_garlic_texas_toast_croutons.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_butter_garlic_texas_toast_croutons.png");
	});
	$('div.content.subpage.artisan_croutons a.asiago_cheese_ciabatta_croutons').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_asiago_cheese_ciabatta_croutons.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_asiago_cheese_ciabatta_croutons.png");
	});
	$('div.content.subpage.artisan_croutons a.tuscan_herb_focaccia_croutons').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_tuscan_herb_focaccia_croutons.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_tuscan_herb_focaccia_croutons.png");
	});
	$('div.content.subpage.artisan_croutons a.basil_pesto_panini_croutons').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_basil_pesto_panini_croutons.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_basil_pesto_panini_croutons.png");
	});
	$('div.content.subpage.tortilla_strips a.southwest_flavor_tortilla_strips').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_southwest_flavor_tortilla_strips.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_southwest_flavor_tortilla_strips.png");
	});
	$('div.content.subpage.tortilla_strips a.red_pepper_jalapeno_tortilla_strips').hover(function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_red_pepper_jalapeno_tortilla_strips.png");}, function() {
		$('div.wrapper.products div.one img').attr("src","../images/products_red_pepper_jalapeno_tortilla_strips.png");
	});
});


$(document).ready(function(){
	var originalContent =  $('div.tooltip').html();
	$('ul.products_thumbnail a.fat_free').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Fat Free Seasoned Croutons</h3><p>A healthy choice that’s sprinkled with Romano, Parmesan and cheddar cheeses along with a touch of garlic.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('ul.products_thumbnail a.fat_free').hover(function() {
	     $('ul.products_thumbnail li.fat_free span').stop().animate({"opacity": 1}, 500);   
	}, function() {
	     $('ul.products_thumbnail li.fat_free span').stop().animate({"opacity": 0}, 150); 
	});
	$('ul.products_thumbnail a.cheese_garlic').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Cheese &#38; Garlic Croutons</h3><p>These croutons are seasoned with garlic and then sprinkled with Romano and Parmesan cheeses.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('ul.products_thumbnail a.cheese_garlic').hover(function() {
	     $('ul.products_thumbnail li.cheese_garlic  span').stop().animate({"opacity": 1}, 500);   
	}, function() {
	     $('ul.products_thumbnail li.cheese_garlic  span').stop().animate({"opacity": 0}, 150); 
	});
	$('ul.products_thumbnail a.caesar_salad').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Caesar Salad Croutons</h3><p>Croutons sprinkled with Romano and bleu cheeses, as well as garlic and onions.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('ul.products_thumbnail a.caesar_salad').hover(function() {
	     $('ul.products_thumbnail li.caesar_salad  span').stop().animate({"opacity": 1}, 500);   
	}, function() {
	     $('ul.products_thumbnail li.caesar_salad  span').stop().animate({"opacity": 0}, 150); 
	});
	$('ul.products_thumbnail a.butter_garlic').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Butter &#38; Garlic Croutons</h3><p>A tasty crouton that’s lightly seasoned with garlic, onions and butter.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('ul.products_thumbnail a.butter_garlic').hover(function() {
	     $('ul.products_thumbnail li.butter_garlic  span').stop().animate({"opacity": 1}, 500);   
	}, function() {
	     $('ul.products_thumbnail li.butter_garlic  span').stop().animate({"opacity": 0}, 150); 
	});
	$('ul.products_thumbnail a.classic_seasoned').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Classic Seasoned Croutons</h3><p>A classic-tasting crouton that’s sprinkled with Romano and Parmesan cheeses, garlic, and other delicious spices.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('ul.products_thumbnail a.classic_seasoned').hover(function() {
	     $('ul.products_thumbnail li.classic_seasoned  span').stop().animate({"opacity": 1}, 500);   
	}, function() {
	     $('ul.products_thumbnail li.classic_seasoned  span').stop().animate({"opacity": 0}, 150); 
	});
	
	$('div.content.subpage.stuffing a.classic-seasoned').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Classic Seasoned Dressing</h3><p>A Classic American holiday dressing with all the right seasonings.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.stuffing a.seasoned-cornbread').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Seasoned Cornbread Stuffing</h3><p>A cornbread variation of a classic holiday stuffing treat.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.stuffing a.herb-seasoned').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Herb Seasoned Cube Stuffing</h3><p>This is for those who like the Classic Seasoned Dressing but prefer a "cube style" stuffing.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.stuffing a.multi-grain-stuffing').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Multi-Grain Stuffing with Cranberries</h3><p>A sophisticated all-natural multigrain stuffing option that has delicious dried cranberries.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	
	$('div.content.subpage.crispy_onions a.crispy_onions').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Crispy Onions</h3><p>These crispy onions are a creative way to top off your favorite dishes with a flavor you have to taste to believe.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	
	$('div.content.subpage.texas_toast_croutons a.seasoned_texas_toast_croutons').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Seasoned Texas Toast Croutons</h3><p>Extra-large tender-bite croutons, seasoned for a classic American flavor.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.texas_toast_croutons a.butter_garlic_texas_toast_croutons').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Butter & Garlic Texas Toast Croutons</h3><p>Extra-large tender-bite croutons, topped with real cheddar cheese and garlic.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	
	$('div.content.subpage.artisan_croutons a.asiago_cheese_ciabatta_croutons').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Asiago Cheese Ciabatta Croutons</h3><p>Toasted ciabatta croutons with aged Italian cheese.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.artisan_croutons a.tuscan_herb_focaccia_croutons').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Tuscan Herb Focaccia Croutons</h3><p>Toasted focaccia croutons seasoned with rosemary, basil, and sun-dried tomatoes.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.artisan_croutons a.basil_pesto_panini_croutons').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Basil Pesto Panini Croutons</h3><p>Toasted panini croutons seasoned with basil, pine nuts, sea salt, and olive oil.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	
	$('div.content.subpage.wonton_strips a.soy_ginger_wonton_strips').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Soy Ginger Wonton Strips</h3><p>Crispy wonton strips full of the robust flavor of soy and tangy ginger.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.tortilla_strips a.southwest_flavor_tortilla_strips').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Southwest Flavor Tortilla Strips</h3><p>Tortilla strips infused with real onion, red pepper, and Southwestern spices.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
	$('div.content.subpage.tortilla_strips a.red_pepper_jalapeno_tortilla_strips').hover(function() {
	     $('div.tooltip').stop().animate({"opacity": 1}, 500).html('<h3>Red Pepper & Jalape&#241;o Tortilla Strips</h3><p>Tortilla strips made with fresh red peppers and real jalape&#241;os.</p>');   
	}, function() {
	     $('div.tooltip').stop().animate({"opacity": 0}, 150).html(originalContent); 
	});
});








