
// BORDA FLASH
function carregaFlash(caminho,largura,altura){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'">');
	document.write('<param name="movie" value="'+caminho+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="menu" value="false">');
	document.write('<embed src="'+caminho+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'" wmode="transparent"></embed>');
	document.write('</object>');
}
// FIM BORDA FLASH

//  FLASH NA PÁGINA DE CURSOS
function EscreveFlash(pSWF, pWidth, pHeight, pWmode){
	//VERIFICA SE O MODO
	pWmode ? pWmode = "opaque" : pWmode = "transparent";
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" width="' + pWidth + '" height="' + pHeight + '">');
	document.write(' <param name="movie" value="' + pSWF + '">');
	document.write(' <param name="quality" value="high">');
	document.write(' <param name="wmode" value="' + pWmode + '">');
	document.write(' <embed src="' + pSWF + '" width="' + pWidth + '" height="' + pHeight + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="' + pWmode + '"></embed>');
	document.write('</object>');
}
//  FIM FLASH NA PÁGINA DE CURSOS

function url_encode(str) {
	var hex_chars = "0123456789ABCDEF";
	var noEncode = /^([a-zA-Z0-9\_\-\.])$/;
	var n, strCode, hex1, hex2, strEncode = "";

	for(n = 0; n < str.length; n++) {
		if (noEncode.test(str.charAt(n))) {
			strEncode += str.charAt(n);
		} else {
			strCode = str.charCodeAt(n);
			hex1 = hex_chars.charAt(Math.floor(strCode / 16));
			hex2 = hex_chars.charAt(strCode % 16);
			strCode = hex1 + hex2;
			strEncode += (strCode.length == 2 ? "%" + strCode : "-");
		}
	}
return strEncode;
}

// FUNÇÕES POPUP
function AbrePopUp(pURL, pLarg, pAlt){
	pEsq = ((screen.width - pLarg) / 2);
	pTop = ((screen.height - pAlt) / 2);
   	var alerta = window.open(pURL,"UNIARARAS","width="+pLarg+",height="+pAlt+",toolbar=no,location=no,scrollbars=no,menubar=no,status=no,resizable=no,fullscreen=no");
   	if(!alerta) {
      alert('Pop-up bloqueado!\n\nVerifique se você possui em sua máquina algum bloqueador de pop-up.\n\n>> Ferramentas\n>> Bloqueador de Pop-up\n>> Selecione a opção DESATIVAR BLOQUEADOR DE POP-UP \n>> Tente novamente.');
   }		
	//window.open(pURL, "toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width="+pLarg+",height="+pAlt+",left="+pEsq+",top="+pTop);
}

function vopenw() {	
	tbar = 'location=no,status=yes,resizable=yes,scrollbars=yes,width=560,height=535';	
	sw   = window.open('https://www.certisign.com.br/seal/splashcerti.htm','CRSN_Splash',tbar);	
	sw.focus();
}

function popUp(URL, FILE) {
	day = new Date();
	id = day.getTime();
	URLFINAL = URL + "?url=" + FILE;
	eval("page" + id + " = window.open(URLFINAL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=357,height=500,left = 327.5,top = 284.5');");
}
// FIM FUNÇÕES POPUP

function PesquisaOG(div) {
	if (div == 1) {
		document.getElementById('PesquisaOGA').style.display="block";
		document.getElementById('PesquisaOGB').style.display="none";
		document.getElementById('PesquisaOGC').style.display="none";
	}
	if (div == 2) {
		document.getElementById('PesquisaOGB').style.display="block";
		document.getElementById('PesquisaOGA').style.display="none";
		document.getElementById('PesquisaOGC').style.display="none";
	}
	if (div == 3) {
		document.getElementById('PesquisaOGC').style.display="block";
		document.getElementById('PesquisaOGA').style.display="none";
		document.getElementById('PesquisaOGB').style.display="none";
	}
}