$(function(){$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'dark_rounded', title: ''});$("#calendar_prev").live("click",function(c){var b=$("#calendar_date").html();var a=b.split(" ");$("#calendar").load("/asktheagronomist/cal_ajax.php",{mon:a[0],yr:a[1],increment:"-"})});$("#calendar_next").live("click",function(c){var b=$("#calendar_date").html();var a=b.split(" ");$("#calendar").load("/asktheagronomist/cal_ajax.php",{mon:a[0],yr:a[1],increment:"+"})});$(".submit-a-comment").click(function(a){$(this).parent().nextAll(".blogComments:first").slideToggle("normal")});$(".show-comments").click(function(a){$(this).parent().nextAll(".showComments:first").slideToggle("normal")});$(".blog-form").submit(function(g){var d=$(g.target);var c=d.find(".first_name").val();var b=d.find(".last_name").val();var a=d.find(".email").val();var h=d.find(".comment").val();var f=d.find(".q").val();var e=d.find(".questions").val();if(c==""){d.find(".first_name").addClass("formCalcError");alert("You must enter a First Name");d.find(".first_name").focus();return false}else{d.find(".first_name").removeClass("formCalcError")}if(b==""){d.find(".last_name").addClass("formCalcError");alert("You must enter a Last Name");d.find(".last_name").focus();return false}else{d.find(".last_name").removeClass("formCalcError")}if(a==""){d.find(".email").addClass("formCalcError");alert("You must enter an Email");d.find(".email").focus();return false}else{d.find(".email").removeClass("formCalcError")}if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+$/.test(a)){d.find(".comment").removeClass("formCalcError")}else{d.find(".email").addClass("formCalcError");alert("Please enter a valid Email Address.");d.find(".email").focus();return false}if(h==""){d.find(".comment").addClass("formCalcError");alert("You must enter a comment");d.find(".comment").focus();return false}else{d.find(".comment").removeClass("formCalcError")}d.parent().load("proc.php",{q:f,questions:e,first_name:c,last_name:b,email:a,comment:h});g.preventDefault()})});
