function votebig(url, entry_id, rating)
{
  new Ajax.Request(url,
  {
    method:'get',
    parameters: {id: entry_id, rating: rating, size: size},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      //alert(response);
      updateRating(entry_id);
      Element.remove('voting-message');
      Element.insert('voting-message-wrapper', response);
      myLightWindow.activateWindow({
	      href: '#voting-message-wrapper', 
	      type: 'inline',
	      width: 500,
	      title: "Thanks for Voting"
      });
    },
    onFailure: function(){ alert('Something went wrong while trying to vote...') }
  });
}

function vote(url, entry_id, rating, size)
{
  new Ajax.Request(url,
  {
    method:'get',
    parameters: {id: entry_id, rating: rating, size: size},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      //alert(response);
      updateRating(entry_id);
      Element.remove('voting-message');
      Element.insert('voting-message-wrapper', response);
      myLightWindow.activateWindow({
	      href: '#voting-message-wrapper', 
	      type: 'inline',
	      width: 500,
	      title: "Thanks for Voting"
      });
    },
    onFailure: function(){ alert('Something went wrong while trying to vote...') }
  });
}

function showProfile(user_id)
{
  new Ajax.Request(siteroot + '/account/profile.aspx',
  {
    method:'get',
    parameters: {id: user_id},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      Element.remove('voting-message');
      Element.insert('voting-message-wrapper', response);
      myLightWindow.activateWindow({
	      href: '#voting-message-wrapper', 
	      type: 'inline',
	      width: 300,
	      title: "Profile"
      });
    },
    onFailure: function(){ alert('Something went wrong while trying to show profile...') }
  });
  
}


function updateRating(entry_id)
{
  new Ajax.Request(siteroot + '/entry/rating.aspx',
  {
    method:'get',
    parameters: {id: entry_id},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      $A($$('.rating-entry-' +  eval(entry_id))).each( 
        function(item) {
          Element.replace(item, response);
        }
      );
    },
    onFailure: function(){ alert('Something went wrong while trying to update ratings...') }
  });
  
}

function approve(url, entry_id, status)
{
  new Ajax.Request(url,
  {
    method:'get',
    parameters: {id: entry_id, status: status},
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      alert(response);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });
}
