var IE_all_cache = new Object();
function IE_getElementById(id) {
  if (IE_all_cache[id] == null) {
    IE_all_cache[id] = document.all[id];
  }
  return IE_all_cache[id];
}

if (document.all) {
  if (!document.getElementById) {
    document.getElementById = IE_getElementById;
  }
}

//-----------------------------------
// Browser detection
var agt = navigator.userAgent.toLowerCase();
var is_opera = (agt.indexOf("opera") != -1);
var is_ie = (agt.indexOf("msie") != -1) && document.all && !is_opera;
var is_ie5 = (agt.indexOf("msie 5") != -1) && document.all;


function valida()
{
	var l1 = window.document.form_login.usuario;
	var l2 = window.document.form_login.senha;

    if ( l1.value.length == 0 ) {
		alert("Digite o Seu Login !!");     l1.focus();     return false;
	}
	if ( !valida_texto(l1.value) ) {
		alert("Por favor, não utilize tags html !!");     l1.focus();     return false;
	}
	
    if ( l2.value.length == 0 ) {
		alert("Digite sua Senha !!");     l2.focus();     return false;
	}
	if ( !valida_texto(l2.value) ) {
		alert("Por favor, não utilize tags html !!");     l2.focus();     return false;
	}

    var botao = document.getElementById('btnOk');
    if ( botao != null ) {
        botao.style.enabled = false;
	}
    return true;
}

function valida_texto(texto) {
	if ( texto.indexOf("<") >= 0 || texto.indexOf(">") >= 0 || texto.indexOf("javascript") >= 0 || texto.indexOf("Javascript") >= 0 || texto.indexOf("JavaScript") >= 0 ) {
		return false;
	} else {
		return true;
	}
}