function dhtmlLoadScript(url){
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}

function validarRegistro(identificacion){
        document.forma.validado.value = '0';
        if(identificacion != 'Documento de identidad' && identificacion != ''){
            dhtmlLoadScript('ajax/validarRegistro.aspx?identificacion='+identificacion);
        }
}

function validarRegistroHisto(identificacion){
        document.frmContactos.validado.value = '0';
        if(identificacion != 'Documento de identidad' && identificacion != ''){
            dhtmlLoadScript('ajax/validarRegistroHisto.aspx?identificacion='+identificacion);
        }
}

function registrarFaq(identificacion,pregunta){
    if(document.forma.validado.value == '0'){
        alert('Debe identificarse antes de enviar preguntas o estamos verificando su registro');
    }
    else if(identificacion != 'Documento de identidad' && identificacion != '' && pregunta != ''){
        dhtmlLoadScript('ajax/registrarFaq.aspx?identificacion='+identificacion+'&pregunta='+pregunta);
        document.forma.pregunta.value = '';
    }
    else if(identificacion != 'Documento de identidad' || identificacion != ''){
        alert('Debe identificarse antes de enviar preguntas');
    }
    else{
    }        
}


//function expandir(id){
//    var divid = document.getElementById("preg"+id);
//    if(divid.style.visibility == "hidden"){
//        divid.style.visibility = "visible";
//        divid.style.height = "auto";
//        divid.style.fontSize = "10px";
//    }
//    else{
//        divid.style.visibility = "hidden";
//        divid.style.height = "0px";
//        divid.style.fontSize = "0px";
//    }        
//}


function expandir(id){
    var divid = document.getElementById("preg"+id);
    if(divid.style.display == 'none'){
        divid.style.display = 'block';
        divid.style.height = "auto";
        divid.style.fontSize = "10px";
    }
    else{
        divid.style.display = 'none';
        divid.style.height = "0px";
        divid.style.fontSize = "0px";
    }        
}
