
var $a="Vote.aspx";var $b=new Array();function BarChart(title,$c,$d,$e,$f){this.barList=new Array();this.labelWidth=$c;this.barWidth=$d;this.barHeight=$e;this.bgColor=$f;this.title=title;this.alignCaption="bottom";this.replace=function($g){var $h=document.createElement("TABLE");$h.border="0px";$h.bgColor=this.bgColor;if(this.title.length>0){var $i=document.createElement("CAPTION");$i.appendChild(document.createTextNode(this.title));$i.align=this.alignCaption;$h.appendChild($i);};var $j=document.createElement("TBODY");$h.appendChild($j);var $k=0;for(var i=0;i<this.barList.length;i++){$k+=parseInt(this.barList[i].value,10);};for(i=0;i<this.barList.length;i++){var $l=document.createElement("TR");$j.appendChild($l);var $m=document.createElement("TD");$m.style.width=this.labelWidth+"px";$m.appendChild(document.createTextNode(this.barList[i].label));$l.appendChild($m);var $n=document.createElement("TD");var $o=this.barList[i].value/$k;this.addBar($n,$o,this.barList[i].color);$l.appendChild($n);};$g.parentNode.replaceChild($h,$g);};this.addBarData=function($p,$q,$r){var $s=new Object();this.barList[this.barList.length]=$s;$s.label=$p;$s.value=$q;$s.color=$r?$r:"black";return $s;};this.addBar=function($t,$o,$r){var $u=document.createElement("TABLE");var $v=document.createElement("TBODY");$u.appendChild($v);var $w=document.createElement("TR");$v.appendChild($w);$w.style.height=this.barHeight+"px";var $s=document.createElement("TD");$s.style.height=this.barHeight;var $x=Math.round($o*this.barWidth);$s.width=$x>0?$x:1+"px";$s.bgColor=$r;$w.appendChild($s);var $y=document.createElement("TD");$y.style.height=this.barHeight;$y.appendChild(document.createTextNode(Math.round($o*1000)/10+'%'));$w.appendChild($y);$u.cellspacing="0px";$u.cellpadding="0px";$t.appendChild($u);};};function GetXMLHttpRequest(){var $z=null;if(window.ActiveXObject){try{$z=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){};if($z==null){try{$z=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}else if(window.XMLHttpRequest){$z=new XMLHttpRequest();};if($z==null){alert("Your browser does not support this new technology");};return $z;};function OnVote($A,title){if($b==null){$b=new Array;};if($b[$A]!=null){return;};var $B=GetXMLHttpRequest();if($B){$b[$A]=new Object();$b[$A].requestObject=$B;$b[$A].title=title;$b[$A].color=new Array();$b[$A].label=new Array();$B.onreadystatechange=new Function("OnVoteProcess('"+$A+"')");var $C=$a+"?"+"votename="+$A;var $D=document.getElementsByName($A);$C+='&vote='+($D[0].checked?'Yes':'No');$C+='&title='+document.title;$b[$A].color[0]=$D[0].getAttribute('barcolor');$b[$A].label[0]=$D[0].getAttribute('label');$b[$A].color[1]=$D[1].getAttribute('barcolor');$b[$A].label[1]=$D[1].getAttribute('label');var $E=document.getElementById("vote");if($E){$E.value="Loading...";$E.disabled=true;};$B.open("GET",$C,true);$B.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");$B.send("");}};function OnVoteProcess($A){if($b[$A].requestObject&&$b[$A].requestObject.readyState==4){if($b[$A].requestObject.status==200){var $F=$b[$A].requestObject.responseText;if($F=="busy"){alert("The server is busy. Try again.");$b[$A]=null;}else{var $G=$F.split('&');var $H=new BarChart($b[$A].title,17,130,5,"#F4E2C0");for(var i=0;i<$G.length;i++){var $I=$G[i];if($I.length<6&&($I.split('Yes=')||$I.split('No='))){var $J=$I.split('=');$H.addBarData($b[$A].label[i],$J[1],$b[$A].color[i]);}};var name=$A+"div";var $g=document.getElementById(name);if($g){$H.replace($g);};$b[$A]=null;}}}};


