function contact(){
	var mensarem_erro="", cont_erro=0;
	var ad = document.getElementById('form_contact');
	var d = document.getElementById('erro').style;
	
			
	if (ad.nome_cont.value == "") {
        mensarem_erro += "<b>Name:</b>  required<br />";
		d.display = 'block';
		cont_erro++;
		
	}
			
			
	if (ad.email_cont.value == "") {
        mensarem_erro += "<b>E-mail:</b> required<br />";	
		d.display = 'block';
		
		cont_erro++;				
	}
			
   if (ad.email_cont.value != "") {			
   		if(!(/^\w+([\.-_-]?\w+)*@\w+([\.-_-]?\w+)*(\.\w{2,4})+$/.test(ad.email_cont.value))) { 
			mensarem_erro += "<b>E-mail:</b> Inválido<br />";
			d.display = 'block';
			cont_erro++;			
	   }		
   }

	if (ad.cc_cont.value == "") {
         mensarem_erro += "<b>How did you find our website? :</b> required<br />";
		 d.display = 'block';
	     cont_erro++;				
	}
	
	if (ad.selection_cont.value == "") {
         mensarem_erro += "<b>Section:</b> required<br />";	
		 d.display = 'block';
	     cont_erro++;				
	}
	
	if (ad.assunto_cont.value == "") {
         mensarem_erro += "<b>Subject:</b> required<br />";
		 d.display = 'block';
	     cont_erro++;				
	}	
	
	if (ad.texto_cont.value == "") {
         mensarem_erro += "<b>Message:</b> required<br />";
		 d.display = 'block';
	     cont_erro++;				
	}
			
	if (cont_erro > 0) {
		document.getElementById("erro").style.display="block";
		var mensagem_final = "<h4>Were found "+ cont_erro +" errors in the form.</h4><p class=\"er\">"+ mensarem_erro +"</p>";
		document.getElementById("erro").innerHTML = mensagem_final;			
		//location.href="#erro";	
		return false;
	}
	
	return true;
			
}




/********telefone***********/
function mascara(o,f){
    v_obj=o
    v_fun=f
    setTimeout("execmascara()",1)
}

function execmascara(){
    v_obj.value=v_fun(v_obj.value)
}

function telefone(v){
    v=v.replace(/\D/g,"")                
    v=v.replace(/^(\d\d)(\d)/g,"($1) $2")
    v=v.replace(/(\d{4})(\d)/,"$1-$2")    
    return v
}
