function do_post_vote(frm){delete xmlHttp;createXMLHttpRequest();var url=document.getElementById(frm).action;var args='';fname=document.getElementById(arguments[0]);if(document.getElementById('vote').value=='none'){alert('First you need to select the number of stars to award.');return false;}for(var elems=0;elems<fname.length;elems++){if(fname.elements[elems].name!==''){if(args>''){args+='&';}args+=fname.elements[elems].name+"="+fname.elements[elems].value;}}var query=args+'&ajx=1'+'&ts='+new Date().getTime();if(!xmlHttp){window.document.vform.submit();}else{xmlHttp.open("POST",url,true);xmlHttp.onreadystatechange=handleStateChange_Vote;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send(query);}}function handleStateChange_Vote(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){vote_updates();}else{alert("Ooops! An error seems to have occured:: Error Code:"+xmlHttp.status);}}}function vote_updates(){var xmlDoc=xmlHttp.responseXML,msgs=xmlDoc.getElementsByTagName("message"),xmlstars=xmlDoc.getElementsByTagName("stars"),xmlcount=xmlDoc.getElementsByTagName("count");update_vote_info(msgs,xmlstars,xmlcount);}function update_vote_info(msgs,xmlstars,xmlcount){var msg='',stars='',count='',currentMsg=null,currentStars='',currentCount='';currentMsg=msgs[0];if((currentMsg!==null)&&(currentMsg.childNodes[0]!==null)){msg=currentMsg.childNodes[0].nodeValue;msg=unescape(msg);}if(msg.substr(0,4)=='PASS'){currentStars=xmlstars[0];currentCount=xmlcount[0];if((currentStars!==null)&&(currentStars.childNodes[0]!==null)){stars=currentStars.childNodes[0].nodeValue;stars=unescape(stars);document.getElementById('stars').innerHTML=stars;}if((currentCount!==null)&&(currentCount.childNodes[0]!==null)){count=currentCount.childNodes[0].nodeValue;document.getElementById('vcount').innerHTML=count;}}if(msg>''){document.getElementById('vmsg').innerHTML=msg.substr(5);}}