$(document).ready(function(){
	// validate signup form on keyup and submit
	$("#contactForm").validate({
		rules: {
			fm_verify: "required"
		},
		messages: {
			fm_verify: "Please enter the validation code."
		}
	});
});

$(document).ready(function(){
	$("ul#nav").superfish({
		hoverClass	: "sfHover",
		pathClass	: "overideThisToUse",
		delay		: 100,
		animation	: { opacity:"show" },
		speed		: "fast",
		oldJquery	: false, /* set to true if using jQuery version below 1.2 */
		disableHI	: false, /* set to true to disable hoverIntent detection */
		onInit		: function(){},
		onBeforeShow	: function(){},
		onShow		: function(){},
		onHide		: function(){}
	});
});

var count = 0;

$(document).ready(function(){
  $("a.addChildren").click(function() {
  	if ($(".childrenDiv").html().length<100) $(this).after("<a href=\"\" class=\"removeChildren\"> &nbsp;&nbsp;Remove dog [-]</a>");
  	if (count > 0) { 
  	  $(this).parents(".ddfm").find(".childrenDiv").append($(".hiddenChild"+count).html()).children(":last").hide().slideDown();
    }
    else {
  	  $(this).parents(".ddfm").find(".childrenDiv").append($(".hiddenChild").html()).children(":last").hide().slideDown();
    }
  	count++;
  	$("a.removeChildren").unbind();		// otherwise, gets bound multiple times
  	$("a.removeChildren").click(function() {
  	  count--;
  		$("a.removeChildren").parents(".ddfm").find(".childrenDiv").children(":last").slideUp(function() { 
  			$(this).remove();
  			if ($(".childrenDiv").html().length<100) { $(".childrenDiv").html(""); $("a.removeChildren").remove(); }	// sort of a hack
  		});
  		return false
  	});
  	return false
  });
});