function resttd(lay){
		
}
function td( branch ){ 

	if ( document.getElementById( branch ) != null )
	{
		var objBranch = document.getElementById( branch ).style;
		
		if ( ( objBranch.display == 'block' ) || ( objBranch.display == '' ) )
		{
			objBranch.display = 'none';
		}
		else
		{   
			objBranch.display = 'block'; 
		}
	}
}

function janela(url, w, h, scroll){
	window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=" + scroll + ",status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}
function janela2(url, w, h, scroll){
	window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}
function videom() {
        self.location = document.mus.musc.options[document.mus.musc.selectedIndex].value;
}
function videoe() {
        self.location = document.erg.ergo.options[document.erg.ergo.selectedIndex].value;
}
function fotos(url, w, h){
window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}
function goto() {
        self.location = document.datagoto.data.options[document.datagoto.data.selectedIndex].value;
}

function val_busca(){
	if(document.all.busca.value.length < 3){
		alert('Para se fazer a busca deve-se digitar pelo menos 3 caracteres!');
		return false;
	}
	return true;
}

function click()
			{
			if (event.button==2) {
				//alert('Cópia parcial ou total de conteúdo protegidas por direitos autorais.');
				//return false;
				}
				}
				document.onmousedown=click


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }

var b = new BrowserInfo();
left = (b.screenWidth / 2) - (width / 2)
top = (b.screenHeight / 2) - (height / 2)

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function BrowserInfo()
{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
}


function imovel(url, w, h){
window.open(url,"","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=yes, width= " + w + ", height = " + h + ", top=0,left=0")
}

function openPic(url){
newWindow=window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
newWindow.document.write('<html><head><title>Martinelli Imobilíaria</title>')
newWindow.document.write('<body oncontextmenu="return false;" onLoad="self.resizeTo(document.images[0].width,document.images[0].height+30);" topmargin="0" leftmargin="0"><img onmoveend="return false;" src="'+url+'"></body></html>')
newWindow.location.reload();
newWindow.focus();
}


function EntraValorNumerico(field) {
	if (event.keyCode >= 48 && event.keyCode <= 57)
		return true;
	return false;
}