
// Pages using this must also include cookies.js

function showPollWho(redirect) 
{
   var location = getCookie('POLLWHO');
   var ty       = getCookie('POLLTHANKS');

   if(location == null || location.length == 0)
     writePollWho(redirect);
   else
   {
      // Check to see if we should say thank you
      if(ty != null && ty.length > 2) 
      {
         writePollHeader();
         document.write('Thank your feedback.  Enjoy our website');
         writePollFooter();
         setCookie('POLLTHANKS','NO');
      }      
   }
}

function writePollHeader()
{
   document.write('<tr><td width="100%" bgcolor="#8CB199">');
   document.write('<table border="0" cellpadding="3" width="100%" cellspacing="0">');
   document.write('<tr><td bgcolor="#8CB199"><h3>Quick Poll</h3></td></tr></table>');
   document.write('<table border="0" cellpadding="3" width="100%" bgcolor="#DFE9E2" cellspacing="0">');
   document.write('<tr><td>');
}

function writePollFooter()
{
   document.write('</td></tr></table></td></tr>');
}

function writePollWho(redirect)
{
   writePollHeader();

   document.write('<form name="form1" method="POST" action="/asp/poll-who.asp">');
   document.write('<p class="caption"><input type="radio" name="church" value="MEMBER">');
   document.write('I am a Member of SFC<br>');
   document.write('<input type="radio" name="church" value="ATTEND"> I attend SFC, but I am not a member<br>');
   document.write('<input type="radio" name="church" value="OTHER"> I live locally, but do not attend SFC<br>');
   document.write('<input type="radio" name="church" value="OOTA"> I do not live in the area<br>');
   document.write('<input type="hidden" name="redirect" value="' + redirect + '">');
   document.write('<br><p align="center"><input type="submit" name="Submit" value="Submit"></p>');
   document.write('</form>');

   writePollFooter();
}