function printBefore() {
document.writeln('<table width="170" border="0" cellspacing="0" cellpadding="1" bgcolor="#666699">');
document.writeln('  <tr align="center">');
document.writeln('    <td>');
document.writeln('      <style type="text/css">');
document.writeln(' <!--');
document.writeln('  .input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt}');
document.writeln(' -->');
document.writeln('</style>');
document.writeln('      <font face="Verdana, Arial, Helvetica, sans-serif" size="-1" color="#FFFFFF"><b>Donate With BeanPoll&#174</b></font></td>');
document.writeln('  </tr>');
document.writeln('  <tr align="center"> ');
document.writeln('    <td> ');
document.writeln('      <table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" bgcolor="#FFFFFF">');
document.writeln('        <tr> ');
document.writeln('          <td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Donations go to: <b>BeanPoll</b></font></td>');
document.writeln('        </tr> ');
document.writeln('');
document.writeln('        <tr> ');
document.writeln('          <td height="40" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><b>Which party is the best?</b></font></td>');
document.writeln('        </tr>');
document.writeln('        <tr align="right" valign="top"> ');
document.writeln('          <td>');
document.writeln('<!-- bch36: Replace...');
document.writeln('            <form method="post" action="redirect.html">');
document.writeln('With... -->');
document.writeln('<script>');
document.writeln('function setPaypalReturn()');
document.writeln('{');
document.writeln('  var ppForm = document.paypalForm;');
document.writeln('');
document.writeln('  if (!validateNumeric(ppForm.amount.value))');
document.writeln('  {');
document.writeln('    alert("You must enter a valid amount!");');
document.writeln('    return false;');
document.writeln('  }');
document.writeln('');
document.writeln('  if (getCheckedValue(ppForm.option_id) == "")');
document.writeln('  {');
document.writeln('    alert("Please select an option before voting.");');
document.writeln('    return false;');
document.writeln('  }');
document.writeln('');
document.writeln('  ppForm["return"].value += "?option_id="+getCheckedValue(ppForm.option_id);');
document.writeln('  ppForm["return"].value += "&amount="+ppForm.amount.value;');
document.writeln('  ppForm["return"].value += "&action="+ppForm.action.value;');
document.writeln('  ppForm["return"].value += "&poll_ident="+ppForm.poll_ident.value;');
document.writeln('  ppForm["return"].value += "&time=1281998441";');
document.writeln('  ppForm["return"].value += "&code=4e2d80b7be3f140cc7b82aa76aa096f0";');
document.writeln('');
document.writeln('  return true;');
document.writeln('}');
document.writeln('');
document.writeln('function getCheckedValue(radioObj) {');
document.writeln('	var radioLength = radioObj.length;');
document.writeln('	for(var i = 0; i < radioLength; i++) {');
document.writeln('		if(radioObj[i].checked) {');
document.writeln('			return radioObj[i].value;');
document.writeln('		}');
document.writeln('	}');
document.writeln('	return "";');
document.writeln('}');
document.writeln('');
document.writeln('function  validateNumeric( strValue ) {');
document.writeln('/******************************************************************************');
document.writeln('DESCRIPTION: Validates that a string contains only valid numbers.');
document.writeln('');
document.writeln('PARAMETERS:');
document.writeln('   strValue - String to be tested for validity');
document.writeln('');
document.writeln('RETURNS:');
document.writeln('   True if valid, otherwise false.');
document.writeln('******************************************************************************/');
document.writeln('  var objRegExp  =  /^((\\$\\d*)|(\\$\\d*\\.\\d{2})|(\\d*)|(\\d*\\.\\d{2}))$/;');
document.writeln('');
document.writeln('  //check for numeric characters');
document.writeln('  return objRegExp.test(strValue);');
document.writeln('}');
document.writeln('');
document.writeln('function validateInteger( strValue ) {');
document.writeln('/************************************************');
document.writeln('DESCRIPTION: Validates that a string contains only');
document.writeln('    valid integer number.');
document.writeln('');
document.writeln('PARAMETERS:');
document.writeln('   strValue - String to be tested for validity');
document.writeln('');
document.writeln('RETURNS:');
document.writeln('   True if valid, otherwise false.');
document.writeln('******************************************************************************/');
document.writeln('  var objRegExp  = /(^-?\\d\\d*$)/;');
document.writeln('');
document.writeln('  //check for integer characters');
document.writeln('  return objRegExp.test(strValue);');
document.writeln('}');
document.writeln('</script>');
document.writeln('');
document.writeln('<form name="paypalForm" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return setPaypalReturn()">');
document.writeln('<input type="hidden" name="cmd" value="_xclick">');
document.writeln('<input type="hidden" name="business" value="info@beanpoll.com">');
document.writeln('<input type="hidden" name="item_name" value="Which party is the best?">');
document.writeln('<input type="hidden" name="item_number" value="53">');
document.writeln('<input type="hidden" name="no_shipping" value="1">');
document.writeln('<input type="hidden" name="return" value="http://www.beanpoll.com/pollphp/db/redirect.html">');
document.writeln('<input type="hidden" name="cancel_return" value="http://www.beanpoll.com">');
document.writeln('<input type="hidden" name="no_note" value="1">');
document.writeln('<input type="hidden" name="currency_code" value="USD">');
document.writeln('<input type="hidden" name="tax" value="0">');
document.writeln('<!--<input type="hidden" name="bn" value="PP-DonationsBF">-->');
document.writeln('<!--bch36: end paypal code -->');
document.writeln('');
document.writeln('              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">');
document.writeln('                <tr valign="top" align="center"> ');
document.writeln('                  <td> ');
document.writeln('                    <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="1"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Democratic</font></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="2"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Republican</font></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="3"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Green</font></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="4"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Libritarian</font></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="5"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Socialist</font></td>');
document.writeln(' </tr>');
document.writeln(' <tr> ');
document.writeln('   <td width="15%"><input type="radio" name="option_id" value="6"></td>');
document.writeln('   <td width="85%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">Any Party Dude</font></td>');
document.writeln(' </tr>');
document.writeln('                    </table>');
document.writeln('                    <table>');
document.writeln('                      <tr>');
document.writeln('                        <td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Amount: $</font></td>');
document.writeln('                        <td><input type="text" name="amount" size="3" value="0"></td>');
document.writeln('                      </tr>');
document.writeln('                    </table>');
document.writeln('                    <input type="hidden" name="action" value="vote">');
document.writeln('                    <input type="hidden" name="poll_ident" value="53">');
document.writeln('                    <input type="submit" value="Vote" class="input">');
document.writeln('                    <br>');
document.writeln('                    <br>');
document.writeln('                    <font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><a href="http://www.beanpoll.com/pollphp/db/redirect.html?action=results&poll_ident=53">View results</a></font>');
document.writeln('                  </td>');
document.writeln('                </tr>');
document.writeln('              </table>');
document.writeln('            </form>');
document.writeln('            <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="http://www.beanpoll.com" target="_blank" title="Get Your Own BeanPoll&#174!">Get Your Own BeanPoll&#174!</a></font>');
document.writeln('          </td>');
document.writeln('        </tr>');
document.writeln('      </table>');
document.writeln('    </td>');
document.writeln('  </tr>');
document.writeln('</table>');
document.writeln('');
}

