$(document).ready(function(){


	jQuery(".orderpage-notice-content").hide();
	jQuery(".orderpage-notice-toggle").each(function() {
		$(this).hover (
			function() {
				$(this).addClass("orderpage-notice-toggle-hover");
			}, 
			function () {
				$(this).removeClass("orderpage-notice-toggle-hover");
			}	
		);
	});
	jQuery(".orderpage-notice-toggle").toggle(
      function () {
        $(this).addClass("off");
        $(".orderpage-notice-content").slideDown(500);
      },
      function () {
      	$(this).removeClass("off");
        $(".orderpage-notice-content").slideUp(500);
      }
    );
    
    
    jQuery("#orderpage-callout").each(function() {
		$(this).hover (
			function() {
				$(this).addClass("orderpage-callout-hover");
				status=$(this).find("a").attr("href");
			}, 
			function () {
				$(this).removeClass("orderpage-callout-hover");
				status="";
			}	
		);
		$(this).click(function() {
			location = $(this).find("a").attr("href");
		});
	});
	
	
// subscribe page: form validation	
	$("#mc-embedded-subscribe-form").validate();
	

	
	
// subscribe page: date auto-fill
	$('#mce-BIRTHDAY-month').autofill({
		value: 'MM'
	});	
	$('#mce-BIRTHDAY-day').autofill({
		value: 'DD'
	});		
	$('#mce-BIRTHDAY-year').autofill({
		value: 'YYYY'
	});
	
// subscribe page: location input reminder 	
	$(".msg").hide();	
	$("#mce-NAME, #mce-EMAIL, #mce-ZIP, #mce-BIRTHDAY-month, #mce-BIRTHDAY-day, #mce-BIRTHDAY-year, #mce-LOCATION").bind("click focus", function(){
	var favlocation = $("#mce-LOCATION").val();
		if(favlocation == '') {
        	$("#locationmsg").show("fast");
		} else  { 
			$("#locationmsg").hide();
		}
	});
	
// order2 page: after user clicks "submit order" button display message
	 $("#msg").hide();
	 $("#msg").prepend('<span><a class="buy-msg" href="#"></a></span>');
	 $("input[name='checkout_done']").click(function() {
		$("#msg a.buy-msg").colorbox({width:"400px", inline:true, href:"#buy-msg"});
	 	$("#msg a.buy-msg").trigger('click');
	});
	
	


});