var	slidePosition =''
var whichOne=''
$(document).ready(function() {
//special for code for Whaley 

$("#moreComments").hide();
$("#readMore").click(function(){
	$("#moreComments").slideDown(1500); 
	$("#readMore").hide();
	return false;
})

//Get the url to track the from
$("#whichBlog").val(location.href);
	$("a.comment").click(function(){
				  //store which link was clicked
				  linkID=this.name
				//if the form is visible and the same link was clicked
				//simply hide the form--this is a toggle
				if(slidePosition=='down' & whichOne==linkID){
					  $("#commentForm").slideUp("slow",function(){
													slideNotice('up')
												});
						  return false;
						  }
				//if the form is visible, but another link was clicked
				//move the form to the new link
				if(slidePosition=='down' & whichOne!=linkID){
					$("#commentForm").toggle();
					//clear out the form
						document.getElementById("CommenterName").value=""
						document.getElementById("CommentField").value=""
					  $("#"+linkID+"").after($("#commentForm"));
					  $("#commentForm").slideDown("slow",function(){
							  slideNotice('down', linkID)
								  });
					  $("#postCommentingOn").val(this.name);
					   //don't let the link opperate
					   return false;
					   }
					//first click, no form is visible, so we show it
					else{
					//clear out the form
					document.getElementById("CommenterName").value=""
					document.getElementById("CommentField").value=""
				  $("#"+linkID+"").after($("#commentForm"));
				  $("#commentForm").slideDown("slow",function(){
											  slideNotice('down', linkID)
												  });
					  $("#postCommentingOn").val(this.name);
					   //don't let the link opperate
					   return false;
					   }});
	$("#form1").validate({
						 rules: {
							 CommenterName: "required",
							 CommentField: "required"
						  },
						  messages:{
							 CommenterName: " please provide",
							 CommentField: " !"
							  }
						});
});
function slideNotice(position, which){
	slidePosition = position
	whichOne = which
	}
