﻿//***************************************************************************/
//*** FUNÇÃO QUE FAZ O "LINK" PARA A PÁGINA INTERNA DE DICA DO PROFESSOR ***/
//*************************************************************************/
function callProfessor(id) {
    location.href = '/maiseducacao/home/oficina_interna.aspx?codigo=' + id + '&pagina=DICA';
}

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="noscale">');
    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 + '" FlashVars="' + FlashVars + '" ');
    document.write('_cx="15425" _cy="741" WMode="Transparent" Menu="-1" Scale="noscale" DeviceFont="0" EmbedMovie="0" SeamlessTabbing="1" Profile="0" ProfilePort="0"></embed>');
    document.write('</object>');
}

//*******************************************************************************/
//*** FUNÇÃO UTILIZADA PARA ABRIR O SIMULADO ONLINE NO TEM+ EDUCAÇÃO OFICINA ***/
//*****************************************************************************/
function AbreJanela() {
    window.open('http://www.oficinadoestudante.com.br/site_novo/simulado/index.php', 'SIMULADO', 'width=760, height=500, scrollbars=yes');
}

//*************************************************************************************/
//*** Verifica qual campo está sendo digitado e dá o focus no botão correspondente ***/
//***********************************************************************************/
function setFocus(e, botaoId) {
    var tecla = window.event ? e.keyCode : e.which;

    if (tecla == 13) {
        document.getElementById('ctl00_' + botaoId).focus();
        document.getElementById('ctl00_' + botaoId).click();
    }
}

//************************************************************/
//*** LIMPA O CAMPO DE BUSCA QUANDO O MESMO GANHA O FOCUS ***/
//**********************************************************/
function limpaBox(Campo, mensagem) {
    if (document.getElementById(Campo).value == mensagem) {
        document.getElementById(Campo).value = "";
    }
}

function verBox(Campo, mensagem) {
    if (document.getElementById(Campo).value == "") {
        document.getElementById(Campo).value = mensagem;
    }
}

function validaBusca(campoBusca, valorCampo) {
    if ((document.getElementById(campoBusca).value == '') || (document.getElementById(campoBusca).value == valorCampo)) {
        alert('Atenção!!!\nInforme o conteúdo que deseja buscar.');
        document.getElementById(campoBusca).focus();
        return false;
    }
    else if (document.getElementById(campoBusca).value.length < 3) {
        alert('Atenção!!!\nInforme no minímo 3 letras.');
        document.getElementById(campoBusca).focus();
        return false;
    }

    return true;
}