/* Funções de Chat */
/* Atenção - Utilizar apenas a função openChatGeneric */

/// Função Genérica para abertura da janela do Chat
/// 04/Maio/2010
/// Parâmetros:
/// Cidade: Identificador de Cidade/Chamada
/// LocalClique: Local do Clique
/// OpenRedirect: "o" para Open e "r" para Redirect
function openChatGeneric(Cidade, LocalClique, OpenRedirect, idArea, Empreendimento) {
	var URL = "";
	var width, heigth;
	width = 500;
	heigth = 500;
	switch (Cidade) {
		/* São Paulo - Capital ***********************/
		case "SPMask": //Função openChat_SP
			URL = "/Web/Util/Pops/PopChatSPMask.aspx?" + 
					"idarea=" + idArea + 
					"&sel=" + Empreendimento +
					"&origem=" + LocalClique;
			heigth = 650;
			break;
		/*********************** São Paulo - Capital */
		/* São Paulo - Interior **********************/
		/********************** São Paulo - Interior */
		/* Rio de Janeiro ****************************/
		case "RJ": //Função openChat_Rio
			URL = "/Web/Util/Pops/PopChatRio.aspx?" +
					"idarea=" + idArea +
					"&sel=" + Empreendimento +
					"&origem=" + LocalClique;			
			break; 
		case "FichaRio":
			URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel="+ LocalClique +"&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";					
			break;
		case "Header_LivingRJ": 
			if (LocalClique == "rj") { //openChatRioNovo_Header('RJ')
				URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Header_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";					
			} else if (LocalClique == "ni") { //openChatRio_Header('NI')
				URL = "/Web/Util/html/pop_chat.aspx?IDArea=16&sel=Header_LivingRJ&destino=ni";
			}
			break;
		case "HeaderLivingRJ": //openChatRio(idArea, Sel, {'rj'|'ni'})
			URL = "/Web/Util/html/pop_chat.aspx?idrea=" + idArea + "&sel=" + Empreendimento + "&destino=" + LocalClique;
			break;
		case "Sky_LivingRJ": 
			if (LocalClique == "rj") { //openChatRioNovo_Sky('RJ') | openChat_Rio
				URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Sky_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";
			} else if (LocalClique == "ni") { //openChatRio_Sky('NI')	
				URL = "/Web/Util/html/pop_chat.aspx?IDArea=17&sel=Sky_LivingRJ&destino=ni";
			}
			break;
		case "tvflash_minhacasaminhavida": 
			if (LocalClique == "rj") { //openChatRioNovo_Sky('RJ')
				URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Sky_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";
			} else if (LocalClique == "ni") { //openChatRio_Sky2('NI')	
				URL = "/Web/Util/html/pop_chat.aspx?IDArea=17&sel=tvflash_minhacasaminhavida&destino=ni";
			}
			break;
		case "tvflash_promocaoanonovovidanova":
			if (LocalClique == "rj") { //openChatRioNovo_Sky('RJ')
				URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Sky_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";
			} else if (LocalClique == "ni") { //openChatRioNovo_Sky('NI')
				URL = "http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Sky_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e";
			}
			break;	
		/**************************** Rio de Janeiro */
		/* Bahia *************************************/
		case "BA": //OpenChatHeaderBA()
			URL = "/Web/Util/html/pop_chat.aspx?" +
					"idarea=" + idArea +
					"&sel=" + Empreendimento +
					"&origem=" + LocalClique;			
			width = 775;
			heigth = 495;
			break;			
		/************************************* Bahia */
		default:
			alert("|" + Cidade + "|");
			break;			
	}

	if (URL != "") {
		if (OpenRedirect == "o") {
			window.open(URL, "remote", "width="+ width +",height="+ heigth +",top=0,resizable=no,scrollbars=no");
		} else if (OpenRedirect == "r") {
			window.location = URL;
		} else {
			alert('Erro: Parâmetro OpenRedirect inválido'); return;
		}
	} else {
		alert('Erro: Não encontrado endereço de chat');
	}		
}

