function emailvalidation(field, alertbox) {
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	apos=field.value.indexOf("@");
	dotpos=field.value.lastIndexOf(".");
	lastpos=field.value.length-1;
	var badEmail = (apos<1 || dotpos-apos<2 || lastpos-dotpos<2)
	if (goodEmail && !badEmail) {
		return true;
	}else {
		alert(alertbox);
		field.focus();
		field.select();
		return false;
   }
}
function emptyvalidation(entered, alertbox){
	with (entered){
		if (value==null || value==""){
			if (alertbox!="") {
				alert(alertbox);
			}
			return false;
		}else {
			return true;
		}
	}
}
function enviaEmail(thisform){
str="";
	with (thisform){	
		if(nome.value==""){
			alert("Informe seu nome");
			nome.focus();
			return false;
		}	
		if (emailvalidation(email,"Por favor, digite seu e-mail corretamente")==false) {
			email.focus();
			return false;
		}		
		str= "cadastra.php?e="+email.value+"&n="+nome.value;
	}
	div1= document.getElementById("dados");
	div2= document.getElementById("campos");
	div1.style.display='block';
	div2.style.display='none';
	div1.innerHTML="<br><br><img src='images/enviando.gif' width=150 height=10  />";
	atualiza(str, "dados");		
	return false;
	}
function voltar(){
div1= document.getElementById("dados");
div2= document.getElementById("campos");
thisform= document.getElementById("frm");
	with (thisform){		
		nome.value="";	
		email.value="";		
	}
	div1.style.display='none';
	div2.style.display='block';
	return false;	
}

function flash(arqflash,largura,altura,v) {
document.write('<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="' + largura + '" height="' + altura + '">');
document.write('<param name="movie" value="' + arqflash + '" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="flashvars" value="m=' + v+ '" />');
document.write('<embed src="' + arqflash + '" flashvars="m=' + v + '" width="' + largura + '" height="' + altura + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
document.write('</object>');
}

function banner(b,l) {
document.write('<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=120 height=60>');
document.write('<param name="movie" value="banners/base.swf" />');
//document.write('<param name="wmode" value="transparent" />');
document.write('<param name="flashvars" value="m=' + b+ '&link='+ l +'" />');
document.write('<embed src="banners/base.swf" flashvars="m=' + b+ '&link='+ l +'" width="120" height="60" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
document.write('</object>');
}

