
var _URL = "http://innoradar.com/"

function showActivar(str1,str2,str3) {
    xmlHttp = GetXmlHttpObject();
    if (xmlHttp == null) {
        alert("Browser does not support HTTP Request");
        return;
    }
    var url = _URL + "activarcta.php";
    var params = "action=" + str1 + "&codval=" + str2 + "&txt_codigo=" + str3;
    //alert(params);
    xmlHttp.open("POST", url, true);

    //Send the proper header information along with the request
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");

    xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
        if (xmlHttp.responseText.substring(0, 4)=="http")
            window.location = xmlHttp.responseText;
        else
            document.getElementById("respuesta").innerHTML = xmlHttp.responseText; //xmlHttp.responseText;
        }
    }
    xmlHttp.send(params);

}

function showNew(str1, str2) {
    xmlHttp = GetXmlHttpObject();
    if (xmlHttp == null) {
        alert("Browser does not support HTTP Request");
        return;
    }
    var url = _URL + "newpwd.php";
    var params = "action=" + str1 + "&email_box=" + str2;
    //alert(params);
    xmlHttp.open("POST", url, true);

    //Send the proper header information along with the request
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");

    xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            if (xmlHttp.responseText.substring(0, 4) == "http")
                window.location = xmlHttp.responseText;
            else
                document.getElementById("resnewpwd").innerHTML = xmlHttp.responseText; //xmlHttp.responseText;
        }
    }
    xmlHttp.send(params);

}

function bajados(p) {
    xmlHttp = GetXmlHttpObject()
    if (xmlHttp == null) {
        alert("Browser does not support HTTP Request")
        return
    }
    var url = _URL + "bajados.php"
    url = url + "?p=" + p
    url = url + "&sid=" + Math.random()
    /*xmlHttp.onreadystatechange = function stateChanged() {
        if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
            document.getElementById(str3).innerHTML = xmlHttp.responseText
        }
    }*/
    xmlHttp.open("GET", url, true)
    xmlHttp.send(null)
}

function GetXmlHttpObject() {
    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;
}