function openChat() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=16&sel=HeaderLiving','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChatAll(idArea, sel, W, H ) {
	W = '500';
	H = '500';

	window.open('/Web/Util/html/pop_chat.aspx?IDArea=' + idArea + '&sel=' + sel,'remote','width='+W+',height='+H+',top=0,resizable=no,scrollbars=no');
}

function openChatApaixonar() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=145&sel=PagApaixonados','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function OpenChatAtivo() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=43&sel=ChatAtivo','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function OpenChatHeader() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=16&sel=HeaderLiving','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function OpenChatHeaderBA() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=48&sel=FlashHeaderBahia','remote','width=775,height=495,top=0,resizable=no,scrollbars=no');
}

function OpenChatHeaderRJ() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=21&sel=Botao_LivingRJ','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChatHeader_Interior(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=16&sel=HeaderLiving&destino=' + p_Destino;
}

function openChatRio(p_IdArea, p_Sel, p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=' + p_IdArea + '&sel=' + p_Sel + '&destino=' + p_Destino;
}

function openChatRio_Header(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=16&sel=Header_LivingRJ&destino=' + p_Destino;
}

function openChatRio_Sky(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=17&sel=Sky_LivingRJ&destino=' + p_Destino;
}

function openChatRio_Sky2(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=17&sel=tvflash_minhacasaminhavida&destino=' + p_Destino;
}

function openChatRioNovo_Header(p_Destino) {
	window.location = 'http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Header_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e'; 
}

function openChatRioNovo_Sky(p_Destino) {
	window.location = 'http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=6&sel=Sky_LivingRJ&IDCliente=9299baf9-d393-4f18-bf2c-00c34386e87e';
}

function openChatSky_Interior(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=17&sel=SkyLiving&destino=' + p_Destino;
}

function openChatSP(p_IdArea, p_Sel, p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=' + p_IdArea + '&sel=' + p_Sel + '&destino=' + p_Destino;
}

function openChatSP_Header() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=17&sel=SkyLiving','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChatSP_Sky(p_Destino) {
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=17&sel=SkyLivingSP&destino=' + p_Destino;
}

function openChat_Interior(p_IdArea, p_Sel, p_Destino) {	
	window.location = '/Web/Util/html/pop_chat.aspx?IDArea=' + p_IdArea + '&sel=' + p_Sel + '&destino=' + p_Destino;
}

function openChat_Rio(p_IdArea, p_Origem, p_Empreendimento) {	
	window.open('/Web/Util/Pops/PopChatRio.aspx?IDArea=' + p_IdArea + '&sel=' + p_Empreendimento + '&origem=' + p_Origem,'remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChat_SP(p_IdArea, p_Origem, p_Empreendimento) {	
	window.open('/Web/Util/Pops/PopChatSPMask.aspx?IDArea=' + p_IdArea + '&sel=' + p_Empreendimento + '&origem=' + p_Origem,'remote','width=500,height=650,top=0,resizable=no,scrollbars=no');
}

function openChat_SP2(p_IdArea, p_Origem, p_Empreendimento) {	
	window.open('/Web/Util/Pops/PopChatSPMask2.aspx?IDArea=' + p_IdArea + '&sel=' + p_Empreendimento + '&origem=' + p_Origem,'remote','width=500,height=650,top=0,resizable=no,scrollbars=no');
}

function openChat_sky() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=17&sel=SkyLiving','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChat_skyBA() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=48&sel=SkyBahia','remote','width=775,height=495,top=0,resizable=no,scrollbars=no');
}

