var ajax=new Array();
function objetus(file) {
    xmlhttp=false;
    this.AjaxFailedAlert='Su navegador no soporta las funciónalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada.Por favor habilite javascript en su navegador para verlo normalmente.\n';
    this.requestFile = file;
    this.encodeURIString = true;
    this.execute = false;
    if (window.XMLHttpRequest) { 
        this.xmlhttp = new XMLHttpRequest();
        if (this.xmlhttp.overrideMimeType) {
            this.xmlhttp.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) { // IE
        try {
            this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try {
                this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                this.xmlhttp = null;
            }
        }
        if (!this.xmlhttp && typeof XMLHttpRequest!='undefined') {
            this.xmlhttp = new XMLHttpRequest();
            if (!this.xmlhttp){
                this.failed = true; 
            }
        } 
    }
    return this.xmlhttp ;
}
function recibeid(_pagina,valorget,valorpost,capa,posicion){
    ajax[posicion]=objetus(_pagina);
    if(valorpost!=""){
        ajax[posicion].open("POST", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
    } else {
        ajax[posicion].open("GET", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
    }
    ajax[posicion].onreadystatechange=function() {
        if (ajax[posicion].readyState==1){
            document.getElementById(capa).innerHTML = "<center><img src='images/loading.gif' align='center'> Cargando...</center>";
        }
        if (ajax[posicion].readyState==4) {
            if(ajax[posicion].status==200)
            {document.getElementById(capa).innerHTML = ajax[posicion].responseText;}
            else if(ajax[posicion].status==404)
            {
                capa.innerHTML = "La direccion no existe";
            }
            else
            {
                capa.innerHTML = "Error: ".ajax[posicion].status;
            }
        }
    }
    if(valorpost!=""){
        ajax[posicion].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        ajax[posicion].send(valorpost);
    } else {
        ajax[posicion].send(null);
    }
}

function valSolicitud(pForm,pStrMsj,pStylOk,pStyleEr,pMsjOk,pMsjEr1,pMsjEr2,pSuperior)
{	var pResultado;
	pResultado=valAjxSimple(pForm,pStrMsj,pStylOk,pStyleEr,pMsjOk,pMsjEr1,pMsjEr2,pSuperior);
	if(pResultado!="0")
	{	recibeid(pResultado,"acc=4","nombres="+document.frmReg.txtNombres.value+"&empresa="+document.frmReg.txtEmpresa.value+"&cargo="+document.frmReg.txtCargo.value+"&email="+document.frmReg.txtEmail.value+"&telefono="+document.frmReg.txtTelefono.value+"&direccion="+document.frmReg.txtDireccion.value+"&item="+document.frmReg.item.value+"&solicitud="+document.frmReg.txtMensaje.value,"formulario",0);
	}
}