function getCookie(c_name)
{
  if (document.cookie.length>0)
  {
    c_start=document.cookie.indexOf(c_name + "=")
    if (c_start!=-1)
    { 
      c_start=c_start + c_name.length+1 
      c_end=document.cookie.indexOf(";",c_start)
      if (c_end==-1) c_end=document.cookie.length
      return unescape(document.cookie.substring(c_start,c_end))
      } 
    }
  return null
}

function poll_write()
{
  document.write('<h1>The funniest ranged class is:</h1>');
  if(getCookie('pollvoted') == '58')
  {
    document.write('<div style="text-align:center; margin: 20px auto;">You have already voted.<br /><a href="?poll_id=58" id="?poll_id=58">View the results here.</a></div>');
  }

  else 
  {
    document.write('<form action="index.php">');
    document.write('<input type="hidden" name="poll" value="vote" />');
    document.write('<input type="hidden" name="poll_id" value="58" />');
    document.write('<table width="100%" cellspacing="1" cellpadding="0">');
	document.write('<tr><td width="10"><input type="radio" name="Answer" value="1" id="p1" /></td><td><label for="p1">Hunter</label></td></tr>');
	document.write('<tr><td width="10"><input type="radio" name="Answer" value="2" id="p2" /></td><td><label for="p2">Lore-Master</label></td></tr>');
	document.write('<tr><td width="10"><input type="radio" name="Answer" value="3" id="p3" /></td><td><label for="p3">Minstrel</label></td></tr>');
	document.write('</table>');
    document.write('<table width="100%" cellspacing="0" cellpadding="2" style="margin-top: 5px;">');      
    document.write('<tr>');
    document.write('<td align="center"><input type="submit" name="submit" value="Vote" class="button" /></td>');
    document.write('<td align="center"><input type="submit"  name="action" value="Results" class="button" /></td>');
    document.write('</tr>');
    document.write('</table>');
    document.write('</form>');
  }
}