<!--
// Written by Dexter Zafra at www.ex-designz.net
//Handle Check Username Availability Using Ajax
 var http = createRequestObject();
 function createRequestObject() 
     {
           var xmlhttp;
	 try 
                 { 
                    xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
                 }
	  catch(e) 
                 {
	    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	    catch(f) { xmlhttp=null; }
	   			 }
	        if(!xmlhttp&&typeof XMLHttpRequest!="undefined") 
                        {
	  	   xmlhttp=new XMLHttpRequest();
	           }
		   return  xmlhttp;
 }
function sndRating(idnum,rateval,voters) 
  {
	var votenews = window.document.getElementById('votenews'+idnum);
		vote = window.document.getElementById('vote'+idnum);
             votenews.innerHTML = voters;
			 vote.innerHTML = "<span style='color:#FFFFFF'>I voted</span>";
            try
              {
                 http.open('GET', '/Article/VoteArticle.asp?id='+idnum+'&rateval='+rateval);
                 http.onreadystatechange = handleResponseText;
	    http.send(null);

				}
	   catch(e){}
	    finally{}
 }
function handleResponseText() 
  {
     try
         {
             if((http.readyState == 4)&& (http.status == 200))
                {
    	          var response = http.responseText;
                       var update = new Array();

                    if(response.indexOf('|') != -1) 
                       {
                          update = response.split('|');
                          var drelement = document.getElementById('dv'+update[0]);
                          var voteres = document.getElementById('vot'+update[0]);
                          var totalvote = document.getElementById('tv'+update[0]);
                          var starimg = document.getElementById('star'+update[0]);
                          drelement.style.display ='none';
                          voteres.innerHTML = update[2];
                          totalvote.innerHTML = update[3];
                          starimg.innerHTML = update[4].toString();
            			 }
	       		 }
       	 }
	catch(e){alert("an error occured");}
	finally{}
}