/* dfc2.js */
/* Version: 2.0 - 20091025 */
$(document).ready(function(){
	//Clear header search when clicked
	$("#s").click(function(){
		$check = $("#s").val();
		if($check == "Search"){
			$("#s").val("");	
		}
	}).blur(function(){
		$check = $("#s").val();
		if($check == ""){
			$("#s").val("Search");	
		}
	});
	
	//Show series hover info
	$(".seriesInfoLink").bind("mouseenter", function() {
		$("#seriesInfo-"+this.id).fadeIn(200);
	}).bind("mouseleave", function(){
		$("#seriesInfo-"+this.id).fadeOut(400);
	});
	
	//Clear Comment forms when clicked
	$("#author").click(function(){
		$check = $("#author").val();
		if($check == "Name"){
			$("#author").val("");	
		}
	}).blur(function(){
		$check = $("#author").val();
		if($check == ""){
			$("#author").val("Name");	
		}
	});
	$("#email").click(function(){
		$check = $("#email").val();
		if($check == "Email (not shown)"){
			$("#email").val("");	
		}
	}).blur(function(){
		$check = $("#email").val();
		if($check == ""){
			$("#email").val("Email (not shown)");	
		}
	});
	$("#comment").click(function(){
		$check = $("#comment").val();
		if($check == "Message"){
			$("#comment").val("");	
		}
	}).blur(function(){
		$check = $("#comment").val();
		if($check == ""){
			$("#comment").val("Message");	
		}
	});
	
	//Link colour change
	$(".frameworkCenter a").hover(function(){
		if ($(this).attr("rel") == "") {
			$(this).attr("rel", $(this).css("color"));
		}
		if ($(this).css("color") == "rgb(0, 129, 255)") {
			var myColor = "#000";
		} else if ($(this).css("color") == "#0081FF") {
			var myColor = "#000";
		} else {
			var myColor = "#0081FF";
		}
		$(this).stop()
			.css({"color": $(this).attr("rel")})
			.animate({"color": myColor}, 200);
	},function(){
		$(this).stop()
			.animate({"color": $(this).attr("rel")}, 400);
	});
});