function jokeRatedGood() {
	var jokeTitle = document.getElementById("hidden-var").innerHTML;
	var ajaxRequest;
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser does not support AJAX.");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxValue = ajaxRequest.responseText;
			
			document.getElementById("joke-rater").innerHTML = "<p class='rater-sign'>" + ajaxValue + "</p>";
			
		}
	}
	ajaxRequest.open("GET", "scripts/php/rateSystem.php?r=good&q=" + jokeTitle, true);
	ajaxRequest.send(null); 
}
function jokeRatedBad() {
	var jokeTitle = document.getElementById("hidden-var").innerHTML;
	var ajaxRequest;
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser does not support AJAX.");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxValue = ajaxRequest.responseText;
			
			document.getElementById("joke-rater").innerHTML = "<p class='rater-sign'>" + ajaxValue + "</p>";
			
		}
	}
	ajaxRequest.open("GET", "scripts/php/rateSystem.php?r=bad&q=" + jokeTitle, true);
	ajaxRequest.send(null); 
}

$(document).ready(function(){
	$("#D1").focus(function() {
		if($(this).attr("value") == "D") $(this).attr("value", "");
	});
	$("#D2").focus(function() {
		if($(this).attr("value") == "D") $(this).attr("value", "");
	});
	$("#M1").focus(function() {
		if($(this).attr("value") == "M") $(this).attr("value", "");
	});
	$("#M2").focus(function() {
		if($(this).attr("value") == "M") $(this).attr("value", "");
	});
	$("#Y1").focus(function() {
		if($(this).attr("value") == "Y") $(this).attr("value", "");
	});
	$("#Y2").focus(function() {
		if($(this).attr("value") == "Y") $(this).attr("value", "");
	});
	$("#Y3").focus(function() {
		if($(this).attr("value") == "Y") $(this).attr("value", "");
	});
	$("#Y4").focus(function() {
		if($(this).attr("value") == "Y") $(this).attr("value", "");
	});
});

function CD1() {
	$("#D1").blur();
	$("#D2").focus();
}
function CD2() {
	$("#D2").blur();
	$("#M1").focus();
}
function CM1() {
	$("#M1").blur();
	$("#M2").focus();
}
function CM2() {
	$("#M2").blur();
	$("#Y1").focus();
}
function CY1() {
	$("#Y1").blur();
	$("#Y2").focus();
}
function CY2() {
	$("#Y2").blur();
	$("#Y3").focus();
}
function CY3() {
	$("#Y3").blur();
	$("#Y4").focus();
}




            
$(document).ready(function() {
	$('#social-rss').hover(function() {
		$('#social-arrow').stop().animate({ "marginLeft": 133 }, function(){
																	$('.social-text-p').text("Help us grow by submitting this page to StumbleUpon.");
																});		
	}, function() {
		$('#social-arrow').stop().animate({ "marginLeft": 0 }, function(){
																	$('.social-text-p').text("Join our mailing list now and receive the best daily jokes every week!");
																});
	});
	$('#social-twitter').hover(function() {
		$('#social-arrow').stop().animate({ "marginLeft": 266 }, function(){
																	$('.social-text-p').text("Follow Us On Twitter.");
																});
	}, function() {
		$('#social-arrow').stop().animate({ "marginLeft": 0 }, function(){
																	$('.social-text-p').text("Join our mailing list now and receive the best daily jokes every week!");
																});
	});
	$('#social-fb').hover(function() {
		$('#social-arrow').stop().animate({ "marginLeft": 398 }, function(){
																	$('.social-text-p').text("Become a fan of us on FaceBook and help spread the humour.");
																});

	}, function() {
		$('#social-arrow').stop().animate({ "marginLeft": 0 }, function(){
																	$('.social-text-p').text("Join our mailing list now and receive the best daily jokes every week!");
																});
	});
	$('#social-digg').hover(function() {
		$('#social-arrow').stop().animate({ "marginLeft": 528 }, function(){
																	$('.social-text-p').text("Help us grow by submitting this page to Digg.");
																});
	}, function() {
		$('#social-arrow').stop().animate({ "marginLeft": 0 }, function(){
																	$('.social-text-p').text("Join our mailing list now and receive the best daily jokes every week!");
																});
	});
	
});       

