//********************************************
//*** Abre a Janela
//********************************************
function AbrirJanela() {
	window.open("/CerelabEva/Eva/Login/eLogin.aspx", "eLearning","top=0,left=0,width=" + (screen.width-12) + ",height=" + (screen.height-86) + ",status=yes,resizable=yes,scrollbars=no");
}

//********************************************
//*** Faz Logoff
//********************************************
function EfetuarLogoff() {
    parent.location.href = '/CerelabEva/Eva/Login/Login.aspx';
}

//********************************************
//*** EDITOR DE IMAGENS
//********************************************
function ProcurarImagemEva(Controle, Pasta, LarguraExata, AlturaExata, LarguraMaxima, AlturaMaxima, Tipo){
    ArquivoSelecionado = document.getElementById('ctl00_cphInterno_' + Controle + '_txtValor').value;
    window.open('/CerelabEva/Eva/Estrutura/Control/ImageEdit/Selecionar.aspx?Controle=' + Controle + '&Pasta=' + Pasta + '&LarguraExata=' + LarguraExata + '&AlturaExata=' + AlturaExata + '&LarguraMaxima=' + LarguraMaxima + '&AlturaMaxima=' + AlturaMaxima + '&Arquivo=' + ArquivoSelecionado + '&Tipo=' + Tipo, 'ImageEdit' , 'status=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=210,top=60,width=780,height=580')
}
function EditarImagemEva(Controle, Pasta, LarguraExata, AlturaExata, LarguraMaxima, AlturaMaxima){
    ArquivoSelecionado = document.getElementById('ctl00_cphInterno_' + Controle + '_txtValor').value;
    window.open('/CerelabEva/Eva/Estrutura/Control/ImageEdit/Editor.aspx?Controle=' + Controle + '&Pasta=' + Pasta + '&LarguraExata=' + LarguraExata + '&AlturaExata=' + AlturaExata + '&LarguraMaxima=' + LarguraMaxima + '&AlturaMaxima=' + AlturaMaxima + '&Arquivo=' + ArquivoSelecionado, 'ImageEdit' , 'status=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=210,top=60,width=780,height=580')
}

//********************************************
//*** MODULO MENSAGENS
//********************************************
function MensagemMO(src) {
	src.style.backgroundColor = '#FEFAC5';
}

function MensagemMT(src, Cor) {
	src.style.backgroundColor = Cor;
}

function MensagemMC(src) {
	location.href = src;
}

//********************************************
//*** SCRIPTS PARA OS MODULOS
//********************************************
//function clique() {
//	if (event.button==2||event.button==3) {
//		oncontextmenu='return false';
//		return false;
//	}
//	return true;
//}
////document.onmousedown=clique
////document.oncontextmenu = new Function("return false;")

//function disableselect(e){
//	return false
//}
//function reEnable(){
//	return true
//}
//document.onselectstart=new Function ("return false")
//if (window.sidebar){
//	document.onmousedown=disableselect;
//	document.onclick=reEnable;
//}

//********************************************
//*** PRÉ-LOAD
//********************************************
function PreLoadImage(src) {
    MM_preloadImages('/CerelabEva/AdDynamic/Comum/Button/' + src + 'Over.gif');
}

