// Clear input on focus
$.fn.clearInput = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};
var $form;
function cDone(id, msg) {
	$form.hide();
	if ($('#'+id).length > 0)
		$('#'+id).remove();
	$form.after(msg);
	$('img', $form).attr('src', '/mail/captcha.php?captchabgcolor=F4FDFC&captchatextcolor=3C537D&'+ Math.round((Math.random()*10000)));
	$form.get(0).reset();
	setTimeout(function(){$form.show();$('#'+id).remove();}, 4000);
}
$(document).ready(function() {

	$('.clear-value').clearInput();
	
	$('.hot-list li:odd, .series-list li:odd, .textcontent tr:odd').addClass('odd');

	$form = $('#contactsForm');
	$form.submit(function(){
		$('[type="submit"]', $form).attr('disabled', true);
		$.ajax({
			type: 'POST',
			url: 'aj_contacts.php',
			dataType:'script',
			data: $form.serialize(),
			complete: function(json) {
				$('#contactsForm [type="submit"]').attr('disabled', false);
			}
		});
		return false;
	});

});


