/*
 * New Project 1
 * Copyright(c) 2006, Jack Slocum.
 * 
 * This code is licensed under BSD license. Use it as you wish, 
 * but keep this copyright intact.
 */

// JavaScript Document

function CheckNumber(sId) {
  var ref   = document.getElementById(sId);
  var value = parseInt(ref.value);
  if (isNaN(value)) {
     alert('Somente valores num�ricos permitidos');
  }
}

function CheckSelAction(sId,sTxt) {
  var refsel   = document.getElementById(sId);
  var reftxt   = document.getElementById(sTxt);
  var value    = refsel.options[refsel.selectedIndex].value;

  if (value == '0') {
     reftxt.value = "";
     reftxt.disabled = true;
  } else if (value == '1') {
     reftxt.disabled = false;
  }
}

function SACFinish(sid) {
  var form = document.getElementById(sid);
   form.submit();
}

function resizeIframe() {
    var iAlt = 0;
        var iFrm = parent.document.getElementById('fmain');
        if (iFrm!=null) {
        if (navigator.appName.toLowerCase().indexOf('microsoft internet explorer') > -1) {
            iAlt = document.body.offsetHeight;
            iFrm.style.height = iAlt + 0 + "px";
        } else {
        if (navigator.appName.toLowerCase().indexOf('netscape') > -1) {
            iAlt = parent.document.getElementById('fmain').contentWindow.document.body.parentNode.offsetHeight;
            parent.document.getElementById('fmain').style.height = iAlt + 10 + "px";
        } }
    }
}

function abrirPop(sUrl,iLrg,iAlt,sScr) {
    var iEsq = parseInt((screen.width-iLrg)/2);
    var iTop = parseInt((screen.height-iAlt)/2);
    var sWin = window.open(sUrl,'','width='+iLrg+',height='+iAlt+',toolbar=no,location=no,status=no,menubar=no,scrollbars='+sScr+',resizable=yes');
    sWin.moveTo(iEsq,iTop);
}

function fechaPop() {
        window.close();
}