function PreLoadImageAny(imagem) {
    MM_preloadImages(imagem);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//********************************************
//*** ROLAGEM DA TELA DE AGUARDE
//********************************************
function RolarAguarde() {
    document.getElementById('lyrAguarde').style.top = document.body.scrollTop;
}

//********************************************
//*** Links do menu em Flash
//********************************************
function eCallMenu(src) {
	var Local;
	switch(src) {
	    case 1 : Local = 'Inicio/Default.aspx?Menu=1'; break;
		case 2 : Local = 'Modulo/Default.aspx?Menu=2'; break;
		case 3 : Local = 'Atividade/Default.aspx?Menu=3'; break;
		case 4 : Local = 'Mensagem/Default.aspx?Menu=4'; break;
		case 5 : Local = 'Download/Default.aspx?Menu=5'; break;
		case 6 : Local = 'Chat/Default.aspx?Menu=6'; break;
		case 7 : Local = 'Glossario/Default.aspx?Menu=7'; break;
		case 8 : Local = 'Ajuda/Default.aspx?Menu=8'; break;
		default : Local = 'Inicio/Default.aspx?Menu=1';
	}
	document.location.href = '/CerelabEva/Eva/' + Local;
}

//********************************************
//***  Fecha a Janela
//********************************************
function eFechar() {
	parent.window.close();
}

//********************************************
//*** Insere arquivos de mídia
//********************************************
function InsereFlash(Arquivo, Largura, Altura, FlashVars) {
	document.write('<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
	document.write('height="' + Altura + '" width="' + Largura + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>');
	document.write('<PARAM NAME="_cx" VALUE="15425">');
	document.write('<PARAM NAME="_cy" VALUE="741">');
	document.write('<PARAM NAME="FlashVars" VALUE="' + FlashVars + '">');
	document.write('<PARAM NAME="Movie" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="Src" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="WMode" VALUE="Transparent">');
	document.write('<PARAM NAME="Play" VALUE="-1">');
	document.write('<PARAM NAME="Loop" VALUE="-1">');
	document.write('<PARAM NAME="Quality" VALUE="High">');
	document.write('<PARAM NAME="SAlign" VALUE="">');
	document.write('<PARAM NAME="Menu" VALUE="-1">');
	document.write('<PARAM NAME="Base" VALUE="">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="">');
	document.write('<PARAM NAME="Scale" VALUE="ShowAll">');
	document.write('<PARAM NAME="DeviceFont" VALUE="0">');
	document.write('<PARAM NAME="EmbedMovie" VALUE="0">');
	document.write('<PARAM NAME="BGColor" VALUE="">');
	document.write('<PARAM NAME="SWRemote" VALUE="">');
	document.write('<PARAM NAME="MovieData" VALUE="">');
	document.write('<PARAM NAME="SeamlessTabbing" VALUE="1">');
	document.write('<PARAM NAME="Profile" VALUE="0">');
	document.write('<PARAM NAME="ProfileAddress" VALUE="">');
	document.write('<PARAM NAME="ProfilePort" VALUE="0">');
	document.write('<embed src="' + Arquivo + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ');
	document.write('type="application/x-shockwave-flash" width="' + Largura + '" height="' + Altura + '"> </embed>');
	document.write('</OBJECT>');
}

function CodigoFlash(Arquivo, Largura, Altura, FlashVars) {
    Retorno = '<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ';
	Retorno += 'height="' + Altura + '" width="' + Largura + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>';
	Retorno += '<PARAM NAME="_cx" VALUE="15425">';
	Retorno += '<PARAM NAME="_cy" VALUE="741">';
	Retorno += '<PARAM NAME="FlashVars" VALUE="' + FlashVars + '">';
	Retorno += '<PARAM NAME="Movie" VALUE="' + Arquivo + '">';
	Retorno += '<PARAM NAME="Src" VALUE="' + Arquivo + '">';
	Retorno += '<PARAM NAME="WMode" VALUE="Transparent">';
	Retorno += '<PARAM NAME="Play" VALUE="-1">';
	Retorno += '<PARAM NAME="Loop" VALUE="-1">';
	Retorno += '<PARAM NAME="Quality" VALUE="High">';
	Retorno += '<PARAM NAME="SAlign" VALUE="">';
	Retorno += '<PARAM NAME="Menu" VALUE="-1">';
	Retorno += '<PARAM NAME="Base" VALUE="">';
	Retorno += '<PARAM NAME="AllowScriptAccess" VALUE="">';
	Retorno += '<PARAM NAME="Scale" VALUE="ShowAll">';
	Retorno += '<PARAM NAME="DeviceFont" VALUE="0">';
	Retorno += '<PARAM NAME="EmbedMovie" VALUE="0">';
	Retorno += '<PARAM NAME="BGColor" VALUE="">';
	Retorno += '<PARAM NAME="SWRemote" VALUE="">';
	Retorno += '<PARAM NAME="MovieData" VALUE="">';
	Retorno += '<PARAM NAME="SeamlessTabbing" VALUE="1">';
	Retorno += '<PARAM NAME="Profile" VALUE="0">';
	Retorno += '<PARAM NAME="ProfileAddress" VALUE="">';
	Retorno += '<PARAM NAME="ProfilePort" VALUE="0">';
	Retorno += '<embed src="' + Arquivo + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	Retorno += 'type="application/x-shockwave-flash" width="' + Largura + '" height="' + Altura + '" FlashVars="' + FlashVars + '" ';
	Retorno += '_cx="15425" _cy="741" WMode="Transparent" Menu="-1" Scale="ShowAll" DeviceFont="0" EmbedMovie="0" SeamlessTabbing="1" Profile="0" ProfilePort="0"></embed>';
	Retorno += '</OBJECT>';
	
	return Retorno;
}

function CodigoMediaPlayer(Arquivo, Largura, Altura) {
	Retorno = '<OBJECT ID="MediaPlayer1" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject"  width="' + Largura + '" height="' + Altura + '" VIEWASTEXT>"';
	Retorno += '<PARAM NAME="FileName" VALUE="' + Arquivo + '">';
	Retorno += '<PARAM NAME="animationatStart" VALUE="TRUE">';
	Retorno += '<PARAM NAME="transparentatStart" VALUE="FALSE">';
	Retorno += '<PARAM NAME="autoStart" VALUE="true">';
	Retorno += '<PARAM NAME="autoSize" VALUE="false">';
	Retorno += '<PARAM NAME="showStatusBar" VALUE="false">';
	Retorno += '<PARAM NAME="showControls" VALUE="false">';
	Retorno += '<PARAM NAME="showDisplay" VALUE="false">';
	Retorno += '<EMBED type="application/x-mplayer2" pluginspage="mms://www.microsoft.com/windows/windowsmedia/intl/download/default.asp?DispLang=br" SRC="' + Arquivo + '" width="' + Largura + '" height="' + Altura + '" AutoStart=true showControls=false showDisplay=false>';
	Retorno += '</EMBED></OBJECT>';
	
	return Retorno;
}

function CodigoRealPlayer(Arquivo, Largura, Altura) {
    Retorno = '<object classid="CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+ Largura +'" height="'+ Altura +'">';
    Retorno +='<param name="SRC" VALUE="' + Arquivo + '" />';
    Retorno +='<param name="CONTROLS" value="ImageWindow" />';
    Retorno +='<PARAM NAME="AUTOSTART" VALUE="1" />';
    Retorno +='<param name="CONSOLE" value="cons" />';
    Retorno +='<embed src="' + Arquivo + '" autostart="1" type="audio/x-pn-realaudio-plugin" width="'+ Largura +'" height="'+ Altura +'" controls="ImageWindow" console="Filme"></embed></object>';
	
	return Retorno;
}

function CodigoQuickTime(Arquivo, Largura, Altura) {
    Retorno = '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"  WIDTH="'+ Largura +'" HEIGHT="'+ Altura +'" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">';
    Retorno += '<PARAM NAME="src" VALUE="' + Arquivo + '">';
    Retorno += '<PARAM NAME="controller" VALUE="false">';
    Retorno += '<PARAM NAME="target" VALUE="myself">';
    Retorno += '<PARAM NAME="href" VALUE="' + Arquivo + '">';
    Retorno += '<PARAM NAME="scale" VALUE="tofit">';
    Retorno += '<PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/">';
    Retorno += '<EMBED WIDTH="'+ Largura +'" HEIGHT="'+ Altura +'" CONTROLLER="false" TARGET="myself" HREF="' + Arquivo + '" SRC="' + Arquivo + '" BGCOLOR="FFFFFF" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html" SCALE="tofit"></EMBED>';
	
	return Retorno;
}

//********************************************
//*** PRÉ-LOAD
//********************************************
function PreLoadImage(src) {
    MM_preloadImages('/CerelabEva/AdDynamic/Comum/Button/' + src + 'Over.gif');
}

function PreLoadImageAny(imagem) {
    MM_preloadImages(imagem);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}