﻿/***************************************
*** contar caracteres resposta
****************************************/
function Contar() {
    Texto = document.getElementById('ctl00_ContentPlaceHolder1_txtResposta').value;
    if (Texto.length >= 400) {
        alert("O tamanho máximo para a mensagem é de 400 caracteres.");
        return false;
    }
    else {
        return true;
    }
}

function Contador() {
    Texto = document.getElementById('ctl00_ContentPlaceHolder1_txtResposta').value;
    document.getElementById("lblContar").innerHTML = 'Caracteres restantes: ' + (400 - Texto.length);
}

////////////////////////////////////////////////////////////////////////////////////
// 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();
    }
}

/***************************************
*** campos de busca
****************************************/
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 limpaBoxSenha(Campo) {
    if (document.getElementById(Campo).value == "") {
        document.getElementById(Campo).style.backgroundPosition = "left -24px";
    }
}

function verBoxSenha(Campo) {
    if (document.getElementById(Campo).value == "") {
        document.getElementById(Campo).style.backgroundPosition = "left 0px";
    } else { 
    
    }
}

function callDestaque(idPromo) {
    alert(idPromo);
}

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>');
}


/* fechar DHTML */
function fechar() {
 try {
    var obj = document.getElementById('div_dhtml_home');
    if (obj.style.visibility == 'hidden') {
         obj.style.visibility = 'visible';
         obj.style.width = 'auto';
         obj.style.height = 'auto';
    }
    else {
         obj.style.visibility = 'hidden';
         obj.style.overflow = 'hidden';
         obj.style.width = '1px';
         obj.style.height = '1px';
         obj.style.bottom = '1px';
         obj.style.right = '1px';
         //obj.style.left = '-9000px';
         obj.style.display = 'none'
         // alert("aaa" + obj.style.right)
         //alert('123456');
         }

    } catch (e) {
    status = e.message
  }
} 
