function destacarOver(obj,color) {
	bgAntigo = obj.style.backgroundColor;
	obj.style.backgroundColor = color;
	obj.style.cursor = 'pointer';
}


function destacarOut(obj) {
	obj.style.backgroundColor = bgAntigo;
}


function SNconfirm(txt){
	return typeof(suporteVBscript)=="undefined"?confirm(txt):VBconfirm(txt)==6
}



function enviar_form(id) {
	var MyForm;
	MyForm = document.getElementById("form_"+id);
	MyForm.submit();
}



function popimage(url,width,height) {
	window.open(url,'popimage','width='+width+',height='+height+',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,left=200,top=150');
}



function AbreJanela(url, width, height, nome, scrollbars, modo) {
	var porcento = 0;
	v_width = screen.width;
	v_height = screen.height;
	var top; var left;
	if (v_width >= 1024 && v_height >= 768 && modo == "sim") {
		porcento = height*0.15;
		height = Number(height)+porcento;
	}
	top = ( (v_height/2) - (height/1.75) )
	left = ( (v_width/2) - (width/2) )
	window.open(url, nome,'width='+width+',height='+height+',scrollbars='+scrollbars+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left='+left+',top='+top);
}

function AbreDialog(url, width, height) {
	configuracao = "dialogWidth="+width+"px; dialogHeight:"+height+"px; center:yes; status:no; scroll:no; help:no;";
	window.showModelessDialog(url,null,configuracao);
}

function validaPaginacao(){
	if(!isNaN(form_paginacao.pagina.value) && form_paginacao.pagina.value != ""){
		return true;
	}else{
		alert("Página Inválida!");
		form_paginacao.pagina.focus();
		return false;
	}
}



function tab_fim(eventObj,obj,n){
	var keycode
	
	if (document.all){ 
		keyCode=eventObj.keyCode;
	}else{
		keyCode=eventObj.which;
	}
	
	 if(obj.value.length >= n){
		eventObj.keyCode = 9;
		return true;
	}
}
