function aleatoriox(inferior,superior){
numPosibilidades = superior - inferior
aleat = Math.random() * numPosibilidades
aleat = Math.round(aleat)
return parseInt(inferior) + aleat
}

function objetusx() {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!="undefined") {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}

function cargapagina(pagina,lugar)
{
try {
_objetus=objetusx();
_URL_=pagina+"?id="+aleatoriox(1,50);
_target=document.getElementById(lugar); 
_objetus.open("GET",_URL_,true);
_objetus.onreadystatechange=function() {

if (_objetus.readyState ==  1)
{
 if(_target){ _target.innerHTML="<img src=/img/wait_ajax.gif height=30 width=30>"; }
}
else if(_objetus.readyState == 4)
{
if(_objetus.status == 200)
{
if(_target){ _target.innerHTML=_objetus.responseText; }
}     
}

};
_objetus.send(null);
}
catch (e) {
_target.innerHTML = (e.message)?e.message:e.description;
}
return
}

