function RodarFlash(path,variaveis,_width,_height)
{
	document.write('<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+'">')
		document.write('<param name="movie" value="'+path+'?'+variaveis+'">')
		document.write('<param name="quality" value="high">')
		document.write('<param name="wmode" value="transparent">')
		document.write('<embed src="'+path+'?'+variaveis+'" width="'+_width+'" height="'+_height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>')
	document.write('</object>')
}

// HOTSITE MENU ////////////////////////////////////////////////////////
function overMenu() {
	document.getElementById("todo").style.zIndex = 1;
	document.getElementById("hotsite_menu").style.zIndex = 2;
}

function overConteudo() {
	document.getElementById("todo").style.zIndex = 2;
	document.getElementById("hotsite_menu").style.zIndex = 1;
}

///////////////////////////////////////////////////////////////////////////

/// MONTA FLASH V.2 //////////////////////////////////////////////////////////////////////////////////
// Biblioteca para comunicar-se com o Flash
function getFlashMovieObject(movieName) {
	if (window.document[movieName]) {
		return window.document[movieName];
	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1) {
		if (document.embeds && document.embeds[movieName]) {
		  return document.embeds[movieName]; 
		}
	}
	else {
		return document.getElementById(movieName);
	}
}

// Função que mostra/cria flash
function montaFlash(id, swfPath, params, swfParams, _largura, _altura) {
	// Detecta o Navegador e vé se precisa 
	var	flashMovie = document.getElementById("flash_"+id);
	if(screen.height <= 864){
		document.getElementById('galeria').style.position = "absolute";
	}	
	// Se estiver oculto ele mostra a div
	var naoOculta = true;
	if(document.getElementById(id).style.display == "none") {
		document.getElementById('fundoGaleria').style.display = "block";
		document.getElementById(id).style.display = "block";
		naoOculta = false;
	}

	// Verifica se já foi criado o RodarFlash(); ou se não for o IE
	if(!flashMovie || navigator.appName.indexOf("Microsoft Internet")==-1 && !naoOculta) {
		// Carrega o flash e envia os parametros
		criaFlash(id, swfPath, swfParams, _largura, _altura);
	}
	else {
		// Se já estiver criado, enviamos o param ao flash
		var flashMovie = getFlashMovieObject("flash_"+id);
		flashMovie.SetVariable("/:osParams", params);
	}
}

// Função que cria o Flash dentro da Div e envia o param pela primeira vez
function criaFlash(id, swfPath, swfParams, _largura, _altura) {
	// Monta o flash dentro da Div
	var divFlash = document.getElementById(id);
	var rodarFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="flash_'+ id +'" width="'+ _largura +'" height="'+ _altura +'"><param name="movie" value="'+ swfPath +'?parametros='+ swfParams +'"><param name="quality" value="high"><param name="wmode" value="transparent"><embed src="'+ swfPath +'?parametros='+ swfParams +'" width="'+ _largura +'" height="'+ _altura +'" swliveconnect="true" name="flash_'+ id +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>';
	divFlash.innerHTML = rodarFlash;
}

function ocultaFlash(id) {
	if(screen.height <= 864){
		document.getElementById('galeria').style.position = "fixed";
	}
	document.getElementById('fundoGaleria').style.display = "none";
	document.getElementById(id).style.display = "none";
}
/// FIM - MONTA FLASH ///////////////////////////////////////////////////////////////

// Pop up ////////
function openTermos(){
	window.open('termos_uso.aspx','','toolbar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes,menubar=no,width=345,height=500,left=100,top=100');
}

function openInformacoes(){
	window.open('informacoes_gerais.aspx','','toolbar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes,menubar=no,width=345,height=500,left=100,top=100');
}
function openFale(){
	window.open('http://www.mdconline.com.br/oei/faleConosco/bonnaire.html','','toolbar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes,menubar=no,width=500,height=575,left=200,top=100');
}
/////////Ajuste de página/////////////////
function openPg(pagina,largura,altura){
	window.open(pagina,'','toolbar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes,menubar=no,width='+largura+',height='+altura+',left=0,top=0');
}

/////// link atendimento ////////////
function atendimento()
 {
            idc = 5317
            empresa=1131
            depto=1182
            custom=""
            custom2="Bonnaire"
            custom3="HotSite"
            custom4=""
            idtemplate=3
            URL = "http://web.atendimentoaovivo.com.br/chat.asp?idc=" + idc + "&idtemplate=" + idtemplate + "&pre_empresa=" + empresa + "&pre_depto=" + depto + "&vivocustom=" + custom + "&vivocustom2=" + custom2 + "&vivocustom3=" + custom3 + "&vivocustom4=" + custom4
			//URL = "http://www.globo.com.br"
            mywindow = window.open (URL,"indicacao","location=0,status=0,scrollbars=0,width=500px,height=545px");
            //mywindow.moveTo(0,0);

 }

