//Sub menu
//Abrir popup
function janela(mypage, myname, w, h, scroll, resid) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top=50,left=50,scrollbars='+scroll+',resizable='+ resid
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//Buscar URL
function selecione(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//Deixa o select true
function selSelectBox(object,valor) {
	 for (var i=0;i<object.length;i++) {
		  if (object.options[i].value == valor){
		object.options[i].selected=true;
		}
	 }
}

//Conta numero de caracteres no TXTAREA
function contaCaracter(vc_campo,it_caracter,it_limite) {
	if (vc_campo.value.length > it_limite) {
		vc_campo.value	= vc_campo.value.substring(0,it_limite);
	} else {
		it_caracter.value = it_limite - vc_campo.value.length;
	}
}
//
function jumpFiltro(targ,pag,selObj,restore){
  var valor=selObj.options[selObj.selectedIndex].value;
  if (!valor==""){
	  window.location.href=pag+"?busca="+valor;
	  if (restore) selObj.selectedIndex=0;
  }
  
}
	
