// JavaScript Document

/*$.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });*/

//for ajax form: http://jquery.malsup.com/form/#getting-started



$(function(){
		
		$("#comment_form").css("display", "none");
		
		var formbox = false;
		
		$('.comics_comment_section').append('<span id="expandCommentForm">&darr; <a href="#expandCommentForm">Leave a comment</a> &darr;</span>');
		
		$('#expandCommentForm').click(function() {
				  if(!formbox){
					  $("#reply_ref").attr('value', 0);
					  $('#commentFormTitle').text('Leaving a comment');
					  $("#comment_form").slideDown('slow');
					  $('#expandCommentForm').html('&uarr; <a href="#expandCommentForm"> Hide comment box</a> &uarr;');
					  formbox = true;
				  }
				  else {
					  $("#comment_form").slideUp('slow');
					  $('#expandCommentForm').html('&darr; <a href="#expandCommentForm">Leave a comment</a> &darr;');
					  formbox = false;
					 
				  }
			});
		 
		 
		 $('.replyLink').click(function(){
											newid = $(this).attr('id');
											if(formbox){
												$("#comment_form").slideUp('medium');
											}
											$("#reply_ref").attr('value', newid);
											$('#expandCommentForm').html('&uarr; <a href="#expandCommentForm"> Hide comment box</a> &uarr;');
											formbox = true;
											$('#commentFormTitle').text('Leaving a reply to a comment');
											$("#comment_form").slideDown('medium');
											return false
										});
});  
