	function counterUpdate(opt_countedTextBox, opt_countBody, opt_maxSize) { 
		//Função para contar caracteres em um textarea
		var countedTextBox = opt_countedTextBox ? opt_countedTextBox : "counttxt"; 
		var countBody = opt_countBody ? opt_countBody : "countBody"; 
		var maxSize = opt_maxSize ? opt_maxSize : 1024; 
		
		var field = document.getElementById(countedTextBox); 
		
		if (field && field.value.length >= maxSize) { 
			field.value = field.value.substring(0, maxSize); 
		} 
		var txtField = document.getElementById(countBody); 
		if (txtField) { 
			txtField.innerHTML = field.value.length; 
		} 
	}
	
	function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
			STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
	}
	
	
	function LTrim(STRING){
		while(STRING.charAt(0)==" "){
			STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
	}
	
	function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
	}
	
	function validaForm()
	{			
		if ( ( !validaEmail( document.getElementById("txtEmail") ) )||( document.getElementById("txtNome").value == "" )||( document.getElementById("txtComentario").value == "" ) ) 
		{
			return false;
		}
		else
		{	
			document.getElementById("frmForm").submit();
		}
	}
	
	function validaEmail( obj )
	{
		if (Trim(obj.value) != "") 
		{
			if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(obj.value)) && obj.value != "") 
			{ 
				alert("Favor informar um \"e-mail\" válido.");
				obj.focus();
				return false;
			}
			return true;
		}
		return false;
	}
	
	function abrePopUp(strArquivo, strNomeJanela, intWidth, intHeight, strParametros) {
		var intLeft;
		var intTop;

		intWidthTela = screen.width;
		intHeightTela = screen.height;
		intLeft	= (intWidthTela	- intWidth) / 2;
		intTop	= (intHeightTela - intHeight) / 2;
		window.open(strArquivo,strNomeJanela,'width=' + intWidth + ',height=' + intHeight + ',left=' + intLeft + ',top=' + intTop + ',' + strParametros);
	}
	
	function mudaPaginacao(intPagina) {		
		location.href = 'default.asp?Pagina=' + intPagina;
	}