 //<![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);
}

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;
  }
}

function trocaClass(c1, c2, id) {
    var ob = document.getElementById(id);
    
    if(ob.className == c1) {
        ob.className = c2;
    } else {
        ob.className = c1;
    }
}
