$(function () {
	$('#content #rail h4').hover(
		function() {
			$(this).addClass("over");
			},
		
		function () {
			$(this).removeClass("over");
			}
		);
			
	$('article h1').hover(
		function() {
			if(!$(this).hasClass("nolink")) {
				$(this).addClass("over");
				}
			},
		function () {
			$(this).removeClass("over");
			}	
		);
		
	$("#comments-form").submit(function () { return false; });
	$('#comments-form').append('<input type="button" onclick="submitComment();" accesskey="s" name="post" id="comment-submit" value="Submit" />'); 
	
	});
	

function submitComment() {
	d = $('#comments-form').serialize();
	$('#comment-status').html('<img src="/includes/images/loader_bar_blue.gif" alt="Please wait..." />');
	$('#comment-preview').fadeOut();
	$('#comments-form').fadeOut();
	
	$.ajax({
		type:"POST",
		data: d,
		url: "/news/cms/proxy.php",
		success: function(msg) {
			$('#comment-status').html(msg);
			if(msg.search(/failed/) > 0) {
				$('#comment-preview').fadeIn();
				$('#comments-form').fadeIn();
				}
			}
		});
	}