function getCheckedValue(radioObj) {
  if(!radioObj)
    return "";
  var radioLength = radioObj.length;
  if(radioLength == undefined)
    if(radioObj.checked)
      return radioObj.value;
    else
      return "";
  for(var i = 0; i < radioLength; i++) {
    if(radioObj[i].checked) {
      return radioObj[i].value;
    }
  }
  return "";
}

function doVote(object, voteoption, link) {
  $("#wbi_" + object).fadeTo("fast", 0.1);
  $.ajax({
    type: "POST",
    url: link,
    data: {object:object,
           voteoption:getCheckedValue(voteoption),
           link:link},
    success: function(html){
               $("#wbi_" + object).html(html);
               $("#wbi_" + object).fadeTo("slow", 1.0);
             }
  });
}


