var checkContato ={	
		valida : function(o){		
			var form = o.form;						
			if(form.nome.value ==""){
				this.msg(form.nome, "Nome"); return false;			
			}else if(form.email.value ==""){
				this.msg(form.email, "Email"); return false;	
			}else if(!this.checkEmail(form.email.value)){
				alert("\"Email\" inválido. Favor verificar o campo \"Email\".");
				form.email.focus();
				return false;
			}else if(form.DDD.value ==""){
				this.msg(form.DDD, "DDD"); return false;	
			}else if(form.telefone.value ==""){
				this.msg(form.telefone, "Telefone"); return false;				
			}else if(form.assunto.options[form.assunto.selectedIndex].value == ""){
				this.msg(form.assunto, "Assunto"); return false;	
			}else if(form.mensagem.value ==""){
				this.msg(form.mensagem, "Mensagem"); return false;	
			}						
			
			 tb_show('','#TB_inline?height=100&width=300&inlineId=response-container&modal=true','');
			 $("#response-status").show('fast');
			
			window.setTimeout('checkContato.callPost()', 1000);	

			return true;
		},
		callPost : function (){
			 var form = document.contato;
			 $.post("fale_conosco.php", { nome: form.nome.value, email: form.email.value, DDD: form.DDD.value, telefone:  form.telefone.value,assunto: form.assunto.options[form.assunto.selectedIndex].value, mensagem: form.mensagem.value},  function(data){
				 checkContato.callBack(data);
			});
		},
		callBack : function (data){		
			$('#response-content').html(data);		
		},			
		
		msg : function(campo, label){
			alert("Favor preencher o campo \""+ label + "\".")
			campo.focus();
		},
		checkEmail : function(emailad){
			var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
			var check=/@[\w\-]+\./;
			var checkend=/\.[a-zA-Z]{2,3}$/;
	
			if(emailad.search(exclude) != -1||emailad.search(check) == -1|| emailad.search(checkend) == -1)return false;
			else return true;
		}
	}
	
	var mapa = {	
		contentMap : null,
		contentParent : null,
		status : 0,
	
		show : function (){							
			if(!this.contenMap)this.contenMap = document.getElementById("map");		
			if(!this.contentParent)this.contentParent = document.getElementById("map-content");	
			this.contentParent.style.display = "block";
			load(this.contenMap);			
			this.status = 1;
			return false;
		},
		seeClose : function (){						
			if(this.status)this.contentParent.style.display = "none";
			return false;
		}
	}