function sendVote(vID,qID){
	removeNode("vForm");
	var url="http://"+location.hostname+"/vote/vote.php?v="+vID+"&q="+qID;
	loadXMLDoc(url,createVotePoll);
}

function createVotePoll(){
	if(req.readyState==4){
		if(req.status==200){
			var xml=req.responseXML;
			var vote_cnt=xml.getElementsByTagName('v_cnt').item(0).firstChild.data;
			var allVote=xml.getElementsByTagName('sum').item(0).firstChild.data;
			var fact=xml.getElementsByTagName('fact').item(0).firstChild.data;
			var parent=document.getElementById("vForm");
			div=document.createElement("div");
			div.style.margin="10px";
			var divq=div.appendChild(document.createElement("div"));
			divq.align="center";
			divq.style.margin="10px";
			divq.style.fontSize="70%";
			var spanq=divq.appendChild(document.createElement("span"));
			spanq.style.fontWeight="bold";
			var quest=xml.getElementsByTagName('quest').item(0).firstChild.data;
			spanq.appendChild(document.createTextNode(quest));		
			for(var i=1;i<=vote_cnt;i++){
				var div1=div.appendChild(document.createElement("div"));
				div1.style.margin="3px";
				var span1=div1.appendChild(document.createElement("span"));
				span1.style.fontSize="70%";
				var txt=xml.getElementsByTagName('var_name_'+i).item(0).firstChild.data;
				var cnt=xml.getElementsByTagName('var_cnt_'+i).item(0).firstChild.data;
				var kol=Math.round(cnt/allVote*100);
				span1.appendChild(document.createTextNode(txt+" ("+cnt+") ("+kol+"%)"));
				var div2=div.appendChild(document.createElement("div2"));
				div2.style.margin="3px";
				var span2=div2.appendChild(document.createElement("span"));
				var i1=span2.appendChild(document.createElement("img"));
				i1.src="http://img.e63.ru/vote/"+i+"_1.gif";
				i1.alt='';
				var i2=span2.appendChild(document.createElement("img"));
				i2.src="http://img.e63.ru/vote/"+i+"_2.gif";
				i2.width=fact*cnt/2;
				i2.height=18;
				i2.alt='';
				var i3=span2.appendChild(document.createElement("img"));
				i3.src="http://img.e63.ru/vote/"+i+"_3.gif";
				i3.alt='';
			}		
			parent.appendChild(div);
		}
	}
}
