
<!--
// bSupportsDHTML = true para Internet Explorer 4 o mayor
var bDoesDHTML = ( (navigator.userAgent.indexOf("MSIE") >= 0) &&
                   (navigator.appVersion.substring(0,1) >= 4) )

// items de menu si browser soporta DHTML
if(bDoesDHTML){document.write("<STYLE>.off{display:none}</STYLE>")}


function doSection(secNum){
  if (bDoesDHTML){
    if (secNum.className=="off"){secNum.className="on"}
    else{secNum.className="off"}
  }
}

function addFilt(oWhich)
{
        oWhich.style.filter="glow(color=red, strength=5)"
}
function removeFilt(oWhich)
{
        oWhich.style.filter=" "
}

function makeArray(m)
{
  this.length = m;
  for (i=1;i<=m;i++)
  {
    this[i]=0;
  }
  return this;
}

//-->

//fecha

function fechahoy() {
  var diasemana = new Array('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado');
  var nombremes = new Array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre');
  var ahora;
  var fecha = new Date();
  var anio = fecha.getYear();
  var mes = fecha.getMonth();
  var dia = fecha.getDay();
  var num = fecha.getDate();
  ahora = diasemana[dia] + ", " + num + " de " + nombremes[mes] + " de " + anio;
  return ahora;
}

//menus

function mOvr(src,clrOver) {
    if (!src.contains(event.fromElement)) {
          src.style.cursor = 'hand';
          src.bgColor = clrOver;
        }
  }
  function mOut(src,clrIn) {
        if (!src.contains(event.toElement)) {
          src.style.cursor = 'default';
          src.bgColor = clrIn;
        }
  }
  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
          src.children.tags('A')[0].click();
    }
  }

function TSimpleMenu( sName ) {
/*** interface ***/

        // *** private properties
        this.name = sName;
        this.interval = 300;
        this.arrLayers = new Array();
        this.arrStatus = new Array();
        this.menuTimer = null;

        // simple browser check
        this.isIE = ( window.navigator.userAgent.indexOf( 'MSIE' ) > 0 );
        this.isGecko = ( window.navigator.userAgent.indexOf( 'Gecko' ) > 0 );
        this.isNS = ( window.navigator.userAgent.indexOf( 'Netscape' ) > 0 );
        if ( this.isIE )
                this.browser = 'IE'
        else if ( this.isGecko )
                this.browser = 'MZ'
        else
                this.browser = 'NS';

        this.visible = ( this.browser != 'NS' ) ? 'visible' : 'show';
        this.hidden  = ( this.browser != 'NS' ) ? 'hidden'  : 'hide';

        // *** public methods
        this.Add                        = TSimpleMenu_Add;
        this.OnOver                        = TSimpleMenu_OnOver;
        this.OnOut                        = TSimpleMenu_OnOut;

        // *** private methods
        this.GetLayer                = TSimpleMenu_GetLayer;
        this.LayerListener        = TSimpleMenu_LayerListener;
        this.callTimer                = TSimpleMenu_callTimer;
        this.clearTimer                = TSimpleMenu_clearTimer;

/*** implementation ***/

        // adds a new Layer -- expects a string name
        function TSimpleMenu_Add( sObject ) {
                this.arrLayers.length ++;
                this.arrLayers[ this.arrLayers.length - 1 ] = sObject;
                this.arrStatus.length ++;
                this.arrStatus[ this.arrStatus.length - 1 ] = 1;
        }

        // get the layer object -- browser check
        function TSimpleMenu_GetLayer( sObject ) {
                // var oObj = ( this.browser == 'IE' ) ? document.all( sObject ) : document.layers[ sObject ];
                if ( this.browser == 'IE' )
                        var oObj = document.all( sObject )
                else if ( this.browser == 'NS' )
                        var oObj = document.layers[ sObject ]
                else
                        var oObj = document.getElementById( sObject );

                if ( oObj && ( this.browser != 'NS' ) ) {
                        var oObj = oObj.style;
                }
                return oObj;
        }

        // the mouseover event -- expects the layer name
        function TSimpleMenu_OnOver( sObject ) {
                if ( !this.menuTimer ) {
                        this.callTimer();
                }

                var hasFound = false;
                for ( var i = 0; i < this.arrLayers.length; i ++ ) {
                        var oObj = this.GetLayer( this.arrLayers[ i ] );
                        if ( oObj ) {
                                if ( this.arrLayers[ i ] != sObject ) {
                                        oObj.visibility = this.hidden;
                                } else {
                                        oObj.visibility = this.visible;
                                        this.arrStatus[ i ] = 1;
                                        hasFound = true;
                                }
                        }
                }

                if ( !hasFound ) {
                        this.Add( sObject );
                        var oObj = this.GetLayer( sObject );
                        if ( oObj )
                                oObj.visibility = this.visible;
                }
        }

        // the mouseout event -- expects the layer name
        function TSimpleMenu_OnOut( sObject ) {
                for( var i = 0; i < this.arrLayers.length; i ++ )
                        if ( this.arrLayers[ i ] == sObject ) {
                                this.arrStatus[ i ] = 0;
                                break;
                        }
        }

        // menu controller simple thread -- controls the mouseout events asynchronously
        function TSimpleMenu_LayerListener() {
                for( var i = 0; i < this.arrStatus.length; i ++ )
                        if ( this.arrStatus[ i ] != 1 ) {
                                this.arrStatus[ i ] = 1;
                                oObj = this.GetLayer( this.arrLayers[ i ] ) ;
                                if ( oObj ) {
                                        oObj.visibility = this.hidden;
                                        break;
                                }
                        }
        }

        function TSimpleMenu_callTimer() {
                this.clearTimer();
                this.menuTimer = setInterval( this.name + '.LayerListener()', this.interval );
        }

        function TSimpleMenu_clearTimer() {
                if ( this.menuTimer != null )
                        clearInterval( this.menuTimer );
                this.menuTimer = null;
        }
}

