function AbreJanela(link,x,y,s) {
	var t = (screen.height - y) / 2;
	var e = (screen.width - x) / 2;

	window.open(link,x+y,'width=' + x + ',height=' + y + ',scrollbars=' + s + ',toolbar=0,location=0,status=0,menubar=0,resizable=0,left=' + e + ',top=' + t + '');
}

var PopUp = null
function FocaJanela(){
	if (PopUp!=null && !PopUp.closed){
		PopUp.focus();
	}
}

function Fecha(Tipo){
	if(Tipo=='C'){
		if(confirm('Deseja cancelar esta operação?')){
			window.close()
			window.opener.location.reload();
		}else{
			return false;
		}
	}else if(Tipo=='F'){
		window.close()
		window.opener.location.reload();
	}else{
		window.close();
	}
}

function PageLoad(){
	window.opener.location.reload();
}

function Voltar(){
	history.back(0);
}

// ******************************************************
// *********** mostra determinada area ************
// ******************************************************
function ShowHide(IdObjeto){
	if (document.getElementById(IdObjeto).style.display == 'block'){
		document.getElementById(IdObjeto).style.display = 'none';
	} else {
		document.getElementById(IdObjeto).style.display = 'block';
	}
}

function Show(IdObjeto){
	document.getElementById(IdObjeto).style.display = '';
}

function Hide(IdObjeto){
	document.getElementById(IdObjeto).style.display = 'none';
}

function Confirma(Msg,Url){
	if(confirm(Msg)){
		location.href = Url
		return false;
	}else{
		return false;
	}
}

function ExibeImg(Valor,ObjDestino){
	document.getElementById(ObjDestino).src = Valor;
}

function FrmEnvia(Confirma,Msg,ObjId){
	if(Confirma==1){
		if(confirm(Msg)){
			document.getElementById(ObjId).submit();
		}
	}else{
		document.getElementById(ObjId).submit();
	}
	return false;
}

function GridFoto(NomeClass,IdObj,idCheck){
	var CheckBox = document.getElementById(idCheck).checked;
	if(CheckBox == false){
		document.getElementById(IdObj).className = NomeClass;
	}
}

function ClicaFoto(IdObj,idCheck){
	CheckBox = document.getElementById(idCheck).checked;
	if(CheckBox == false){
		document.getElementById(idCheck).checked = true;
		document.getElementById(IdObj).className = 'FotoC';
	}else{
		document.getElementById(idCheck).checked = false;
		document.getElementById(IdObj).className = 'FotoA';
	}
	//alert(document.getElementById(idCheck).checked);
}

function GridCategoria(NomeClass,IdObj,idCheck){
	var CheckBox = document.getElementById(idCheck).checked;
	if(CheckBox == false){
		document.getElementById(IdObj).className = NomeClass;
	}
}

function ClicaCategoria(IdObj,idCheck){
	CheckBox = document.getElementById(idCheck).checked;
	if(CheckBox == false){
		document.getElementById(idCheck).checked = true;
		document.getElementById(IdObj).className = 'CategoriaC';
	}else{
		document.getElementById(idCheck).checked = false;
		document.getElementById(IdObj).className = 'CategoriaA';
	}
	//alert(document.getElementById(idCheck).checked);
}

function GridSelecionar(){
	CheckBox = document.getElementsByTagName('input');
	for (var i=0;i<CheckBox.length;i++){
		if(CheckBox[i].type=='checkbox'){
			CheckBox[i].checked = true;
		}
	}
}

function Base(){
	document.getElementById('Base').style.bottom = '0px';
}
//window.onresize = Base;

function WSize(W,H){
	window.resizeTo(W,H)
	
	var t = (screen.height - H) / 2;
	var e = (screen.width - W) / 2;
	
	window.moveTo(e,t);
}


FonteI = 14
function Fonte(Tipo,idObj){
	if(Tipo=='Mais' && FonteI<24){
		FonteI++
	}else if(Tipo=='Menos' && FonteI>8){
		FonteI--
	}
	document.getElementById(idObj).style.fontSize = FonteI+"px";
	//alert(FonteI)
}

