function XHConn(){
        var xmlhttp;
        try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch (e) { try { xmlhttp = new XMLHttpRequest(); }
        catch (e) { xmlhttp = false; }}}
        if (!xmlhttp) return null;
        this.connect = function(sURL, sMethod, sVars, fnDone) {
                if (!xmlhttp) return false;
                sMethod = sMethod.toUpperCase();
                try {
                        if (sMethod == "GET") {
                                xmlhttp.open(sMethod, sURL+"?"+sVars, true);
                                sVars = "";
                        }
                        else {
                                xmlhttp.open(sMethod, sURL, true);
                                xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
                                xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=ISO-8859-1");
                        }
                        xmlhttp.onreadystatechange = function() {
                                if (xmlhttp.readyState == 4 ) {
                                        fnDone(xmlhttp);
                                }
                        };
                        xmlhttp.send(sVars);
                }
                catch(z) { return false; }
                return true;
        };
        return this;
}

function Loading(posicion) {
        var contenedor = document.getElementById(posicion);
        var padding= contenedor.style.height || contenedor.style.pixelHeight || contenedor.offsetHeight || document.body.offsetHeight;
        if (document.body.offsetHeight<padding || padding<50 ) padding=document.body.offsetHeight;
        padding=parseInt(padding/3);
        contenedor.innerHTML = '<div id="cargando" align="center" valign="middle" style="padding-top:'+padding+'px;"><img src="/images/loading.gif" border="0" width="30" height="30"/></div>';
}

function Contenido(url,params,posicion) {
        var contenedor = document.getElementById(posicion);
	setTimeout("Loading('"+posicion+"')",5);
        var conexion=new XHConn();
        if (!conexion) alert("XMLHTTP not found. Please upgrade your browser.");
        var idelink = function (oXML) {
                contenedor.innerHTML = oXML.responseText;
        };
        conexion.connect(url, "POST", params, idelink);
}

function cargarDestacado(id,portada,titulo)
{
        if(Pr_Player_Mini) Pr_Player_Mini("Stop");
	portada = (portada == "si")? "si" : "no";
        params = "id=" + id;
        params += "&portada=" + portada;
				
	url = "/cadenadial/lonuevo/destacados.html";

        Contenido(url, params, 'destacado');

        if (document.getElementById('') != '') {
                document.getElementById('')
        }
        
        document.title = titulo + " CadenaDial.com";

        return false;
}
