var NtGeral = 
{

	/*
	Mostra/Oculta um div, alternando
	*/
	showHideDiv: function(nomeDiv)
	{
		var visibilidade = document.getElementById(nomeDiv).style.display;
		
		if (visibilidade == "none" )
			document.getElementById(nomeDiv).style.display = "block";
		else
			document.getElementById(nomeDiv).style.display = "none";
	},
	
	/*
	Copia valor de um controle pro outro
	*/
	copyInputValue: function(from, to)
	{
		document.getElementById(to).value = document.getElementById(from).value;		
	},
	
	/**
	 * Obtem valor de um radio button
	 */
	obterValorRadio: function(id)
	{
		valor = 0;
		radioButton = document.getElementsByName(id);
		for( i = 0; i < radioButton.length; i++ )
		{
			if (radioButton[i].checked == true)
			{
				valor = radioButton[i].value;
				break;
			}
		}
		return valor;
	},
	
	//<input name="login" id="login" type="text" value="login" class="inputPequeno" onfocus="inField(this, 'login')" onblur="outField(this, 'login')" maxlength="150">
	/**
	 * Limpa valor do campo de acordo com conte�do 
	 */
	limparCampo: function(field, text)	
	{
		if(field.value == text)
			field.value = "";
	},
	
	/**
	 * Define valor do campo se estiver branco
	 */
	preencherCampo: function(field, text)
	{
		if(!field.value)
			field.value = text;
	},
	
	/**
	 * Pega valor do GET
	 */
	get: function (nome)
	{
	  nome = nome.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+nome+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( window.location.href );
	  if( results == null )
	    return "";
	  else
	    return results[1];
	}	

}












function htmlEntities(texto){
      //by Micox - elmicox.blogspot.com - www.ievolutionweb.com
    var i,carac,letra,novo='';
    for(i=0;i<texto.length;i++){
        carac = texto[i].charCodeAt(0);
        if( (carac > 47 && carac < 58) || (carac > 62 && carac < 127) ){
            //se for numero ou letra normal
            novo += texto[i];
        }else{
            novo += "&#" + texto[i].charCodeAt(0) + ";";
        }
    }
    return novo;
}

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Ultimater | http://webdeveloper.com/forum/member.php?u
30185 */
function html_entity_decode(str) {
  var ta=document.createElement("textarea");
  ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  return ta.value;
}

// alert(html_entity_decode("&#191;Hablas bien el espa&ntilde;ol?"));





























// show hide layer


<!-- Copyright 2006,2007 Bontrager Connection, LLC

// http://bontragerconnection.com/ and http://willmaster.com/

// Version: July 28, 2007

var cX = 0; var cY = 0; var rX = 0; var rY = 0;

function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}

function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }

else { document.onmousemove = UpdateCursorPosition; }

function AssignPosition(d) {

if(self.pageYOffset) {

rX = self.pageXOffset;

rY = self.pageYOffset;

}

else if(document.documentElement && document.documentElement.scrollTop) {

rX = document.documentElement.scrollLeft;

rY = document.documentElement.scrollTop;

}

else if(document.body) {

rX = document.body.scrollLeft;

rY = document.body.scrollTop;

}

if(document.all) {

cX += rX;

cY += rY;

}

d.style.left = (cX+10-300) + "px";

d.style.top = (cY+10) + "px";

}

function HideContent(d) {

if(d.length < 1) { return; }

document.getElementById(d).style.display = "none";

}

function ShowContent(d) {

if(d.length < 1) { return; }

var dd = document.getElementById(d);

AssignPosition(dd);

dd.style.display = "block";

}

function ReverseContentDisplay(d) {

if(d.length < 1) { return; }

var dd = document.getElementById(d);

AssignPosition(dd);

if(dd.style.display == "none") { dd.style.display = "block"; }

else { dd.style.display = "none"; }

}

//-->

