<!--
// Written by Dexter Zafra at www.ex-designz.net
//Handle Check Username Availability Using Ajax
 var http1 = createRequestObject1();
 var voted1 = 0;
  var puntosvideo = 0;

 function createRequestObject1() 
     {
           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 sndRatingvideo(idnum,loc,rateval) 
  {
	var dvelement = document.getElementById('textovotarvideo');

	if ( voted1 == 1 )
	{
             dvelement.innerHTML = "Sólo se permite un voto por día";
		return;
	}

             dvelement.innerHTML = "<img src='../../../../../progressimgred.gif'>";
            try
              {
                 http1.open('GET', '../../../../../ratingprocessvideo.asp?id='+idnum+'&loc='+loc+'&rateval='+rateval);
                 http1.onreadystatechange = handleResponseText1;
	    http1.send(null);
	 }
	    catch(e){}
	    finally{}
 }
function handleResponseText1() 
  {
     try
         {
             if((http1.readyState == 4)&& (http1.status == 200))
                {
    	          var response = http1.responseText;

                    if(response.indexOf('OK|') != -1) 
                       {
                          update = response.split('|');
					numv++;
					document.getElementById ( 'textovotarvideo' ).innerHTML = 'Voto guardado (' + numv + ' votos)';
					puntosvideo = update [1];
					var estrellas = parseInt ( ( puntosvideo * 5 ) / ( numv * 10 ) );
					document.getElementById ( 'rating-currentvideo' ).style.width = estrellas * 17;
					voted1 = 1;
				}
	        }
        }
	catch(e){alert("Ha ocurrido un error");}
	finally{}
}