// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function wait(div,message){
	if(typeof(message) == 'undefined') message = ''
	$('#'+div).html("<img src='/images/wait.gif' title='Updating ... please wait'/>" + message)
}

function random(i){
   return Math.floor(Math.random() * (i+1))
}
String.prototype.blank = function(){
  /^\s*$/.test(this);
}

function setFavorite(img){
	$(img).attr('src', '/images/wait.gif');
  $.post("/plogs/" + img.id + "/update_favorite/", null, null, 'script');
}