
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Função para troca de imagens (botões)
function t(i) {
  if (document.images) {
	x = i.split("-");
	if(x[2] == 'g') {
		document[x[0]].src = "img/" + x[0] + x[1] + ".gif";
	} else {
		document[x[0]].src = "img/" + x[0] + x[1] + ".jpg";
	}
  }
}

function validarForm(){
	if (!form1.Nome.value){
		alert("Your name is invalid. Try again, please.")
		return;
	}
	if (!validarEmail(form1.email)){
		alert("Your email is invalid. Try again, please.")
		return;
	}
	if (!form1.pais.value){
		alert("Choice a country, please.")
		return;
	}
	form1.submit();
	return;
}

function validarEmail(email){
	email.value = email.value.replace(' ','');
	email.value = email.value.toLowerCase();
	var exp_reg = /^([a-z0-9\.\-\_]+)@([a-z0-9\-\_]+\.{1})*?([a-z0-9]{2,3}){1}$/;

	if (exp_reg.test(email.value)){
		return 1;
	} else {
		return 0;
	}
}
