function vote(obj, nm, score){
var option0 = new Option("Thanks!", "thx")

url = 'http://www.wavcentral.com/cgi-bin/rank.cgi?id='+nm+'&score='+score;

document.zero.src = url;

obj.options[6] = null;
obj.options[5] = null;
obj.options[4] = null;
obj.options[3] = null;
obj.options[2] = null;
obj.options[1] = null;
obj.options[0] = null;

obj.options[0] = option0;
obj.options[0].selected=true;

return;

}

function ReadCookie (CookieName) {
  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];
    }

  }

return ReturnValue;
}

function check_cookie(Question_id){

poll_id = ReadCookie("poll_id");
if(poll_id=="")
  return 1;

i_poll_id = parseInt(poll_id);

if(i_poll_id == Question_id)
  return 0;

return 1;
}

function display_poll(){

Question = 'Will the stockmarket rebound in the next 6 months?';
Question_id = 5;

Answer = new Array("Definitely","Most Likely","Probably","Unlikely", "Definitely NOT", "");
Answer_id = new Array(15,16,17,18,19);

if(check_cookie(Question_id)){
document.write('<form method=post target=_top action=http://wavcentral.com/scripts/poll.msql>');
document.write('<table bgcolor=003366 cellspacing=0 cellpadding=3><tr><td>');
document.write('<table bgcolor=ffffff cellspacing=0 cellpadding=0><tr><td>');
document.write('<table bgcolor=ffffff cellspacing=0 cellpadding=2><tr><td colspan=2>');
document.write('<font face=arial size=2 color=000000><b>');
document.write(Question);
document.write('</b></font><input type=hidden name=question_id value='+Question_id+'><input type=hidden name=mode value=save></td></tr>');

i=0;
while(1){
document.write('<tr><td><input type=radio name=answer_id value='+Answer_id[i]+'></td><td><font face=arial size=2 color=000000>'+Answer[i]+'</font></td></tr>');
++i;
if(Answer[i] == '')  break;
}

document.write('<tr><td colspan=2 align=center><input type=submit value=SUBMIT></td></tr></table>');
document.write('</td></tr></table>');
document.write('</td></tr></table>');
document.write('</form>');
}
return;
}
