blog = {
	idPost : 0,
	nome : '',
	email : '',
	site : '',
	mensagem : '',
	receber : 0,
	
	enviar : function(){
		this.limpaValidacao();
		msg = this.valida();
		if (msg == ''){
			var strRet = classBlogComentarios.insere(this.idPost, this.nome, this.email, this.site, this.mensagem).value;
			if (strRet == 'ok'){
			    document.formComentario.reset();
			    document.getElementById('divErro').style.display = 'none';
			    document.getElementById('divErro2').style.display = 'none';
			    document.getElementById('divSucesso').style.display = '';
			}else{
			    document.getElementById('divErro').style.display = 'none';
			    document.getElementById('divErro2').style.display = '';
			    document.getElementById('divSucesso').style.display = 'none';
			}
		}else{
			document.getElementById('divErro').style.display = '';
			document.getElementById('divErro2').style.display = 'none';
			document.getElementById('divSucesso').style.display = 'none';
		}
	},
	
	valida : function(){
		this.idPost = document.getElementById('txtIdPost').value;
		this.nome = document.getElementById('txtNome').value;
		this.email = document.getElementById('txtEmail').value;
		this.site = document.getElementById('txtSite').value;
		this.mensagem = document.getElementById('txtMensagem').value;
		//this.receber = FuncoesGerais.RetornaValorCheckUnico(document.getElementById('chkNews'));
		msg = '';
		
		if (this.nome == ''){
			msg = 'Nome';
			document.getElementById('txtNome').style.backgroundColor="#ecb2b1";
		}
		if (FuncoesGerais.ValidaEmail(this.email) == 0){
			msg = 'E-mail';
			document.getElementById('txtEmail').style.backgroundColor="#ecb2b1"
		}
		if (this.mensagem == ''){
			msg = 'Mensagem';
			document.getElementById('txtMensagem').style.backgroundColor="#ecb2b1"
		}
		
		return msg;
	},
	
	limpaValidacao : function(){
		document.getElementById('txtNome').style.backgroundColor="#ffffff";
		document.getElementById('txtEmail').style.backgroundColor="#ffffff";
		document.getElementById('txtMensagem').style.backgroundColor="#ffffff";
	},
	
	aumentaFonte : function(div){
		alert(document.getElementById(div).currentStyle.fontSize);
		document.getElementById(div).style.fontSize = document.getElementById(div).style.fontSize + 1;
	},
	
	diminuiFonte : function(div){
		document.getElementById(div).style.fontSize = document.getElementById(div).style.fontSize - 1;
	},
	
	tagAlvo : new Array('p'),
	tamanhos : new Array( '9px','10px','11px','12px','13px','14px','15px','16px','17px','18px','19px','20px'),
	tamanhoInicial : 4,
	
	mudaTamanho : function (idAlvo, acao){   
		if (!document.getElementById) 
			return   
		
		var selecionados = null,tamanho = this.tamanhoInicial,i,j,tagsAlvo;   
		tamanho += acao;   
		if ( tamanho < 0 ) 
			tamanho = 0;   
			
		if ( tamanho > 11 ) 
			tamanho = 11;   
			
		this.tamanhoInicial = tamanho;   
		if ( !( selecionados = document.getElementById( idAlvo ) ) ) 
			selecionados = document.getElementsByTagName( idAlvo )[ 0 ];      
		
		selecionados.style.fontSize = this.tamanhos[ tamanho ];      
		for ( i = 0; i < this.tagAlvo.length; i++ ){     
			tagsAlvo = selecionados.getElementsByTagName( this.tagAlvo[ i ] );     
			for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = this.tamanhos[ tamanho ];   
		} 
	},
	
	nomeIndique : '',
	emailIndique : '',
	amigosIndique : '',
	
	indique : function(){
		this.limpaValidacaoIndique();
		msg = this.validaIndique();
		if (msg == ''){
			//classBlogComentarios.insere(this.idPost, this.nome, this.email, this.site, this.mensagem);
			document.formIndique.reset();
			document.getElementById('divErroIndique').style.display = 'none';
			document.getElementById('divSucessoIndique').style.display = '';
		}else{
			document.getElementById('divErroIndique').style.visibility = 'visible';
		}
	},
	
	validaIndique : function(){
		this.idPost = document.getElementById('txtIdPost').value;
		this.nomeIndique = document.getElementById('txtNomeIndique').value;
		this.emailIndique = document.getElementById('txtEmailIndique').value;
		this.amigosIndique = document.getElementById('txtAmigosIndique').value;
		msg = '';
		
		if (this.nomeIndique == ''){
			msg = 'Nome';
			document.getElementById('txtNomeIndique').style.backgroundColor="#ecb2b1";
		}
		if (FuncoesGerais.ValidaEmail(this.emailIndique) == 0){
			msg = 'E-mail';
			document.getElementById('txtEmailIndique').style.backgroundColor="#ecb2b1"
		}
		if (this.amigosIndique == ''){
			msg = 'Nome';
			document.getElementById('txtAmigosIndique').style.backgroundColor="#ecb2b1";
		}
		
		return msg;
	},
	
	limpaValidacaoIndique : function(){
		document.getElementById('txtNomeIndique').style.backgroundColor="#ffffff";
		document.getElementById('txtEmailIndique').style.backgroundColor="#ffffff";
		document.getElementById('txtAmigosIndique').style.backgroundColor="#ffffff";
	}
}