

/*SCRITP PARA O IMOBSYS FUNCIONAR*/
function mudaCor(myTr,myCor){
	myTr.className=myCor;
}

function abreDet(url2){
	if (window.screen.height > "600"){
		rola2="no";
		width2="773";
		height2="587";
		posTop2=(window.screen.height - height2)/2;
		posLeft2=(window.screen.width - width2)/2;
	}
	else{
		rola2="yes";
		width2="792";
		height2="510";
		posTop2="0";
		posLeft2="0";
	}
	window.open(url2,"_blank","resizable=no,toolbar=no,status=yes,top=" + posTop2 + ",left=" + posLeft2 + ",menubar=no,scrollbars=" + rola2 + ",width=" + width2 + ",height=" + height2);
}

function abreDentro(url){
	if (window.screen.height > 600){
		rola="no";
		width="660";
		height="356";
		posTop=(window.screen.height - height)/2;
		posLeft=(window.screen.width - width)/2;
	}
	else{
		rola="yes";
		width="792";
		height="510";
		posTop="0";
		posLeft="0";
	}
	window.open(url,"_blank","resizable=no,toolbar=NO,status=yes,top=" + posTop + ",left=" + posLeft + ",menubar=no,scrollbars=" + rola + ",width=" + width + ",height=" + height);
}

function abreUrlNew(url, width, height, scrools){
	win=window.open(url,"","width="+width+",height="+height+",top=100, left=200, scrollbars="+scrools+", resizable=YES, status=no");
	return win;
}

function abreUrlHidden(url, width, height,scrools){
	win=window.open(url,"","width="+width+",height="+height+",top=200, left=200, scrollbars="+scrools+", resizable=NO");
	return win;
}

/*fim SCRIPT PARA O IMOBSYS FUNCIONAR*/




function Abre(url, width, height, rola)	{						
	if (rola==""){rola="yes"}
	window.open(url,"_blank","resizable=no,toolbar=no,status=no,top=" + (window.screen.height - height)/2 + ",left=" + (window.screen.width - width)/2 + ",menubar=no,scrollbars=" + rola + ",width=" + width + ",height=" + height);
}

/*função para abrir o flash sem dar erro*/
function montaFlash(destino, flavez, width, height, trans, scale){
	var myFlash = 
		'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+flavez+'" align="middle">'+
		'<param name="allowScriptAccess" value="sameDomain" />'+
		'<param name="movie" value="'+flavez+'.swf" />' +
		'<param name="menu" value="false" />'
	;
	if (trans == "yes"){
		myFlash += '<param name="wmode" value="transparent" />';
	}
	if (scale == "yes"){
		myFlash += '<param name="scale" value="noscale" />';
	}
	myFlash +=
		'<param name="quality" value="high" />'+
		'<param name="bgcolor" value="#ffffff" />'+
		'<embed src="'+flavez+'.swf" quality="high" width="'+width+'" height="'+height+'" name="empresas" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />'+
		'</object>'
	;
	document.getElementById(destino).innerHTML = myFlash;
}

/* valida o e-mail */
function validaEmail(email){
	ER = new RegExp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]{2,64}(\.[a-z0-9-]{2,64})*\.[a-z]{2,4}$");
    if (ER.test(email)){
    	return true;
    }
    else{
    	return false;
    }
}

/* oculta a div conteudo qndo clicar em principal */
function ocultaConteudo(){
	document.getElementById("conteudo").style.display = "none";
}

/* função que gera mascara para input */
function mascara(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(0,1);
	
	var texto = mask.substring(i)
	
	if (texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}