function printAfter() {
document.writeln('<table width="170" border="0" cellspacing="0" cellpadding="1" bgcolor="#666699">');
document.writeln('<tr align="center">');
document.writeln('<td>');
document.writeln('<style type="text/css">');
document.writeln('<!--');
document.writeln(' .input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt}');
document.writeln(' .links { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7.5pt; color: #000000}');
document.writeln('-->');
document.writeln('</style>');
document.writeln('<font face="Verdana, Arial, Helvetica, sans-serif" size="-1" color="#FFFFFF"><b>Donate With BeanPoll&#174</b></font></td>');
document.writeln('</tr>');
document.writeln('<tr align="center">');
document.writeln(' <td><table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" bgcolor="#FFFFFF">');
document.writeln('        <tr> ');
document.writeln('          <td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Donations go to: <b>BeanPoll</b></font></td>');
document.writeln('        </tr> ');
document.writeln('');
document.writeln(' <tr valign="middle">');
document.writeln('   <td height="40"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><b>Which party is the best?</b></font></td>');
document.writeln(' </tr>');
document.writeln(' <tr align="right" valign="bottom">');
document.writeln('   <td>');
document.writeln('     <table border="0" cellspacing="0" cellpadding="1" width="100%" align="center">');
document.writeln('       <tr valign="top">');
document.writeln('        <td>');
document.writeln('         <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Republican</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/blue.gif" width="42" height="10">$3.00</font></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Democratic</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/aqua.gif" width="0" height="10">$0.00</font></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Green</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/brown.gif" width="0" height="10">$0.00</font></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Libritarian</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/darkgreen.gif" width="0" height="10">$0.00</font></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Socialist</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/gold.gif" width="0" height="10">$0.00</font></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('    <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Any Party Dude</font></td>');
document.writeln('    <td nowrap height="22"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><img src="http://www.beanpoll.com/pollphp/db/image/green.gif" width="0" height="10">$0.00</font></td>');
document.writeln('</tr>');
document.writeln('       </table>');
document.writeln('       <font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1"><br>');
document.writeln('       Total amount: <font color="#CC0000">$3.00</font><br>');
document.writeln('       <br><br><div align="center">');
document.writeln('       &nbsp;</div></font>');
document.writeln('       </td></tr>');
document.writeln('      <tr><td height="2">&nbsp;</td></tr>');
document.writeln('     </table>');
document.writeln('    <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><a href="http://www.beanpoll.com/pollphp/db/admin/?register=1&step=1" target="_blank" title="Get Your Own BeanPoll&#174!">Get Your Own BeanPoll&#174!</a></font></td>');
document.writeln('   </tr>');
document.writeln(' </table>');
document.writeln('</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('');
}


function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return "";
}

if (getQueryVariable("poll") == "2")
        printAfter();
else
        printBefore();
	
