$.fn.clearField = function(){
	return this.focus(function() {
		if( this.value == this.defaultValue){
			this.value = "";
		}
	}).blur(function(){
		if( !this.value.length){
			this.value = this.defaultValue;
		}
	});
};

$(document).ready(function(){
	$("input").clearField();
	var endDate = new Date(2009,2,2,14,0,0);
	//$('#right h2 strong').countdown({until: endDate,layout: '%D%n %l%D %H%n %l%H %M%n %l%M %S%n %l%S'});
	$('#right h2 strong').countdown({until: endDate,layout: '%D%n %l%D %M%n %l%M'});

 	$("input[type=file]").filestyle({ 
		image: "/interface/images/layout/btn_browse.gif",
		imageheight : 35,
		imagewidth : 97,
		width : 100
 	});

	// validate signup form on keyup and submit
	$("#entryform").validate({
		rules: {
			field_id_23: "required"
		},
		messages: {
			field_id_23: "<span class=\"warning\">Please accept T&amp;Cs</a>&nbsp;"
		}
	});

	//$('a[rel*=facebox]').facebox();
});