if (setNoMenorQueCero($idsolicitud) <= 0) {
    $idsocio = getPersonaEnSession();
    $oFrm->addCreditBasico();
    $oFrm->addSubmit();
    echo $oFrm->get();
    //echo $xJs->get();
    $idsolicitud = DEFAULT_CREDITO;
    //exit( "<p class='aviso'>AGREGUE UN NUMERO DE SOLICITUD</p></body></html>");
} else {
    $oFrm->OButton("TR.Recargar", "jsRecargar()", "refrescar", "refrescar");
    //Tabs
    $xHTabs = new cHTabs();
    $xBtn = new cHButton("");
    $xCred = new cCredito($idsolicitud);
    if ($xCred->init() == false) {
        $idsocio = getPersonaEnSession();
        $oFrm->addToolbar($xBtn->getRegresar("../index.xul.php?p=frmcreditos/creditos.panel.frm.php", true));
        $oFrm->addCreditBasico();
        $oFrm->addSubmit();
        $oFrm->addAviso($xCred->getMessages());
        //echo $oFrm->get();
    } else {
        if (setNoMenorQueCero($idsocio) <= 0) {
            $idsocio = $xCred->getClaveDePersona();
        }
        $xOPdto = $xCred->getOProductoDeCredito();
        if ($idsocio != $xCred->getClaveDePersona()) {
            $msg = "ERROR\tLa Persona {$idsocio} no es la propietaria del credito, el credito marca " . $xCred->getClaveDePersona() . "\r\n";
            $oFrm->addToolbar($xBtn->getRegresar("../index.xul.php?p=frmcreditos/creditos.panel.frm.php", true));
            $oFrm->addAviso($msg);
        } else {
$action = parametro("action", SYS_NINGUNO);
$txt = "";
$xFRM = new cHForm("frmcreditoautorizado", "frmcreditosautorizados.php?action=2", "frmcreditoautorizado");
$xSel = new cHSelect();
$xTxt = new cHText();
$xTxt2 = new cHText();
$xBtn = new cHButton();
$msg = "";
$jsInit = "";
$remoto = false;
if (setNoMenorQueCero($credito) > DEFAULT_CREDITO and $action == SYS_NINGUNO) {
    $xCred = new cCredito($credito);
    $xCred->init();
    $persona = $xCred->getClaveDePersona();
    $jsInit = "jsInit()";
    getPersonaEnSession($persona);
    $remoto = true;
}
$xFRM->addDataTag("role", "autorizacion");
function jsaGetDatos($solicitud)
{
    if ($solicitud != 0 and $solicitud != '') {
        $xCred = new cCreditos_solicitud();
        $xCred->setData($xCred->query()->getRow("numero_solicitud={$solicitud}"));
        $pagos = $xCred->numero_pagos()->v();
        $monto = $xCred->monto_solicitado()->v();
        $periocidad = $xCred->periocidad_de_pago()->v();
        $tasa = $xCred->tasa_interes()->v();
        $xF = new cFecha();
        $xT = new cTipos();
        $tab = new TinyAjaxBehavior();
function jsaSetSocioEnSession($socio)
{
    getPersonaEnSession($socio);
}
 function getDeSocio($id = "", $SinBoton = false, $persona = false, $blurEvents = "", $titulo = "")
 {
     $this->mArrProp["type"] = "number";
     $this->mArrProp["class"] = "mny";
     $this->mArrProp["name"] = "idsocio{$id}";
     $persona = setNoMenorQueCero($persona) < 0 ? getPersonaEnSession() : $persona;
     $this->mValue = $persona;
     $this->mArrProp["maxlength"] = "18";
     $xLn = new cLang();
     //$titulo			= $xLn->get("clave de persona");//($titulo == "") ? $xLn->get("clave de persona") : $xLn->getT($titulo);
     $titulo2 = $titulo == "" ? $xLn->get("nombre completo") : $xLn->getT($titulo);
     //$this->addEvent("envsoc()", "onchange");
     $this->addEvent("var xPG = new PersGen();xPG.getNombre(this.value, 'nombresocio{$id}');{$blurEvents}", "onblur");
     $this->mIncLabel = true;
     if ($SinBoton == false) {
         $xBtn = new cHImg();
         $this->setClearHTML();
         $this->addHTMLCode($xBtn->get16("common/search.png", " onclick=\"var xPG = new PersGen();xPG.getFormaBusqueda('idsocio{$id}');\" "));
     }
     $xhNSocio = new cHInput("nombresocio{$id}", "", $titulo2);
     $xhNSocio->setIncludeLabel(false);
     $xhNSocio->setProperty("name", "nombresocio{$id}");
     $xhNSocio->setProperty("disabled", "true");
     $this->setDivClass("tx14");
     $xhNSocio->setDivClass("tx34");
     return "<div class='tx1'> " . $this->get("idsocio{$id}", $persona, $xLn->get("clave de persona")) . $xhNSocio->get("nombresocio{$id}") . "</div>";
 }
 function show($Devolver = false)
 {
     $token = SAFE_VERSION . SAFE_REVISION;
     $jsCalendarBody = "";
     $jsJQueryUI = $this->strJQueryIncs;
     $jsCalendarIncludes = "";
     $jsLoadDef = $this->mLoadVals == true ? "true" : "false";
     //$jsCaptacion
     $jsCalendarIncludes = "\t<link rel=\"stylesheet\"  media=\"all\" href=\"" . $this->mSubPath . "./js/jscalendar/calendar-green.css\" title=\"green\" />\n\t\t\t\t\t\t\t\t<script  src=\"" . $this->mSubPath . "./js/jscalendar/calendar.js\"></script>\n\t\t\t\t\t\t\t\t<script  src=\"" . $this->mSubPath . "./js/jscalendar/lang/calendar-es.js\"></script>\n\t\t\t\t\t\t\t\t<script  src=\"" . $this->mSubPath . "./js/jscalendar/calendar-setup.js\"></script>";
     $jsMD5Include = "<script  src='" . $this->mSubPath . "./js/md5.js'></script>";
     /**
      * Include Segmentados
      */
     $jsRecibos = $this->mIncludeRecibos == false ? "" : $this->getJsRecibos();
     $jsSocios = $this->mIncludeSocio == false ? "" : $this->getJsSocios();
     $jsCreditos = $this->mIncludeCreditos == false ? "" : $this->getJsCreditos();
     $jsCaptacion = $this->mIncludeCaptacion == false ? "" : $this->getJsCaptacion();
     $jsCommon = $this->mIncludeCommon == false ? "" : $this->getJsCommon();
     $jsGrupos = $this->mIncludeGrupos == false ? "" : $this->getJsGrupos();
     $idsolicitud = $this->mInputs["codigo_de_solicitud"]["name"];
     $nombresolicitud = $this->mInputs["descripcion_de_la_solicitud"]["name"];
     $idsocio = $this->mInputs["codigo_de_socio"]["name"];
     $idcuenta = $this->mInputs["codigo_de_cuenta"]["name"];
     $nombrecuenta = $this->mInputs["descripcion_de_la_cuenta"]["name"];
     $claveSocio = getPersonaEnSession();
     foreach ($this->mArrCalendarJs as $key => $value) {
         $jsCalendarBody .= $value;
     }
     if ($this->mIncludeCalendar == false) {
         $jsCalendarIncludes = "";
         $jsCalendarBody = "";
     }
     //================================	PRINCIPAL
     $js = "\n\t\t\t{$jsCalendarIncludes}\n\t\t\t{$jsJQueryUI}\n\t\t\t<script src='" . $this->mSubPath . "./js/jsrsClient.js'></script>\n\t\t\t<!-- <script src='" . $this->mSubPath . "./js/general.js?{$token}'></script> -->\n\t\t\t<script>\n\t\t\tvar jsrFile \t\t\t\t= \"" . $this->mSubPath . "./clsfunctions.inc.php\";\n\t\t\tvar jsWorkForm\t\t\t\t= document." . $this->mForm . ";\n\t\t\tvar jsrCreditsCommon\t\t= \"" . $this->mSubPath . "./js/creditos.common.js.php\";\n\t\t\tvar jsrCaptacionCommon\t\t= \"" . $this->mSubPath . "./js/captacion.common.js.php\";\n\t\t\tvar jsrGeneralCommon\t\t= \"" . $this->mSubPath . "./js/general.common.js.php\";\n\t\t\tvar jsrSeguimientoCommon\t= \"" . $this->mSubPath . "./js/seguimiento.common.js.php\";\n\t\t\t\n\t\t\tvar jsTypeCaptacion\t\t\t= " . $this->mTypeCaptacion . ";\n\t\t\tvar setToGo\t\t\t\t\t= true;\n\t\t\tvar mInputsCheck\t\t\t= new Array();\n\t\t\tvar mFiltroCred\t\t\t= \"" . $this->mFiltroCreditos . "\";\n\t\t\tvar vSEPARATOR\t\t\t= \"" . STD_LITERAL_DIVISOR . "\";\n\t\t\tvar mLoadDefs\t\t\t= {$jsLoadDef};\n\t\t\tvar mGlo\t\t\t= new Gen();\n\t\t\tvar esGuardable\t\t\t= false;\n\t\t\tvar autoEjecutar\t\t= true;\n\t\t\tvar enBusqueda\t\t\t= false;\n\t\t\tfunction frmSubmit( evaluate ){\n\t\t\t\t//Valida que los Campos\n\t\t\t\tevaluate = (typeof evaluate != \"undefined\" ) ? evaluate : false;\n\t\t\t\tif ( evaluate == false ){\n\t\t\t\t\tsetToGo = jsEvaluarFormulario(false);\n\t\t\t\t\tif(setToGo == false){\n\t\t\t\t\t\talert(\"Su Formulario contiene errores\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar mGoSubmit\t= confirm(\"Quiere Guardar los Datos Capturados?\");\n\t\t\t\t\t\tif( mGoSubmit == false ){\n\t\t\t\t\t\t\tsetToGo = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tjsWorkForm.submit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tjsWorkForm.submit();\n\t\t\t\t}\n\t\t\t}\n\t\t\t{$jsSocios}\n\t\t\t{$jsCreditos}\n\t\t\t{$jsGrupos}\n\t\t\t{$jsCommon}\n\t\t\t{$jsRecibos}\n\t\t\t{$jsCaptacion}\n\t\t\t{$jsCalendarBody}\n\t\t\tfunction out(msg){ if(typeof msg != \"undefined\"){ console.log(msg); }\t}\n\t\t\tfunction jsLoadNombreValores(){\n\t\t\t\tif(autoEjecutar == true){\n\t\t\t\t\tif(jsWorkForm.{$idsocio}){\n\t\t\t\t\t\tif(\$.trim(jsWorkForm.{$idsocio}.value) == \"\"){ jsWorkForm.{$idsocio}.value = {$claveSocio}; }\n\t\t\t\t\t\tjsWorkForm.{$idsocio}.focus();\n\t\t\t\t\t\tif( entero(jsWorkForm.{$idsocio}.value) > 0 ){ jsSetNombreSocio(); }\n\t\t\t\t\t}\n\t\t\t\t\tif(jsWorkForm.{$idsolicitud}){\n\t\t\t\t\t\tif( entero(jsWorkForm.{$idsolicitud}.value) > 0 ){ jsGetDescCredito(); }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*function jsEvaluarSalida(evt){ if(evt.id =='{$idcuenta}'){ envcta(); } }*/\n\t\t\tjsLoadNombreValores();\n\t\t\t</script>";
     if ($Devolver == false) {
         echo $js;
     } else {
         return $js;
     }
 }