//ABRE AMPLIACAO DE IMAGEM

function abrepopupimagem(caminhoimagem){
	    window.open('/site/PopUPFotos.php?Id_imagem='+caminhoimagem,'Fotos','scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=10,height=10');
	}

function abrepopuppadrao(caminhoimagem,legenda){
	    window.open('/site/portugues/AEmbare/Popups/PopupFotoAmpliada3.php?legenda='+legenda+'&fotoGrde='+caminhoimagem,'','scrollbars=no,width=680,height=500');
	}

function DefinePastaLinguagem(Linguagem){
	
	switch (Linguagem) {
	case "p":
		return "portugues";
		break
	case "i":
		return "ingles";
		break
	case "e":
		return "espanhol";
		break
	default:
		return "portugues";
	}
}

function mudatamanhoFlahs(){
	//alert(document.getElementById("Topo").heigh)
	if(Secao == "Internas" || Secao == "Internas3"){
		document.getElementById("fundofirefox").style.backgroundImage = 'url(/site/Imgs/FundoFireFox2.jpg)';
	//alert(document.getElementById("Topo").heigh)
	document.getElementById("topoFlash").height = 625;
	}
}
//funcoes de links capa

function abreFundacao(Linguagem){
	window.open('/site/'+DefinePastaLinguagem(Linguagem)+'/ProjetosSociais/Hotsites/fundacao_embare/fundacao_embare.html','FundacaoEmbare','width=500,height=431');
}

function abreMapaSite(Linguagem){
	window.location.href='/site/'+DefinePastaLinguagem(Linguagem)+'/MapaSite/index.php';
}

function abreEnvieCurriculo(Linguagem){
	window.open('http://mix.embare.com.br/mixcv/default.asp'),'','','';
}

function abreIso9001(Linguagem){

}

function abreArleteAntunes(Linguagem){	
	window.open('/site/'+DefinePastaLinguagem(Linguagem)+'/ProjetosSociais/Hotsites/arlete/arlete.html','ArleteAntunes','width=600,height=420');
}

function abreHistoriaEmbare(Linguagem){
	window.location.href='/site/'+DefinePastaLinguagem(Linguagem)+'/AEmbare/LinhaTempo/index.php';
}

function abreProcessoDeProducao(Linguagem){
	window.open('/site/'+DefinePastaLinguagem(Linguagem)+'/AEmbare/Estrutura/ProcessoProducao/fluxo/fluxo.html','ProcessoProducao','width=700,height=480');
}

function abreReceitas(Linguagem){
	window.location.href='/site/'+DefinePastaLinguagem(Linguagem)+'/Receitas/index.php';
}


<!-- 
//JavaScript Flash detection and deployment 
/* -- 1. Player Version detection -- */ 

//set player version here 
var MM_contentVersion = 8; 

//set sub version here 
var release = "9,0,0,0"; 

//check for flash player 
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; 
if ( plugin ) { 
var words = navigator.plugins["Shockwave Flash"].description.split(" "); 
for (var i = 0; i < words.length; ++i) 
{ 
if (isNaN(parseInt(words[i]))) 
continue; 
var MM_PluginVersion = words[i]; 
} 
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion; 
} 
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
&& (navigator.appVersion.indexOf("Win") != -1)) { 
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag 
document.write('on error resume next \n'); 
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n'); 
document.write('</SCR' + 'IPT\> \n'); 
} 

/* -- 2. Deployment function -- */ 

function writeFlash(swf,flashVarString,w,h,bgcolor,menu,mode,q,id,salign,scale){
	
	
if ( MM_FlashCanPlay ) { 
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' 
+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+release+'" ' 
+'width="'+w+'" height="'+h+'" id="'+id+'" align="">' 
+'<param name="movie" value="'+swf+'">' 
+'<param name="menu" value="'+menu+'"> ' 
+'<param name="quality" value="'+q+'"> ' 
+'<param name="wmode" value="'+mode+'"> ' 
+'<param name="bgcolor" value="'+bgcolor+'"> '
+'<param name="salign" value="'+salign+'"> '
+'<param name="scale" value="'+scale+'"> '
+'<param name="allowScriptAccess" value="sameDomain" />'
+'<param name="flashvars" value="'+flashVarString+'"> ' 
+'<embed src="'+swf+'" allowScriptAccess="sameDomain"  swliveconnect="true" FlashVars="'+flashVarString+'" salign="'+salign+'" scale="'+scale+'" menu="'+menu+'" quality="'+q+'" wmode="'+mode+'" ' 
+' bgcolor="'+bgcolor+'" width="'+w+'" height="'+h+'" name="'+id+'" ' 
+' type="application/x-shockwave-flash" ' 
+' pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> '); 
} else { 
document.write('você precisa instalar o Flash player '+MM_contentVersion+' or later to use this site. '); 
document.write('<em><a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">'); 
document.write('Clique aqui para instalar.</a></em>'); 
} 
}

var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');	

function mudafonte(tipo){
	
	if(tipo == '0'){
		size = 10;
		} else if(tipo == '2') {
			size = 12;
			} else if(tipo == '4') {
				size = 14;
			}

			
getBody = document.getElementsByTagName('body')[0];
for (i = 0 ; i < tags.length ; i++ ) {

getallTags = getBody.getElementsByTagName(tags[i]);
for (k = 0 ; k < getallTags.length ; k++)
getallTags[k].style.fontSize = size+'px';
 }
	}
	
	
	/**
*
*  UTF-8 data encode / decode
*
**/

var Utf8 = {

    // public method for url encoding
    encode : function (string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // public method for url decoding
    decode : function (utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while ( i < utftext.length ) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i+1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i+1);
                c3 = utftext.charCodeAt(i+2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

}

/////////////////////// ABRE POPUP /////////////////////////
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//////////////////////////////////// DEFINE VALOR DE URL PARA O FALSH //////////////////

//define valor da URL para o flash
function urlFlash(){

	var caminho = window.document.location.pathname+window.document.location.search;
	if(window.Topo) window.document["Topo"].SetVariable("URLBase", caminho);
	if(document.Topo) document.Topo.SetVariable("URLBase", caminho);
}

function URLencode(sStr) {
    return escape(sStr).
             replace(/\+/g, '%2B').
                replace(/\"/g,'%22').
                   replace(/\'/g, '%27').
                     replace(/\//g,'%2F');
}

