<!--
// Written by Dexter Zafra at www.ex-designz.net
//Handle Check Username Availability Using Ajax
 var http = createRequestObject();
 var voted = 0;
  var puntos = 0;

 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,loc,rateval) 
  {
	var dvelement = document.getElementById('textovotar');

	if ( voted == 1 )
	{
             dvelement.innerHTML = "Sólo se permite un voto por día";
		return;
	}

             dvelement.innerHTML = "<img src='progressimgred.gif'>";
            try
              {
                 http.open('GET', 'ratingprocessl.asp?id='+idnum+'&loc='+loc+'&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;
                    if(response.indexOf('OK|') != -1) 
                       {
                          update = response.split('|');
					num++;
					document.getElementById ( 'textovotar' ).innerHTML = 'Voto guardado (' + num + ' votos)';
					puntos = update [1];
					var estrellas = parseInt ( ( puntos * 5 ) / ( num * 10 ) );
					document.getElementById ( 'rating-current' ).style.width = estrellas * 17;
					voted = 1;
				}
	        }
        }
	catch(e){alert("Ha ocurrido un error");}
	finally{}
}