function IsEmail(pVal){
	var reTipo = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	return reTipo.test(pVal);
}

function ConteudoFlash(swf,largura,altura,VSpace,HSpace){
	STRFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'" vspace="'+VSpace+'" hspace="'+HSpace+'">'
	STRFlash += '<param name="movie" value="'+swf+'" />'
    STRFlash += '<param name="quality" value="high" />'
    STRFlash += '<param name="wmode" value="transparent" />'
	STRFlash += '<embed src="'+swf+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'" wmode="transparent" vspace="'+VSpace+'" hspace="'+HSpace+'"></embed>'
	STRFlash += '</object>'
	document.write(STRFlash);
}

/*TollType*/
var qTipTag = "a,label,div,img"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = 0; //This is qTip's X offset//
var qTipY = 15; //This is qTip's Y offset//

//There's No need to edit anything below this line//
tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

window.onload = function () {
	tooltip.init ();
}
/**/

/*Distrito*/
function ValidaContato(){
	Nome = document.getElementById('Nome');
	Email = document.getElementById('Email');
	Assunto = document.getElementById('Assunto');
	Mensagem = document.getElementById('Mensagem');
	
	if(Nome.value==''){
		alert('Informe seu nome.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Nome.focus();
		return false;
	}
	
	if(Email.value==''){
		alert('Informe seu E-mail.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}

	if(IsEmail(Email.value)==false){
		alert('Seu E-mail é inválido.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}

	if(Assunto.value==''){
		alert('Informe o assunto.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Assunto.focus();
		return false;
	}
	
	if(Mensagem.value==''){
		alert('Informe a mensagem.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Mensagem.focus();
		return false;
	}
	return true;
}

function ValidaContato2(){
	NomeAmigo = document.getElementById('NomeAmigo');
	EmailAmigo = document.getElementById('EmailAmigo');
	Nome = document.getElementById('Nome');
	Email = document.getElementById('Email');
	//Comentario = document.getElementById('Comentario');
	
	if(NomeAmigo.value==''){
		alert('Informe o nome do amigo.');
		//NomeAmigo.style.backgroundColor = '#FFE6E6';
		NomeAmigo.focus();
		return false;
	}
	
	if(EmailAmigo.value==''){
		alert('Informe o e-mail do amigo.');
		//EmailAmigo.style.backgroundColor = '#FFE6E6';
		EmailAmigo.focus();
		return false;
	}
	
	if(IsEmail(EmailAmigo.value)==false){
	alert('Seu E-mail é inválido.');
	//EmailAmigo.style.backgroundColor = '#FFE6E6';
	EmailAmigo.focus();
	return false;
	}
	
	if(Nome.value==''){
		alert('Informe seu nome.');
		//Nome.style.backgroundColor = '#FFE6E6';
		Nome.focus();
		return false;
	}
	
	if(Email.value==''){
		alert('Informe seu E-mail.');
		//Email.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}

	if(IsEmail(Email.value)==false){
		alert('Seu E-mail é inválido.');
		//Email.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}
	
	//if(Comentario.value==''){
		//alert('Insira um Comentario.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		//Comentario.focus();
		//return false;
	//}
	return true;
}

function ValidaBusca(){
	Busca = document.getElementById('Busca');
	
	if(Busca.value==''){
		alert('Informe sua busca.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Busca.focus();
		return false;
	}
	return true;
}

function AgendaContato(){
	Nome = document.getElementById('Nome');
	Assunto = document.getElementById('Assunto');
	Mensagem = document.getElementById('Mensagem');
	Telefone = document.getElementById('Telefone');
	Dia  = document.getElementById('Dia');
	Mes  = document.getElementById('Mes');
	Ano  = document.getElementById('Ano');
	Hora = document.getElementById('Hora');
	Min  = document.getElementById('Min');
	
	
	if(Nome.value==''){
		alert('Informe seu nome.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Nome.focus();
		return false;
	}

	if(Assunto.value==''){
		alert('Informe o assunto.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Assunto.focus();
		return false;
	}
	
	if(Mensagem.value==''){
		alert('Informe a mensagem.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Mensagem.focus();
		return false;
	}

	if(Telefone.value==''){
		alert('Informe o telefone.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Telefone.focus();
		return false;
	}
	if(Dia.value==''){
		alert('Informe o Dia.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Dia.focus();
		return false;
	}
	if(Mes.value==''){
		alert('Informe o Mes.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Mes.focus();
		return false;
	}
	if(Ano.value==''){
		alert('Informe o Ano.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Ano.focus();
		return false;
	}
	if(Hora.value==''){
		alert('Informe o Hora.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Hora.focus();
		return false;
	}
	if(Min.value==''){
		alert('Informe o Min.');
		//SeuNome.style.backgroundColor = '#FFE6E6';
		Min.focus();
		return false;
	}	
	return true;
}

function ValidaTrabalheConosco(){
	nome = document.getElementById('nome');
	dtnascimento = document.getElementById('dtnascimento');
	endereco = document.getElementById('endereco');
	no = document.getElementById('no');
	bairro  = document.getElementById('bairro');
	cidade  = document.getElementById('cidade');
	CEP1  = document.getElementById('CEP1');
	CEP2 = document.getElementById('CEP2');
	telefone  = document.getElementById('telefone');
	email  = document.getElementById('email');
	escola1  = document.getElementById('escola1');
	curso1  = document.getElementById('curso1');
	pretensaosalarial  = document.getElementById('pretensaosalarial');	
	
	if(nome.value==''){
		alert('Informe seu nome.');
		nome.style.backgroundColor = '#D5E7FB';
		nome.focus();
		return false;
	}
	if(dtnascimento.value==''){
		alert('Informe a data de nascimento.');
		dtnascimento.style.backgroundColor = '#D5E7FB';
		dtnascimento.focus();
		return false;
	}
	if(endereco.value==''){
		alert('Informe o endereco.');
		endereco.style.backgroundColor = '#D5E7FB';
		endereco.focus();
		return false;
	}
	if(no.value==''){
		alert('Informe o Número de seu endereço.');
		no.style.backgroundColor = '#D5E7FB';
		no.focus();
		return false;
	}
	if(bairro.value==''){
		alert('Informe o bairro.');
		bairro.style.backgroundColor = '#D5E7FB';
		bairro.focus();
		return false;
	}
	if(cidade.value==''){
		alert('Informe a cidade.');
		cidade.style.backgroundColor = '#D5E7FB';
		cidade.focus();
		return false;
	}
	if(CEP1.value==''){
		alert('Informe o CEP.');
		CEP1.style.backgroundColor = '#D5E7FB';
		CEP1.focus();
		return false;
	}
	if(CEP2.value==''){
		alert('Informe o CEP.');
		CEP2.style.backgroundColor = '#D5E7FB';
		CEP1.focus();
		return false;
	}
	if(telefone.value==''){
		alert('Informe o Telefone.');
		telefone.style.backgroundColor = '#D5E7FB';
		telefone.focus();
		return false;
	}
	if(email.value==''){
		alert('Informe seu E-mail.');
		email.style.backgroundColor = '#D5E7FB';
		email.focus();
		return false;
	}
	if(IsEmail(email.value)==false){
		alert('Seu E-mail é inválido.');
		email.style.backgroundColor = '#D5E7FB';
		email.focus();
		return false;
	}	
	if(escola1.value==''){
		alert('Informe o Escola.');
		escola1.style.backgroundColor = '#D5E7FB';
		escola1.focus();
		return false;
	}
	if(curso1.value==''){
		alert('Informe o Curso.');
		curso1.style.backgroundColor = '#D5E7FB';
		curso1.focus();
		return false;
	}
	if(pretensaosalarial.value==''){
		alert('Informe Quanto Pretende Ganhar.');
		pretensaosalarial.style.backgroundColor = '#D5E7FB';
		pretensaosalarial.focus();
		return false;
	}	
	return true;
}

function ValidaEnquete(){
	var controle = 0;
	for (i=0;i<document.FrmEnquete.elements.length;i++){
		if (document.FrmEnquete.elements[i].type == "radio"){
			if (document.FrmEnquete.elements[i].checked == true){
			controle++;
			}
		}
	}
	if (controle <= 0){
		alert("Selecione uma das opções");
		return false;
	}
	//alert(controle);
}

function ValidaMotoClube(){
	MotoClubeNome = document.getElementById('MotoClubeNome');
	MotoClubePresidente = document.getElementById('MotoClubePresidente');
	MotoClubeDataFundacao = document.getElementById('MotoClubeDataFundacao');
	MotoClubeEmail = document.getElementById('MotoClubeEmail');
	MotoClubeRua	= document.getElementById('MotoClubeRua');
	MotoClubeNumero	= document.getElementById('MotoClubeNumero');
	MotoClubeBairro	= document.getElementById('MotoClubeBairro');
	MotoClubeCidade	= document.getElementById('MotoClubeCidade');
	MotoClubeEstado	= document.getElementById('MotoClubeEstado');
	MotoClubePais	= document.getElementById('MotoClubePais');
	
	if(MotoClubeNome.value==''){
		alert('Informe nome do Moto Clube.');
		//MotoClubeNome.style.backgroundColor = '#FFE6E6';
		MotoClubeNome.focus();
		return false;
	}
	
	if(MotoClubePresidente.value==''){
		alert('Informe o Presidente.');
		//MotoClubePresidente.style.backgroundColor = '#FFE6E6';
		MotoClubePresidente.focus();
		return false;
	}

	if(MotoClubeDataFundacao.value==''){
		alert('Informe a data de fundação.');
		//MotoClubeDataFundacao.style.backgroundColor = '#FFE6E6';
		MotoClubeDataFundacao.focus();
		return false;
	}

	if(MotoClubeEmail.value==''){
		alert('Informe o email.');
		//MotoClubeEmail.style.backgroundColor = '#FFE6E6';
		MotoClubeEmail.focus();
		return false;
	}

	if(IsEmail(MotoClubeEmail.value)==false){
		alert('Seu E-mail é inválido.');
		//MotoClubeEmail.style.backgroundColor = '#D5E7FB';
		MotoClubeEmail.focus();
		return false;
	}	

	if(MotoClubeRua.value==''){
		alert('Informe sua Rua.');
		//MotoClubeRua.style.backgroundColor = '#FFE6E6';
		MotoClubeRua.focus();
		return false;
	}
	
	if(MotoClubeNumero.value==''){
		alert('Informe seu Número.');
		//MotoClubeNumero.style.backgroundColor = '#FFE6E6';
		MotoClubeNumero.focus();
		return false;
	}
	
	if(MotoClubeBairro.value==''){
		alert('Informe seu Bairro.');
		//MotoClubeBairro.style.backgroundColor = '#FFE6E6';
		MotoClubeBairro.focus();
		return false;
	}
	
	if(MotoClubeCidade.value==''){
		alert('Informe sua Cidade.');
		//MotoClubeCidade.style.backgroundColor = '#FFE6E6';
		MotoClubeCidade.focus();
		return false;
	}
	
	if(MotoClubeEstado.value=='UF'){
		alert('Informe seu Estado.');
		//MotoClubeEstado.style.backgroundColor = '#FFE6E6';
		MotoClubeEstado.focus();
		return false;
	}
	
	if(MotoClubePais.value==''){
		alert('Informe seu País.');
		//MotoClubeEstado.style.backgroundColor = '#FFE6E6';
		MotoClubePais.focus();
		return false;
	}
	
	return true;
}

function ValidaAgenda(){
	AgendaEvento = document.getElementById('AgendaEvento');
	AgendaCidade	= document.getElementById('AgendaCidade');	
	AgendaLocal = document.getElementById('AgendaLocal');
	AgendaDataInicial = document.getElementById('AgendaDataInicial');
	AgendaDataFinal = document.getElementById('AgendaDataFinal');
	AgendaTexto	= document.getElementById('AgendaTexto');
	
	if(AgendaEvento.value==''){
		alert('Informe título da agenda.');
		//AgendaEvento.style.backgroundColor = '#FFE6E6';
		AgendaEvento.focus();
		return false;
	}
	
	if(AgendaCidade.value==''){
		alert('Informe sua cidade.');
		//AgendaCidade.style.backgroundColor = '#FFE6E6';
		AgendaCidade.focus();
		return false;
	}	
	
	if(AgendaLocal.value==''){
		alert('Informe o local.');
		//AgendaLocal.style.backgroundColor = '#FFE6E6';
		AgendaLocal.focus();
		return false;
	}

	if(AgendaDataInicial.value==''){
		alert('Informe a data inicial.');
		//AgendaDataInicial.style.backgroundColor = '#FFE6E6';
		AgendaDataInicial.focus();
		return false;
	}

	if(AgendaDataFinal.value==''){
		alert('Informe a data final.');
		//AgendaDataFinal.style.backgroundColor = '#FFE6E6';
		AgendaDataFinal.focus();
		return false;
	}
	
	if(AgendaTexto.value==''){
		alert('Informe a descrição do evento.');
		//AgendaTexto.style.backgroundColor = '#FFE6E6';
		AgendaTexto.focus();
		return false;
	}
	
	return true;
}

function ValidaPessoa(){
	PessoaNome 		= document.getElementById('PessoaNome');
	PessoaNascimento= document.getElementById('PessoaNascimento');	
	PessoaTelefone 	= document.getElementById('PessoaTelefone');
	EnderecoRua 	= document.getElementById('EnderecoRua');
	EnderecoNumero 	= document.getElementById('EnderecoNumero');
	EnderecoBairro	= document.getElementById('EnderecoBairro');
	EnderecoCidade	= document.getElementById('EnderecoCidade');
	EnderecoEstado	= document.getElementById('EnderecoEstado');
	EnderecoPais	= document.getElementById('EnderecoPais');
	
	
	
	if(PessoaNome.value==''){
		alert('Informe seu nome.');
		//PessoaNome.style.backgroundColor = '#FFE6E6';
		PessoaNome.focus();
		return false;
	}
	
	if(PessoaNascimento.value==''){
		alert('Informe sua data de nascimento.');
		//PessoaNascimento.style.backgroundColor = '#FFE6E6';
		PessoaNascimento.focus();
		return false;
	}	
	
	if(PessoaTelefone.value==''){
		alert('Informe o seu telefone.');
		//PessoaTelefone.style.backgroundColor = '#FFE6E6';
		PessoaTelefone.focus();
		return false;
	}

	if(EnderecoRua.value==''){
		alert('Informe o nome da rua.');
		//EnderecoRua.style.backgroundColor = '#FFE6E6';
		EnderecoRua.focus();
		return false;
	}

	if(EnderecoNumero.value==''){
		alert('Informe o numero.');
		//EnderecoNumero.style.backgroundColor = '#FFE6E6';
		EnderecoNumero.focus();
		return false;
	}
	
	if(EnderecoBairro.value==''){
		alert('Informe o Bairro.');
		//EnderecoBairro.style.backgroundColor = '#FFE6E6';
		EnderecoBairro.focus();
		return false;
	}
	
	if(EnderecoCidade.value==''){
		alert('Informe a cidade.');
		//EnderecoCidade.style.backgroundColor = '#FFE6E6';
		EnderecoCidade.focus();
		return false;
	}
	
	if(EnderecoEstado.value=='UF'){
		alert('Informe seu Estado.');
		//EnderecoEstado.style.backgroundColor = '#FFE6E6';
		EnderecoEstado.focus();
		return false;
	}
	
	if(EnderecoPais.value==''){
		alert('Informe o País.');
		//EnderecoPais.style.backgroundColor = '#FFE6E6';
		EnderecoPais.focus();
		return false;
	}
	
	return true;
}

function ValidaCadMoto(){
	idMarca			= document.getElementById('idMarca');
	VeiculoModelo 	= document.getElementById('VeiculoModelo');
	VeiculoAno		= document.getElementById('VeiculoAno');	
	VeiculoAnoMod 	= document.getElementById('VeiculoAnoMod');

	if(idMarca.value=='0'){
		alert('Informe O Fabricante.');
		//idMarca.style.backgroundColor = '#FFE6E6';
		idMarca.focus();
		return false;
	}	

	if(VeiculoModelo.value==''){
		alert('Informe o Modelo.');
		//VeiculoModelo.style.backgroundColor = '#FFE6E6';
		VeiculoModelo.focus();
		return false;
	}
	
	if(VeiculoAno.value==''){
		alert('Informe ano fabricação.');
		//VeiculoAno.style.backgroundColor = '#FFE6E6';
		VeiculoAno.focus();
		return false;
	}	
	
	if(VeiculoAnoMod.value==''){
		alert('Informe ano modelo.');
		//VeiculoAnoMod.style.backgroundColor = '#FFE6E6';
		VeiculoAnoMod.focus();
		return false;
	}

	return true;
}

function ValidaImestProposta(){
	Razao				= document.getElementById('Razao');
	Fantasia 			= document.getElementById('Fantasia');
	CNPJ				= document.getElementById('CNPJ');	
	Responsavel 		= document.getElementById('Responsavel');
	Endereco 			= document.getElementById('Endereco');
	Bairro 				= document.getElementById('Bairro');
	Cidade 				= document.getElementById('Cidade');
	EnderecoEstado		= document.getElementById('EnderecoEstado');	
	CEP 				= document.getElementById('CEP');
	TELFAX 				= document.getElementById('TELFAX');
	Email 				= document.getElementById('Email');
	NFuncionarios 		= document.getElementById('NFuncionarios');
	idCategoria 		= document.getElementById('idCategoria');
	
	if(Razao.value==''){
		alert('Informe Razão social.');
		//Filiarse.style.backgroundColor = '#FFE6E6';
		Razao.focus();
		return false;
	}	

	if(Fantasia.value==''){
		alert('Informe o Nome Fantasia.');
		//Categoria.style.backgroundColor = '#FFE6E6';
		Fantasia.focus();
		return false;
	}
	
	if(CNPJ.value==''){
		alert('Informe CNPJ.');
		//PessoaNome.style.backgroundColor = '#FFE6E6';
		CNPJ.focus();
		return false;
	}	
	
	if(Responsavel.value==''){
		alert('Informe um Responsável.');
		//PessoaRGIE.style.backgroundColor = '#FFE6E6';
		Responsavel.focus();
		return false;
	}
	
	if(Endereco.value==''){
		alert('Informe o Endereço.');
		//PessoaCPFCNPJ.style.backgroundColor = '#FFE6E6';
		Endereco.focus();
		return false;
	}
	
	if(Bairro.value==''){
		alert('Informe o Bairro.');
		//Bairro.style.backgroundColor = '#FFE6E6';
		Bairro.focus();
		return false;
	}
	
	if(Cidade.value==''){
		alert('Informe sua Cidade.');
		//Cidade.style.backgroundColor = '#FFE6E6';
		Cidade.focus();
		return false;
	}
	
	if(EnderecoEstado.value=='UF'){
		alert('Informe seu Estado.');
		//EnderecoEstado.style.backgroundColor = '#FFE6E6';
		EnderecoEstado.focus();
		return false;
	}
	
	if(CEP.value==''){
		alert('Informe o CEP.');
		//CEP.style.backgroundColor = '#FFE6E6';
		CEP.focus();
		return false;
	}
	
	if(TELFAX.value==''){
		alert('Informe um telefone de contato.');
		//TELFAX.style.backgroundColor = '#FFE6E6';
		TELFAX.focus();
		return false;
	}
	
	if(Email.value==''){
		alert('Informe seu e-mail.');
		//Email.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}
	
	if(IsEmail(Email.value)==false){
		alert('Seu E-mail é inválido.');
		//Email.style.backgroundColor = '#FFE6E6';
		Email.focus();
		return false;
	}
	
	if(NFuncionarios.value==''){
		alert('Informe o número de funcionários.');
		//NFuncionarios.style.backgroundColor = '#FFE6E6';
		NFuncionarios.focus();
		return false;
	}
	
	if(idCategoria.value=='0'){
		alert('Informe uma categoria.');
		//idCategoria.style.backgroundColor = '#FFE6E6';
		idCategoria.focus();
		return false;
	}
	
	return true;
}
