function validaEmail(email) {
	var reg_email = /^[a-z0-9_.-]+@([a-z0-9_]+\.)+[a-z]{2,4}$/i;
	return reg_email.test(email);
}

function validaForm(form) {
	with(form) {
		email = email_newsletter.value;
		if (email == "") {
			alert('Favor preencher o campo e-mail');
			return false;
		} else if (!validaEmail(email)) {
			alert('O e-mail ' + email + ' não é válido. Favor colocar um e-mail válido');
			return false;
		}
	}
	return true;
}

function writeFlashTagSite(qs,w,h,vars) {
	html = '';
	html = html + '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'">';
	html = html + '<param name="allowScriptAccess" value="sameDomain" />';
	html = html + '<param name="movie" value="flash/'+qs+'" />';
	html = html + '<param name="quality" value="high" />';
	html = html + '<param name="FlashVars" value="caminhoVideo='+vars+'" />';
	html = html + '<param name="wmode" value="transparent" />';
	html = html + '<embed src="flash/'+qs+'" FlashVars="caminhoVideo='+vars+'" quality="high" width="'+w+'" height="'+h+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />';
	html = html + '</object>';
	document.write(html);
}

function openPopUp(caminho) {
	width = 450;
	height = 520;
	leftVal = (screen.width - width) / 2;
	topVal = (screen.height - height) / 3.5;
	window.open(caminho,'popup','width=' + width + ',height=' + height + ',scrollbars=no,top=' + topVal + ',left=' + leftVal)
}