function twiigsURLEncode_50764900(plaintext)
{
  // The Javascript escape and unescape functions do not correspond
  // with what browsers actually do...
  var SAFECHARS =
    "0123456789" +                  // Numeric
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +  // Alphabetic
    "abcdefghijklmnopqrstuvwxyz" +
    "-_.!~*'()";                    // RFC2396 Mark characters
  var HEX = "0123456789ABCDEF"; 
  var encoded = "";
  for(var i = 0; i < plaintext.length; i++ )
  {
    var ch = plaintext.charAt(i);
    if(ch == " ")
    {
      encoded += "+";				// x-www-urlencoded, rather than %20
    }
    else if(SAFECHARS.indexOf(ch) != -1)
    {
      encoded += ch;
    }
    else 
    {
      var charCode = ch.charCodeAt(0);
      if(charCode > 255)
      {
        alert( "Unicode Character '" + ch + "' cannot be encoded using standard URL encoding.\n" + "(URL encoding only supports 8-bit characters.)\n" + "A space (+) will be substituted." );
        encoded += "+";
      }
      else
      {
        encoded += "%";
        encoded += HEX.charAt((charCode >> 4) & 0xF);
        encoded += HEX.charAt(charCode & 0xF);
      }
    }
  } // for
  return encoded;
}

function twiigsInclude_50764900(script_filename)
{
  var html_doc = document.getElementsByTagName('head').item(0);
  var js = document.createElement('script');
  js.setAttribute('type', 'text/javascript');
  js.setAttribute('src', script_filename);
  html_doc.appendChild(js);
}

function twiigsPollLoading_50764900()
{
  var poll = document.getElementById('TWIIGSPOLL_50764900');
  poll.innerHTML = '<div class="TWIIGSPOLLloading"'+twiigsAddStyleBlock_50764900({"text-align":"center"})+'><img src="http://www.twiigs.com/img/loading.gif"'+twiigsAddStyleImage_50764900({})+'> Loading...</div>';
}

function twiigsPollVote_50764900(form, vote)
{
  var script_filename = 'http://www.twiigs.com/pollvote.js?pid=&ajax=1&w=1&color=bluedarkest';
  script_filename += '&pidsuffix=50764900';
  if(vote)
  {
    script_filename += '&vsubmit=1';
    if(form.ptype.value == 2)
    {
      script_filename += '&panswer=' + twiigsURLEncode_50764900(form.panswer.value);
    }
    else
    {
      if(form.pmultiple.value == 1)
        var answer = form.elements['paid[]'];
      else
        var answer = form.paid;
      var paid = '';
      for(i = 0; i < answer.length; i++)
      {
        if(answer[i].checked)
        {
          if(paid != '')
            paid += ','
          paid += answer[i].value;
        }
      }
      script_filename += '&paid=' + twiigsURLEncode_50764900(paid);
    }
  }
  twiigsPollLoading_50764900();  
  twiigsInclude_50764900(script_filename);  
  return false;
}

function twiigsPollView_50764900()
{
  twiigsPollLoading_50764900();
  var script_filename = 'http://www.twiigs.com/pollview.js?ajax=1&w=1';
  script_filename += '&pidsuffix=50764900'; 
  twiigsInclude_50764900(script_filename);
  return false;
}

function twiigsAddStyle_50764900(stype, mods)
{
  var params = {
    "background-color" : "transparent",
    "background-image" : "none",
    "border-style" : "none",
    "clear" : "none",
    "display" : "block",
    "float" : "none",
    "position" : "static",
    "visibility" : "visible",
    "height" : "auto",
    "line-height" : "normal", 
    "width" : "auto",
    "margin-top" : "0",
    "margin-right" : "0",
    "margin-bottom" : "0",
    "margin-left" : "0",
    "outline-style" : "none",
    "padding-top" : "0",
    "padding-right" : "0",
    "padding-bottom" : "0",
    "padding-left" : "0",
    "clip" : "auto",
    "overflow" : "hidden",
    "vertical-align" : "baseline",
    "z-index" : "auto",
    "letter-spacing" : "normal", 
    "text-align" : "left",
    "text-decoration" : "none",
    "text-indent" : "0",
    "text-shadow" : "none",
    "text-transform" : "none",
    "white-space" : "normal",
    "word-spacing" : "normal"
  }; 
  
  for(var i in stype)
    params[i] = stype[i];
  for(var i in mods)
    params[i] = mods[i];
  
  var style = ' style="';  
  for(var i in params)
  {
    if(params[i] != null)
      style += i + ": " + params[i] + "; ";
  }
  style += '"';

  return style;
}

function twiigsAddStyleBlock_50764900(mods)
{
  var stype = {
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsAddStyleInline_50764900(mods)
{
  var stype = {
    "display" : "inline"
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsAddStyleInput_50764900(mods)
{
  var stype = { 
    "background-color" : null,
    "background-image" : null,
    "border-style" : null,
    "display" : "inline",
    "text-shadow" : null
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsAddStyleImage_50764900(mods)
{
  var stype = { 
    "background-color" : null,
    "background-image" : null,
    "display" : "inline",
    "height" : null, 
    "width" : null 
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsAddStyleLink_50764900(mods)
{
  var stype = { 
    "display" : "inline",
    "text-decoration" : null
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsAddStyleList_50764900(mods)
{
  var stype = { 
    "display" : "list-item",
    "list-style-type" : "none",
    "list-style-position" : "outside",
    "list-style-image" : "none"
  };
  return twiigsAddStyle_50764900(stype, mods);
}

function twiigsPollBarWidthSet_50764900()
{
  for(var i = 0; i < 0; i++)
    twiigsPollBarWidthSetBar_50764900(i, 20);
}

function twiigsPollBarWidthSetBar_50764900(i, n)
{
  var imgObj = document.getElementById("TWIIGSPOLL_50764900answerimg" + i);
  if(imgObj)
  {
    var itemObj = document.getElementById("TWIIGSPOLL_50764900answeritem" + i);
    if(itemObj)
    {
      if(itemObj.offsetWidth > 0)
      {
        var pctObj = document.getElementById("TWIIGSPOLL_50764900answerpct" + i);
        var pct = parseFloat(pctObj.innerHTML);
        imgObj.width = parseInt(pct * (parseInt(itemObj.offsetWidth) - 56));
        pctObj.innerHTML = parseInt(pct * 100) + "%";
      }
      else
      {
        if(n > 0)
        {
          n--;
          setTimeout('twiigsPollBarWidthSetBar_50764900(' + i + ', ' + n + ')', 100);
        }
      }
    }
  }
}

document.write('<div class="TWIIGSPOLLpollcontainer" '+twiigsAddStyleBlock_50764900({})+'>'
+' <div class="TWIIGSPOLLpoll" '+twiigsAddStyleBlock_50764900({"margin-top":"5px","margin-right":"5px","margin-left":"5px"})+'>'
+' <div class="TWIIGSPOLLquestion" '+twiigsAddStyleBlock_50764900({"margin-bottom":"8px"})+'>'
+' Unable to display poll </div>'
+' </div>'
+' </div>'
+'');
twiigsPollBarWidthSet_50764900();
