// JavaScript Document
function ChecaForm (){
var f = document.form;
if (f.name.value == ""){
	alert('O campo NOME deve ser preenchido');
	f.name.focus();
	return false;
   }

var goodEmail = f.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(.es)|(\..{2,2}))$)\b/gi);

if (!goodEmail){   
   alert('Insira um E-MAIL válido!');
   f.email.focus();
   f.email.select();
   return false;
   }
return true;
}

function ChecaResolucao(){
 	if ((screen.width != 800) && (screen.height != 600)){
	    document.write ("<tr><td colspan='3' valign='top' style='height: 20px;text-align: center; color: #FF0000' class='textoMenor'> Para melhor visualização deste site, recomenda-se o uso de resolução 800x600</td></tr>");
		}
}

function geraParceiros(){
var caminho = 'imagens/parceiros/';//pasta das imagens

var imgname = new Array("img0.jpg","img1.jpg","img2.jpg","img3.jpg","img4.jpg","img5.jpg","img6.jpg","img7.jpg","img8.jpg","img9.jpg","img10.jpg","img11.jpg","img12.jpg","img10.jpg"); //nome das imagens

var randomNum = 0, randomNumLast = 0, tot_parceiros =0;
//Verifica a resolução e atribui a quantidade de imagens a ser colocada
if (screen.height == 640){
	tot_parceiros = 1;
} else if (screen.height == 600){
			tot_parceiros = 2;
		} else { 
					tot_parceiros = 4;
}

//gera uma tabela e suas respectivas imagens
document.write("<table width='120' border='0' cellpadding='0' cellspacing='0'>");
for(i=0; i<=tot_parceiros; i++)
{
	
   		while (randomNum == randomNumLast) {
			randomNum = Math.floor(Math.random() * imgname.length);
		}
	
	document.write("<tr><td height='60'><img src='"+caminho+imgname[randomNum]+"'></td></tr><tr>");
	randomNumLast = randomNum;
}
document.write("</table>")
}



