function focus(){	alert('oi');	if (document.getElementById("formulario:campoUser")=="[object]")		document.getElementById("formulario:campoUser").focus();}// JavaScript Document//document.body.onload = function() {//	alert("oi 2");	//document.getElementById()//}function DisplaySite(div, state){	var div = document.getElementById(div);	div.style.display = state;}function loadFlash(archive, width, height, img){		document.write("<object type='application/x-shockwave-flash' data='"+  archive +"' width='"+ width +"' height='"+ height +" '><param name='movie' value='"+ archive +"' /><param name='wmode' value='transparent' /><img src='" + img + "' width='"+ width +"' height='"+ height +"' alt='' /></object>");		}function zebra(listagem, class1, class2){		var tbl = document.getElementById(listagem);		var trs = tbl.getElementsByTagName("tr");		for(var i = 0; i < trs.length; i++){			if((i + 1) % 2 == 0){				if(navigator.appName == "Microsoft Internet Explorer"){					trs[i].className = class1;				} else {					trs[i].setAttribute("class", class1);				}							} else {				if(navigator.appName == "Microsoft Internet Explorer"){					trs[i].className = class2;				} else {					trs[i].setAttribute("class", class2);				}			}		}	}	 //mascara generica em javascript   function mascaraTexto(evento, mascara){            var campo, valor, i, tam, caracter;            if (document.all) // Internet Explorer         campo = evento.srcElement;      else // Nestcape, Mozzila          campo= evento.target;                valor = campo.value;      tam = valor.length;            for(i=0;i<mascara.length;i++){         caracter = mascara.charAt(i);         if(caracter!="9")             if(i<tam & caracter!=valor.charAt(i))               campo.value = valor.substring(0,i) + caracter + valor.substring(i,tam);                        }   }  function mostrarSombra() {		//alert(screen.height + "\n" + screen.availHeight);		var divSombra = document.getElementById("divSombra");	divSombra.style.width = screen.availWidth;	divSombra.style.height = screen.availHeight;	divSombra.style.display = "block";		divSombra.style.top = document.body.scrollTop; 	var divTextoEspera = document.getElementById("divTextoEspera");	divTextoEspera.style.width = screen.availWidth;	divTextoEspera.style.height = screen.availHeight;	divTextoEspera.style.display = "block";	divTextoEspera.style.top = document.body.scrollTop;}function esconderSombra() {	var divSombra = document.getElementById("divSombra");	divSombra.style.display = "none";	var divTextoEspera = document.getElementById("divTextoEspera");	divTextoEspera.style.display = "none";}function desabilitarCamposRemanejamento() {	document.getElementById("formulario:opcao").disabled = true;	document.getElementById("formulario:idPoloEsquerda").disabled = true;	document.getElementById("formulario:idPoloDireita").disabled = true;	document.getElementById("formulario:idNucleoEsquerda").disabled = true;	document.getElementById("formulario:idNucleoDireita").disabled = true;	document.getElementById("formulario:idTurmaEsquerda").disabled = true;	document.getElementById("formulario:idTurmaDireita").disabled = true;} function habilitarCamposRemanejamento() {	document.getElementById("formulario:opcao").disabled = false;	document.getElementById("formulario:idPoloEsquerda").disabled = false;	document.getElementById("formulario:idPoloDireita").disabled = false;	document.getElementById("formulario:idNucleoEsquerda").disabled = false;	document.getElementById("formulario:idNucleoDireita").disabled = false;	if (document.getElementById("formulario:opcao:1").checked) {		document.getElementById("formulario:idTurmaEsquerda").disabled = true;		document.getElementById("formulario:idTurmaDireita").disabled = true;	} else {		document.getElementById("formulario:idTurmaEsquerda").disabled = false;		document.getElementById("formulario:idTurmaDireita").disabled = false;	}		return false;}  addEvent = function(o, e, f, s){	var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;	r[r.length] = [f, s || o], o[e] = function(e){		try{			(e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});			e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});			e.target || (e.target = e.srcElement || null);			e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;		}catch(f){}		for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));		return e = null, !!d;    }};removeEvent = function(o, e, f, s){	for(var i = (e = o["_on" + e] || []).length; i;)		if(e[--i] && e[i][0] == f && (s || o) == e[i][1])			return delete e[i];	return false;};MaskInput = function(f, m){	function mask(e){		var patterns = {"1": /[A-Z]/i, "2": /[0-9]/, "4": /[\xC0-\xFF]/i, "8": /./ },			rules = { "a": 3, "A": 7, "9": 2, "C":5, "c": 1, "*": 8};		function accept(c, rule){			for(var i = 1, r = rules[rule] || 0; i <= r; i<<=1)				if(r & i && patterns[i].test(c))					break;				return i <= r || c == rule;		}		var k, mC, r, c = String.fromCharCode(k = e.key), l = f.value.length;		(!k || k == 8 ? 1 : (r = /^(.)\^(.*)$/.exec(m)) && (r[0] = r[2].indexOf(c) + 1) + 1 ?			r[1] == "O" ? r[0] : r[1] == "E" ? !r[0] : accept(c, r[1]) || r[0]			: (l = (f.value += m.substr(l, (r = /[A|9|C|\*]/i.exec(m.substr(l))) ?			r.index : l)).length) < m.length && accept(c, m.charAt(l))) || e.preventDefault();	}	for(var i in !/^(.)\^(.*)$/.test(m) && (f.maxLength = m.length), {keypress: 0, keyup: 1})		addEvent(f, i, mask);};function limitText(limitField, limitNum) {    if (limitField.value.length > limitNum) {        limitField.value = limitField.value.substring(0, limitNum);    } };function verificaEnter(evento){   	if (!teclaEnter(evento)){  		return false;	}	return true;}function teclaEnter(evento){   var campo;   if (document.all) // Internet Explorer         campo =  evento.srcElement.type;      else // Nestcape, Mozzila          campo= evento.target.type;           if (campo == "textarea"){    return true;   }      var tecla;   tecla = evento.keyCode;   	if (tecla == 13){  		return false;	}	return true;}function habilitaEnter(evento){	return true;}function marcarAlteracao(obj, concordou) {	if(concordou == 'true') {		obj.style.border="1px solid red";	}}function marcarAlteracaoTable(obj, concordou) {	if(concordou == 'true') {		var elemento = getParent(obj,"TABLE");		elemento.setAttribute("border","1");		elemento.setAttribute("bordercolor","red");	}}function getParent(filho, type) {	var obj = filho.parentNode;	while(obj.tagName != type) {		obj = obj.parentNode;		if(obj.tagName == type) {			return obj;		}	}	return obj;}