
jQuery(document).ready(function($){
	$("#shout_form :input[type=text],:input[type=password]").each(function(){

		$(this).focus(function(){
			oldValue = this.value;
			  this.value = '';
		      $(this).blur(function(){
		        if(this.value == ''){
		          this.value = oldValue;
		        }
		      });
	    });
	});
	jQuery("#ajaxBusy").hide();
	
	$.get('/wordpress/cache-tweet.php', function(data) {
	  $('#mention').html(data);
	  //alert('Load was performed.');
	});



});


jQuery("#ajaxBusy").ajaxStart(function(){
	jQuery("#ajaxBusy").show();
}).ajaxStop(function(){
	jQuery("#ajaxBusy").hide();
});

jQuery("#shout_form").submit(function($){
		
	form_action = this.action;

	jQuery.post(form_action, jQuery("#shout_form").serialize(), function(result){

			var response = eval(result);
			if(response.success == "true"){
				document.shout_form.reset();
			}
			jQuery.fn.colorbox({html: response.message});
		}, 'json');
	
	return false;
});




