
function valContact(){
	
	var the_form = window.document.getElementById('contact_form');
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var email = the_form.tkd_email.value;
	
	ret = true;
	
	if(the_form.tkd_nombre.value == '' || the_form.tkd_nombre.length < 4){
		alert('Por favor ingrese correctamente el nombre y apellido');
		the_form.tkd_nombre.focus();
		ret = false;
	}
	else if (reg.test(email) == false){
		alert('Por favor verifique el email ingresado.');
		the_form.tkd_email.focus();
		ret = false;
	}
	else if(the_form.tkd_asunto.value == '' || the_form.tkd_asunto.length < 4){
		alert('Por favor ingrese el asunto de su mensaje');
		the_form.tkd_asunto.focus();
		ret = false;
	}
	else if(the_form.tkd_mensaje.value == '' || the_form.tkd_mensaje.length < 4){
		alert('Por favor escriba su mensaje');
		the_form.tkd_mensaje.focus();
		ret = false;
	}
	
	if ( ret != false ) {
		the_form.submit();
	}		

}

function showMap() {
	the_map = window.document.getElementById('mapa');
	the_loader = window.document.getElementById('loader');
	
	if(the_loader.style.display == 'none' && the_map.style.display == 'none'){
		the_loader.style.display = 'block';
		the_map.style.display = 'block';
		return false;
	}
	if(the_loader.style.display == 'block' && the_map.style.display == 'block'){
		the_loader.style.display = 'none';
		the_map.style.display = 'none';
		return false;
	}

}

function buscar(keyword){
	search_field = window.document.getElementById('q');
	search_form = window.document.getElementById('cse-search-box');
	
	search_field.focus();
	search_form.className = 'search-box-on';	
	search_field.value = keyword;	
}


