var xmlHttp;
var nombreDivision;

function rotar(strurl,nombdiv,idfiltro,inicio,orden)
{ 
xmlHttp=GetXmlHttpObjectCat();
nombreDivision=nombdiv;
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
 
var myRand = parseInt(Math.random()*999999999999999); 
var url= strurl;
url=url+"?inicio="+inicio;
url=url+"&orden="+orden;
url=url+"&idfiltro="+idfiltro;
url=url+"&rand="+myRand;
xmlHttp.onreadystatechange=stateChanged; 
xmlHttp.open("GET",url,true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
xmlHttp.send(null);
}

function stateChanged() 
{ 
 if (xmlHttp.readyState==4)
 {
   if (xmlHttp.status == 200)
   {
 		document.getElementById(nombreDivision).innerHTML=xmlHttp.responseText; 
   } 
   else
   {
       alert("Ha ocurrido un error: " + xmlHttp.statusText);
   }
 } 
 
}

function GetXmlHttpObjectCat()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}