// JavaScript Document

function submitacomment() {
		if ($('#txtName').val() == "" || $('#txtEmail').val() == "" || $('#txtComment').val() == "")  {
			if ($('#commentError').text().length == 17) {
			$('#commentError').append('<span>Please enter all fields</span>');}
			}
		else {
	$('.commentSubmitButton').css({'display': 'none'});
	$('.ajaxLoading').css({'display': 'block'});
	setTimeout("postcomment()",300);
	}}
	
function postcomment() {
		$('#commentFields').load('/magazine/ajaxfunctions/commenting.asp', {
                    'action': 'Submit',
                    'storyid': $('#storyid').val(),
                    'storyurl': $('#storyurl').val(),
                    'name': $('#txtName').val(),
                    'email': $('#txtEmail').val(),
                    'comment': $('#txtComment').val(),
                    'receiveUpdates': $('#receiveUpdates').attr('checked')
                }, function() {
					
                });
				return false;
	}
	
function makrerecommendation(comID) {
	$('#rec'+comID).load('/magazine/ajaxfunctions/commenting.asp', {
                    'action': 'Recommend',
                    'CommentID': comID
                }, function() {
					
                });
				return false;
	}
	
function recommendStory(sID) {
	$('.recommend_link').load('/magazine/ajaxfunctions/commenting.asp', {
                    'action': 'RecommendStory',
                    'StoryID': sID
                }, function() {
					
                });
				return false;
	}
