	var wp_likes={};
	wp_likes.endpoint= document.location.protocol+'//'+document.location.host+'/like';
	wp_likes.didPrevFinish=true;
	wp_likes.makeCall=function(slug,callback){
		if(!this.didPrevFinish)return false;
		params={};
		params["slug"]=slug;
		jQuery.ajax({
			type:"GET",
			url:this.endpoint,
			data:params,
			beforeSend:function(){
			this.didPrevFinish=false;	
			},
			success:function(response){
					callback(response);
			},
			complete:function(){
				this.didPrevFinish=true;
			}
		})
	}
	wp_likes.like = function(slug)
  {
		this.makeCall(slug ,function(response)
    {
      if(response == 'yes')
      {
        var count = jQuery("#likes_count-"+slug).html();
        count = parseInt(count) + 1;
        jQuery("#likes_count-"+slug).html(count);
      }
      else if(response == 'no')
      {
        alert('I got you the first time.');
      }
      else
      {
        alert("Houston, we have a problem, but don't worry we're on it!");
      }
		});
	}
