$(document).ready(function(){
	
	$("#csubmit").click(function(){
		var err="";
		$(".cform").each(function(){
			if($(this).val() == ""){
				$(this).css("border", "1px solid #CC0000");
				err = err + "Please enter your "+ $(this).attr('title') +"\n";
			}else{
				$(this).css("border", "1px solid #CCCCCC");
			}
		});
		if(err.length>0){
			alert(err);
		}else{
			$("#cform").submit();
		}
	});
	//news ticker
	$('#newsticker ul').innerfade({timeout: 4000});
	
	//light box
	$('.gallery_image a').lightBox();
	
	//reset racing post content
	//entries
	$(".miniFilter").hide();
	$("#entriesTable a").each(function(){
		$(this).attr("href", "http://www.racingpost.com"+$(this).attr("href"))
			   .attr("onclick", "")
			   .attr("target", "_blank");
	});
	$("#showAllEntries").parent("div").hide();
	$("div[name='live_price_holder']").remove();
	$("#entriesTable tr").show();
	
});