// JavaScript Document
function showFoto(codigo) {
	window.open('FotoAction?cod=' + codigo,'Foto' + codigo,'width=520,height=400,left=50,top=50,resizable=no');	
}

function Trim(str) {
  var result = "";
  if (str) {
    result = str.toString().replace(/(^\s+)|(\s+$)/g, '');
  }
  return result;
}

function alteraBarraDeStatus(evt, texto) {
	window.status =	texto;
    if (evt.preventDefault) {
      evt.preventDefault();
      evt.stopPropagation();
    } else {
      evt.keyCode = 0;
      evt.returnValue = false;
    }
	return false;
}

function encode(str) {
	var result = "";
	
	for (i = 0; i < str.length; i++) {
		if (str.charAt(i) == " ") result += "+";
		else result += str.charAt(i);
	}
	
	result = escape(result);
	
	return result;
}

function hideElement(obj) {
	document.getElementById(obj).style.visibility = 'hidden';
}

function showElement(obj) {
	document.getElementById(obj).style.visibility = 'visible';
}

function imprimirPagina() {
	window.print();	
}

function abrirPopap(url,largura,altura,scrollBar){
    window.open(url,"janela","width="+largura+",height="+altura+",scrollbars="+scrollBar + ", top=100, left=100");	
}