function openChat_skyEs() {
	window.open('http://200.225.91.179/cyrelavitoria/chat4/cliente/frm_login.asp?idarea=1','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChat_skyPE() {
	window.open('http://200.225.91.178/CyrelaRecife116/chat4/cliente/frm_login.asp?idarea=1','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChat_skyPR() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=3&sel=SkyParana','remote','width=500,height=495,top=0,resizable=no,scrollbars=no');
}

function openChat_skyRJ() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=17&sel=Sky_LivingRJ','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function openChat_skySP() {
	window.open('/Web/Util/html/pop_chat.aspx?IDArea=17&sel=SkyLiving','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function popdhtml() {
	window.open('http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=1&sel=dhtmlIles','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}

function popficha() {
	window.location.href = "/web/ficha/essenciaalphaville";
	window.open('http://200.225.91.178/CyrelaSeller116/chat4/cliente/frm_login.asp?idarea=1&sel=Essencia_Alphaville','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}	

function popfichailes() {
	window.location.href = "/web/ficha/iles";
	window.open('http://200.225.91.178/cyrelario116/chat4/cliente/frm_login.asp?idarea=1&sel=dhtmlIles','remote','width=500,height=500,top=0,resizable=no,scrollbars=no');
}	

/****************** Chat Functions */



/* <MOUSE HOVER DO MENU HORIZONTAL> */
function init() {
  handleMouseOver('img');
  handleMouseOver('input');
}

function handleMouseOver(tagType)
{
	if (!document.getElementById) return
		var imgOriginSrc;
		var imgTemp = new Array();
		var imgarr = document.getElementsByTagName(tagType);
		for (var i = 0; i < imgarr.length; i++) {
		if (imgarr[i].getAttribute('hsrc')) {
			imgTemp[i] = new Image();
			imgTemp[i].src = imgarr[i].getAttribute('hsrc');
			imgarr[i].onmouseover = function() {
				imgOriginSrc = this.getAttribute('src');
				this.setAttribute('src',this.getAttribute('hsrc'))
			}
			imgarr[i].onmouseout = function() {
				this.setAttribute('src',imgOriginSrc)
			}
		}
	}
}
onload=init;
/* </MOUSE HOVER DO MENU HORIZONTAL> */

/* <MOUSE HOVER DO MENU HORIZONTAL CORRETO> */
function menuNewOver(objMenu,objImagem){
//	alert(objMenu + ' - ' + objImagem);
	document.getElementById(objMenu).src = objImagem;
}
/* </MOUSE HOVER DO MENU HORIZONTAL CORRETO> */

/* <FUNÇAO PARA ABRIR AS POPS QUE SAO GERADAS AUTOMÁTICAMENTE> */
function abrepopficha(x)
{
	eval("window.open('"+ x +"','pop','left=1,top=1,width=450,height=320,scrollbars=1,resizable=0,resizable=0,status=0');");
}

/* </FUNÇAO PARA ABRIR AS POPS QUE SAO GERADAS AUTOMÁTICAMENTE> */

/* <FUNÇAO PARA ABRIR A POP DE VISITA VIRTUAL DAS FICHAS> */
function popup(URL) {
	var width = 450;
	var height = 510;
	var left = 1;
	var top = 1;
	window.open(URL,'popup', 'width='+width+', height='+height+', top='+top+', left='+left+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, fullscreen=no');
}
/* </FUNÇAO PARA ABRIR A POP DE VISITA VIRTUAL DAS FICHAS> */

/* <FUNÇAO PARA ABRIR A POP DE FICHA DE INSCRIÇAO> */
function fichaDeInscricao(){

window.open('http://zeus.e-hunter.com.br/cyrela/html/candidato.html', 'Cyrela', 'toolbar=no, location=no, directories=no, status=no,scrollbars=yes, resizable=no, menubar=no, width=760, height=450, left=2, top=10');
}
/* </FUNÇAO PARA ABRIR A POP DE FICHA DE INSCRIÇAO> */

/* <PRELOAD DO MENU> */
var preloads = [
		'/Web/Util/img/bt_sp_on.jpg',
		'/Web/Util/img/bt_sp_off.jpg',
		'/Web/Util/img/bt_rj_on.jpg',
		'/Web/Util/img/bt_rj_off.jpg',
		'/Web/Util/img/menu/rj/bt_produtos_on.jpg',
		'/Web/Util/img/menu/rj/bt_produtos_off.jpg',
		'/Web/Util/img/menu/rj/bt_moradores_on.jpg',
		'/Web/Util/img/menu/rj/bt_moradores_off.jpg',
		'/Web/Util/img/menu/rj/bt_cadastro_on.jpg',
		'/Web/Util/img/menu/rj/bt_cadastro_off.jpg',
		'/Web/Util/img/menu/rj/bt_imobiliarias_on.jpg',
		'/Web/Util/img/menu/rj/bt_imobiliarias_off.jpg',
		'/Web/Util/img/menu/rj/bt_relacoes_on.jpg',
		'/Web/Util/img/menu/rj/bt_relacoes_off.jpg',
		'/Web/Util/img/menu/bt_relacionamento_on.jpg',
		'/Web/Util/img/menu/bt_relacionamento_off.jpg',
		'/Web/Util/img/menu/bt_produtos_on.jpg',
		'/Web/Util/img/menu/bt_produtos_off.jpg',
		'/Web/Util/img/menu/bt_moradores_on.jpg',
		'/Web/Util/img/menu/bt_moradores_off.jpg',
		'/Web/Util/img/menu/bt_cadastro_on.jpg',
		'/Web/Util/img/menu/bt_cadastro_off.jpg',
		'/Web/Util/img/menu/bt_imobiliarias_on.jpg',
		'/Web/Util/img/menu/bt_imobiliarias_off.jpg',
		'/Web/Util/img/menu/bt_relacoes_on.jpg',
		'/Web/Util/img/menu/bt_relacoes_off.jpg',
		'/Web/Util/img/menu/bt_lajes_on.jpg',
		'/Web/Util/img/menu/bt_lajes_off.jpg'
	];
	preloadimg = function (){
		if(document.images){
			for(nP=0; nP < preloads.length; nP++){
				eval('image' + nP + ' = new Image();');
				eval("image" + nP + ".src = '" + preloads[nP] + "';");
			};
		}
		delete preloads;
	};
	preloadimg();
/* </PRELOAD DO MENU> */



/*OVER ESCOLHA*/
sp_ON = new Image(); sp_ON.src="/Web/shared/img/home/bot_sp_on.gif";
sp_OFF = new Image(); sp_OFF.src="/Web/shared/img/home/bot_sp.gif";
rj_ON = new Image(); rj_ON.src="/Web/shared/img/home/bot_rj_on.gif";
rj_OFF = new Image(); rj_OFF.src="/Web/shared/img/home/bot_rj.gif";

/*OVER DETALHES IMÓVEL*/
atendimento_ON = new Image(); atendimento_ON.src="/Web/shared/img/busca/bt_atendimento_on.gif";
atendimento_OFF = new Image(); atendimento_OFF.src="/Web/shared/img/busca/bt_atendimento.gif";
estagio_ON = new Image(); estagio_ON.src="/Web/shared/img/busca/bt_estagio_on.gif";
estagio_OFF = new Image(); estagio_OFF.src="/Web/shared/img/busca/bt_estagio.gif";
condicoes_ON = new Image(); condicoes_ON.src="/Web/shared/img/busca/bt_condicoes_on.gif";
condicoes_OFF = new Image(); condicoes_OFF.src="/Web/shared/img/busca/bt_condicoes.gif";
visita_ON = new Image(); visita_ON.src="/Web/shared/img/busca/bt_visita_on.gif";
visita_OFF = new Image(); visita_OFF.src="/Web/shared/img/busca/bt_visita.gif";
mapa_ON = new Image(); mapa_ON.src="/Web/shared/img/busca/bt_mapa_on.gif";
mapa_OFF = new Image(); mapa_OFF.src="/Web/shared/img/busca/bt_mapa.gif";
memorial_ON = new Image(); memorial_ON.src="/Web/shared/img/busca/bt_memorial_on.gif";
memorial_OFF = new Image(); memorial_OFF.src="/Web/shared/img/busca/bt_memorial.gif";

/*OVER HOTSITES*/
um_on = new Image(); um_on.src="/Web/shared/img/hotsites/ico_corretoronline_on.gif";
um_off = new Image(); um_off.src="/Web/shared/img/hotsites/ico_corretoronline.gif";
dois_on = new Image(); dois_on.src="/Web/shared/img/hotsites/ico_visitavirtual_on.gif";
dois_off = new Image(); dois_off.src="/Web/shared/img/hotsites/ico_visitavirtual.gif";
tres_on = new Image(); tres_on.src="/Web/shared/img/hotsites/ico_comochegar_on.gif";
tres_off = new Image(); tres_off.src="/Web/shared/img/hotsites/ico_comochegar.gif";
quatro_on = new Image(); quatro_on.src="/Web/shared/img/hotsites/ico_condicoespagto_on.gif";
quatro_off = new Image(); quatro_off.src="/Web/shared/img/hotsites/ico_condicoespagto.gif";
cinco_on = new Image(); cinco_on.src="/Web/shared/img/hotsites/ico_estagioobra_on.gif";
cinco_off = new Image(); cinco_off.src="/Web/shared/img/hotsites/ico_estagioobra.gif";
seis_on = new Image(); seis_on.src="/Web/shared/img/hotsites/ico_maisinfo_on.gif";
seis_off = new Image(); seis_off.src="/Web/shared/img/hotsites/ico_maisinfo.gif";


function TV1(x,y){
	document.images[x].src = eval(y).src;
}

/*DIVS*/
function MostraDiv(x){
	document.getElementById(x).style.visibility="visible";
}

function EscondeDiv(x){
	document.getElementById(x).style.visibility="hidden";
}

/*RESOLUCAO*/
function checkBrowser(){
	T=this;
	b=navigator.appName;
	v=navigator.appVersion;
	u=navigator.userAgent;
	if(b=='Netscape')T.b='ns'
	else if(b=='Microsoft Internet Explorer')T.b='ie'
	else T.b=b
	T.v=parseInt(v);
	T.ns=(T.b=='ns'&&T.v>=4);
	T.ns4=(T.b=='ns'&&T.v==4);
	T.ns5=(T.b=='ns'&&T.v==5);
	T.ns6=(T.b=='ns'&&T.v==5);
	T.ie=(T.b=='ie'&&T.v>=4);
	T.ie4=(u.indexOf('MSIE 4')>0);
	T.ie5=(u.indexOf('MSIE 5.0')>0);
	T.ie55=(u.indexOf('MSIE 5.5')>0);
	T.ie6=(u.indexOf('MSIE 6.0')>0);
	if(T.ie5)T.v=5;
	if(T.ie55)T.v=5.5;
	if(T.ie6)T.v=6;
	T.min=(T.ns||T.ie);
	T.dom=(T.v>=5);
	T.win=(u.indexOf('Win')>0);
	T.mac=(u.indexOf('Mac')>0);
}
is=new checkBrowser();

var d=document;
var w=(is.ie?(screen.width):(window.innerWidth));

/*SKY*/

var swf="/Web/shared/Swf/banner_corretor.swf";


/*OVER MENU DIREITA*/



function MenuOver(eItemMenu){
	eItemMenu.DefaultClass = eItemMenu.className;
	eItemMenu.className = "bg_azulM branco";
	eItemMenu.style.cursor = "hand";
}

function MenuOut(eItemMenu){
	eItemMenu.className = eItemMenu.DefaultClass;
}



function openFichaFale(){
	window.open('/Web/Util/html/fale.asp','pop2','left=18,top=18,width=580,height=445,scrollbars=0,resizable=1');
}

function openInvestidor(){
//alert();
}

//http://proteus.e-hunter.com.br/cyrela/html/candidato.html
function fichaDeInscricao(){

window.open('http://zeus.e-hunter.com.br/cyrela/html/candidato.html', 'Cyrela', 'toolbar=no, location=no, directories=no, status=no,scrollbars=yes, resizable=no, menubar=no, width=760, height=450, left=2, top=10');
}

function abrepopficha(x){
eval("window.open('"+ x +"','pop','left=1,top=1,width=450,height=320,scrollbars=1,resizable=0,resizable=0,status=0');");
}

function abrepop(x,w,h)
{


	var height = 320;
	var width = 450;
	var novaJanela = 0;
	if(w == 0)
	{
		novaJanela = 1;	
	}
	else
	{
		width = w;
	}

	if(h == 0)
	{
		novaJanela = 1;	
	}
	else
	{
		height = h;
	}

	
	//if(novaJanela == 1)
	//{
		eval("window.open('"+ x +"');");
	
	//}
	//else
	//{
	
	
	//	eval("window.open('"+ x +"','pop','left=1,top=1,width="+ width +",height=" + height + ",scrollbars=0,resizable=0,resizable=0,status=0');");
	//}

}

/* <MOUSE HOVER DO MENU HORIZONTAL> 
function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}
onload=init;
*/
/* </MOUSE HOVER DO MENU HORIZONTAL> */

/* <FUNÇAO PARA ABRIR AS POPS QUE SAO GERADAS AUTOMÁTICAMENTE> */
function abrepopficha(x){
eval("window.open('"+ x +"','pop','left=1,top=1,width=450,height=320,scrollbars=1,resizable=0,resizable=0,status=0');");

}
/* </FUNÇAO PARA ABRIR AS POPS QUE SAO GERADAS AUTOMÁTICAMENTE> */

/* <FUNÇAO PARA ABRIR A POP DE FICHA DE INSCRIÇAO> */
function fichaDeInscricao(){

window.open('http://zeus.e-hunter.com.br/cyrela/html/candidato.html', 'Cyrela', 'toolbar=no, location=no, directories=no, status=no,scrollbars=yes, resizable=no, menubar=no, width=760, height=450, left=2, top=10');
}
/* </FUNÇAO PARA ABRIR A POP DE FICHA DE INSCRIÇAO> */


function fecharDHTML() {
	document.getElementById("DHTMLHOME").style.display = "none";
	
	var selects = document.getElementsByTagName("select");
	for(var i=0;i<selects.length;i++)
	{
		if(selects[i].id == "ddlHome")
			document.getElementById(selects[i].id).style.display = "";
	}
}

// Receive Data from Flash
function dhtml_DoFSCommand(command, args)
{
	//Invoke functions in accordance with command
	if(command=="OPEN") {
		fecharDHTML();
	}
}
// Hook for Internet Explorer.

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub dhtml_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call dhtml_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}


	function fechaBanner() {
		document.getElementById("html").style.display = 'none';
		//document.getElementById('dhtml').style.visibility="hidden";
	}
	
	function timerFechaImg(){
		 setTimeout("fechaBanner()",20000)
	}
	
	
/*<FUNÇAO DROP DOWN MENU HORIZONTAL RELAÇOES COM INVESTIDOR>*/

// <script>

// Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Distribute this code, any part or any modified version of it.
//     Instead, you can link to the homepage of this code:
//     http://www.php-development.ru/javascripts/smart-forms.php.
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as a part of another product provided that
//     its main use is not creating javascript menus.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind, either
// expressed or implied, including, but not limited to, the implied warranties
// of merchantability and fitness for a particular purpose. You expressly
// acknowledge and agree that use of this code is at your own risk.

// If you find my script useful, you can support my site in the following ways:
// 1. Vote for the script at HotScripts.com (you can do it on my site)
// 2. Link to the homepage of this script or to the homepage of my site:
//    http://www.php-development.ru/javascripts/smart-forms.php
//    http://www.php-development.ru/
//    You will get 50% commission on all orders made by your referrals.
//    More information can be found here:
//    http://www.php-development.ru/affiliates.php


// ----- Popup Control ---------------------------------------------------------

function at_display(x)
{
  win = window.open();
  for (var i in x) win.document.write(i+' = '+x[i]+'<br>');
}

// ----- Show Aux -----

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  var top  = (c["at_position"] == "y") ? p.offsetHeight+0 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +1 : 15;

  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }

  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ----- Show -----

function at_show()
{
  p = document.getElementById(this["at_parent"]);
  c = document.getElementById(this["at_child" ]);

  at_show_aux(p.id, c.id);

  clearTimeout(c["at_timeout"]);
}

// ----- Hide -----

function at_hide()
{
  c = document.getElementById(this["at_child"]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 0);
}

// ----- Click -----

function at_click()
{
  p = document.getElementById(this["at_parent"]);
  c = document.getElementById(this["at_child" ]);

  if (c.style.visibility != "visible") at_show_aux(p.id, c.id);
  else c.style.visibility = "hidden";

  return false;
}

// ----- Attach -----

// PARAMETERS:
// parent   - id of visible html element
// child    - id of invisible html element that will be dropdowned
// showtype - "click" = you should click the parent to show/hide the child
//            "hover" = you should place the mouse over the parent to show
//                      the child
// position - "x" = the child is displayed to the right of the parent
//            "y" = the child is displayed below the parent
// cursor   - Omit to use default cursor or check any CSS manual for possible
//            values of this field

function at_attach(parent, child, showtype, position, cursor)
{
  p = document.getElementById(parent);
  c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

/*</FIM DA FUNÇAO DROP DOWN MENU HORIZONTAL RELAÇOES COM INVESTIDOR>*/

function abreEstagioObra(urlXml) {

	var x = "";
	
	x+= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	x+= '		id="main" width="800" height="641"';
	x+= '		codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" VIEWASTEXT>';
	x+= '		<param name="movie" value="/web/Util/swf/Obra/main.swf" />';
	x+= '		<param name="quality" value="high" />';
	x+= '		<param name="bgcolor" value="#869ca7" />';
	x+= '		<param name="allowScriptAccess" value="sameDomain" />';
	x+= '		<param name="flashvars" value="CaminhoXML=' + urlXml + '"/>';
	x+= '		<embed src="/web/Util/swf/Obra/main.swf" quality="high" bgcolor="#869ca7"';
	x+= '			width="800" height="641" name="main" align="middle"';
	x+= '			play="true"';
	x+= '			loop="false"';
	x+= '			quality="high"';
	x+= '			flashvars="CaminhoXML=' + urlXml + '"';
	x+= '			allowScriptAccess="sameDomain"';
	x+= '			type="application/x-shockwave-flash"';
	x+= '			pluginspage="http://www.adobe.com/go/getflashplayer">';
	x+= '		</embed>';
	x+= '</object>';
	
		document.getElementById('divLightboxContent').innerHTML = x;
		document.getElementById('divLightbox').style.display = 'block';
		
		var width = getPageSizeWithScroll('w');
		var height = getPageSizeWithScroll('h');
		
		document.getElementById('divOverlay').style.width = width + "px";
		document.getElementById('divOverlay').style.height = height + "px";
		
		window.scrollTo(0,0);
}

function getPageSizeWithScroll(type){
     if (window.innerHeight && window.scrollMaxY) {
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}else if (document.body.scrollHeight > document.body.offsetHeight){
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else {
	    yWithScroll = document.body.offsetHeight;
	    xWithScroll = document.body.offsetWidth;
	}
	
	switch(type){
		case 'w':
			return xWithScroll;
			break;
		case 'h':
			return yWithScroll;
			break;
	}
}

function fechaLightbox() {
		document.getElementById('divLightbox').style.display = 'none';
		document.body.style.overflowY = 'auto';
}


// JavaScript Document
function checkBrowser(){
	T=this;
	b=navigator.appName;
//	alert (navigator.appName);
	v=navigator.appVersion;
	u=navigator.userAgent;
	if(b=='Netscape')T.b='ns'
	else if(b=='Microsoft Internet Explorer')T.b='ie'
	else T.b=b
	T.v=parseInt(v);
	T.ns=(T.b=='ns'&&T.v>=4);
	T.ns4=(T.b=='ns'&&T.v==4);
	T.ns5=(T.b=='ns'&&T.v==5);
	T.ns6=(T.b=='ns'&&T.v==5);
	T.ie=(T.b=='ie'&&T.v>=4);
	T.ie4=(u.indexOf('MSIE 4')>0);
	T.ie5=(u.indexOf('MSIE 5.0')>0);
	T.ie55=(u.indexOf('MSIE 5.5')>0);
	T.ie6=(u.indexOf('MSIE 6.0')>0);
	if(T.ie5)T.v=5;
	if(T.ie55)T.v=5.5;
	if(T.ie6)T.v=6;
	T.min=(T.ns||T.ie);
	T.dom=(T.v>=5);
	T.win=(u.indexOf('Win')>0);
	T.mac=(u.indexOf('Mac')>0);
}


///Function abreEstagioObraFicha
function abreEstagioObraFicha(urlXml) {

	var x = "";
	var browser = new checkBrowser();
	
	if(browser.ie)
	{
	
	var objBody = document.getElementById ('Corpo');
			objBody.scroll = 'no';
	
	}
	else
	{
		document.body.style.overflow = 'hidden';
	}
	
	
	x+= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	x+= '		id="main" width="800" height="641"';
	x+= '		codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" VIEWASTEXT>';
	x+= '		<param name="movie" value="/web/Util/swf/Obra/main.swf" />';
	x+= '		<param name="quality" value="high" />';
	x+= '		<param name="bgcolor" value="#869ca7" />';
	x+= '		<param name="allowScriptAccess" value="sameDomain" />';
	x+= '		<param name="flashvars" value="CaminhoXML=' + urlXml + '"/>';
	x+= '		<embed src="/web/Util/swf/Obra/main.swf" quality="high" bgcolor="#869ca7"';
	x+= '			width="800" height="641" name="main" align="middle"';
	x+= '			play="true"';
	x+= '			loop="false"';
	x+= '			quality="high"';
	x+= '			flashvars="CaminhoXML=' + urlXml + '"';
	x+= '			allowScriptAccess="sameDomain"';
	x+= '			type="application/x-shockwave-flash"';
	x+= '			pluginspage="http://www.adobe.com/go/getflashplayer">';
	x+= '		</embed>';
	x+= '</object>';
	
		document.getElementById('divLightboxContent').innerHTML = x;
		document.getElementById('divLightbox').style.display = 'block';
		
		var width = getPageSizeWithScroll('w');
		var height = getPageSizeWithScroll('h');
		
		document.getElementById('divOverlay').style.width = width + "px";
		document.getElementById('divOverlay').style.height = height + "px";
		
		window.scrollTo(0,0);

		
}


/// Function getPageSizeWithScroll
function getPageSizeWithScroll(type){
     if (window.innerHeight && window.scrollMaxY) {
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}else if (document.body.scrollHeight > document.body.offsetHeight){
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else {
	    yWithScroll = document.body.offsetHeight;
	    xWithScroll = document.body.offsetWidth;
	}
	
	switch(type){
		case 'w':
			return xWithScroll;
			break;
		case 'h':
			return yWithScroll;
			break;
	}
}

/// Função da Macromedia para window.open
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}