var oMenu = new TSimpleMenu( 'oMenu' );






function esletra(o)
{
  var v = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ';
  var i = o.value;
  var ai = i.charAt(i.length-1);
  var s = v.indexOf(ai,0);
  if (s == -1)
  {
    alert('No se permiten digitos numericos en este campo,\npor favor vuelva a escribir');
    o.value = '';
    o.focus();
  }
}

function esemail(f)
{
  var e = f.value;
  var a = e.indexOf('@',1);
  var b = e.indexOf('.',1);
  if ((a == -1) || (b == -1))
  {
    alert('Esta no es una direccion de correo electronico valida,\npor favor vuelva a escribir');
    f.value = '';
    //f.focus();
  }
}

function esnumero(p)
{
  var v = '0123456789.';
  var i = p.value;
  var ai = i.charAt(i.length-1);
  var s = v.indexOf(ai,0);
  if (s == -1)
  {
    alert('No se permiten caracteres alfabeticos en este campo,\npor favor vuelva a escribir');
    p.value = '';
    p.focus();
  }
}

function esdia(r)
{
  var i = r.value;

  if ((i < 1) || (i > 31))
  {
    alert('Número de día incorrecto,\npor favor vuelva a escribir');
    r.value = '';
    r.focus();
  }
}

function esanno(q)
{
  var i = q.value;

  if ((i < 1990) || (i > 2002))
  {
    alert('Número de año incorrecto,\npor favor vuelva a escribir');
    q.value = '';
    q.focus();
  }
}

//-------------------------------------------------
function compruebadatos()
{
  var c = document.form1.prest.value;
  var m = document.form1.cuota.value;
  var i = document.form1.inter.value;
  var p = document.form1.plazo.value;

  if ((c != '') && (m == '') && (i != '') && (p != ''))
  {
    var c = parseFloat(document.form1.prest.value);
    var i = parseFloat(document.form1.inter.value);
    var p = parseFloat(document.form1.plazo.value);
    document.form1.cuota.value = Math.round(((c*Math.pow(1+(i/100)/12,p)*((i/100)/12))/(Math.pow(1+(i/100)/12,p)-1))*100)/100;
  }
  if ((c == '') && (m != '') && (i != '') && (p != ''))
  {
    var m = parseFloat(document.form1.cuota.value);
    var i = parseFloat(document.form1.inter.value);
    var p = parseFloat(document.form1.plazo.value);
    document.form1.prest.value = Math.round(((m*(Math.pow(1+(i/100)/12,p)-1))/(Math.pow(1+(i/100)/12,p)*((i/100)/12)))*100)/100;
  }
  if ((c != '') && (m != '') && (i != '') && (p == ''))
  {
    var c = parseFloat(document.form1.prest.value);
    var m = parseFloat(document.form1.cuota.value);
    var i = parseFloat(document.form1.inter.value);
    document.form1.plazo.value = Math.round((

    Math.log(m/(m-c*((i/100)/12)))/Math.log(((i/100)/12)+1)

    )*100)/100;
  }
  if ((c != '') && (m != '') && (i == '') && (p != ''))
  {
    var c = parseFloat(document.form1.prest.value);
    var m = parseFloat(document.form1.cuota.value);
    var p = parseFloat(document.form1.plazo.value);
    document.form1.inter.value = Math.round((

    Math.log(m/(m-c*((i/100)/12)))/Math.log(((i/100)/12)+1)

    )*100)/100;


  }
  if ((c != '') && (m != '') && (i != '') && (p != ''))
        alert ("Tiene que dejar uno de los datos vacío.");
  if (((c == '') && (m == '')) || ((c == '') && (i == '')) ||
      ((c == '') && (p == '')) || ((m == '') && (i == '')) ||
      ((m == '') && (p == '')) || ((i == '') && (p == '')))
        alert ("Tiene que introducir por lo menos tres datos.");

//  if (capital < mensualidad && !(document.forms[0].elements[0].value == ""))
//  {
//    alert ("La cuota no puede ser mayor que el importe inicial!");
//    document.forms[0].elements[3].focus();
//    return;
//  }

}

function calculofact()
{
  var salario = document.form1.salb.value;

  if (salario == '')
        alert ("Tiene que llenar el dato 'Salario bruto'.");
		
  if (salario < 2588)
        alert ("Este cálculo se realiza con salarios mayores a 4 sueldos mínimos, es decir mayores a 2588 Bs");

  var salario = parseFloat(document.form1.salb.value);

  var seg_soc=parseFloat(salario*0.1221);

  var liq_pag= parseFloat(salario-seg_soc);
  
  var sal_min= parseFloat(2*647);
   
  var dif= parseFloat(liq_pag-sal_min);
  
  var imp= parseFloat(dif*0.13);
  
  var imp_salmin= parseFloat(1294*0.13);
  
  var imp_pagar= parseFloat(imp-(sal_min)*0.13);
   
  document.form1.fact.value = Math.round((

  (imp_pagar*100)/13

  )*100)/100;

  var f = parseFloat(document.form1.fact.value);

  document.form1.impp.value = Math.round((

  f*0.13

  )*100)/100;

}
