 //<![CDATA[

 // If you don't want to put unstandard properties in your stylesheet, here's yet
 // another means of activating the script. This assumes that you have at least one
 // stylesheet included already. Remove the /* and */ lines to activate.

 /*
 if (document.all && document.styleSheets && document.styleSheets[0] &&
  document.styleSheets[0].addRule)
 {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  document.styleSheets[0].addRule('*', 'behavior: url(iepngfix.htc)'; background-repeat: repeat;);
 }
 */

 //]]>

// envia form por submit
function linkSubmit(var_value){
	var frm_hidden = document.getElementById("frm_hidden");
	frm_hidden.id_mensagem.value = var_value;
	frm_hidden.submit();
}


function poup (URL, opcao, nome){
	if (nome == null) nome = "janela01"
   window.open(URL,nome, opcao);
}

var janela_aberta;
var t;

function checa_janela() {

    if(janela_aberta == undefined || janela_aberta.closed == true) {
        document.getElementById('img_radio').src = "img/radio_abrir.jpg";
        document.getElementById('link_radio').href = "javascript:;";
        document.getElementById('link_radio').onclick = "window.open('radio.php','janela05','width=350,height=180');";
    }
    else {
        document.getElementById('img_radio').src = "img/radio_fechar.jpg";
        document.getElementById('link_radio').href = "javascript:;";
		document.getElementById('link_radio').onclick = "janela05.close()";
    }

    t = setTimeout("checa_janela()", 1000);
}

function sf() {	
	contador_caracteres('texto_conteudo', 'contador', 255);
      document.getElementById('texto_conteudo').focus();  
}

function contador_caracteres(opt_texto_conteudo, opt_contador, opt_maxSize) {
  var texto_conteudo = opt_texto_conteudo ?
    opt_texto_conteudo : "texto_conteudo";
  var contador = opt_contador ? opt_contador : "contador";
  var maxSize = opt_maxSize ? opt_maxSize : 255;
    
  var field = document.getElementById(texto_conteudo);
  if (field && field.value.length >= maxSize) {
    field.value = field.value.substring(0, maxSize);
  }
  var txtField = document.getElementById(contador);
  if (txtField) {  
    txtField.innerHTML = field.value.length;
  }
}
