function sendvote()
{
    var sid = document.getElementById('sid').value;
  for (i=0; i < document.form.RadioSet.length; i++) {
    if (document.form.RadioSet[i].checked == true) {
        ticket = document.form.RadioSet[i].value; 
      break;
    }
  }
    var params = 'sid=' + sid + '&ticket=' + ticket;
    options = {method: "get", parameters: params};
    new Ajax.Updater('bowvsgame_poll', 'sendvote.php', options);
}

function checkPollVote() {
	var lf = "\n";
    var CookieName='bowwow_thegame'
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;
    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
        CookiePieces = CookieSet[x].split ('=');
        if (CookiePieces[0].substring (0,1) == ' ') {
            CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
        }
        if (CookiePieces[0] == CookieName) {
            ReturnValue = CookiePieces[1];
        }
    }
    if(ReturnValue=="") {
        // do nothing
    }
    else {
        var params = 'voted=true';
        options = {method: "get", parameters: params};
        new Ajax.Updater('bowvsgame_poll', 'sendvote.php', options);
        //alert ("the cookie was found")
    }
}

