 var http = createRequestObjectcom();
 function createRequestObjectcom() 
     {
           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 sndRatingcom(idnum,rateval) 
  {
	var dvelement = document.getElementById('valcom'+idnum);
             dvelement.innerHTML = "<img src='progressimgred.gif'>";
            try
              {
                 http.open('GET', 'ratingprocessenc.asp?id='+idnum+'&rateval='+rateval);
                 http.onreadystatechange = handleResponseTextcom;
	    http.send(null);
	 }
	    catch(e){}
	    finally{}
 }
function handleResponseTextcom() 
  {
     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('comentariox'+update[0]);
										  if (update[1]<=-5){
												drelement.style.display ='none';
										  }else{
										    drelement = document.getElementById('color'+update[0]);
											
												if (update[1]>0){
													clase='positivo';
												}else{
													clase='negativo';
												}
												html='<div class="valoracion_numerica">Valoración<div class="'+clase+'" id="numero">'+update[1]+'</div></div>';
												
												//drelement.innerHTML = update[1];
												drelement.innerHTML = html;
												
												drelement = document.getElementById('valcom'+update[0]);
												drelement.style.display ='none';
									}	  
						  //drelement.innerHTML = "Gracias por su votación";
      
             }
	        }
        }
	catch(e){alert("A ocurrido un error");}
	finally{}
}
