
// Zera os checkboxes e o select-area
function inicializa(){
document.getElementById("area").selectedIndex=0;
document.getElementById("rad_0").checked = false;
document.getElementById("rad_1").checked = false;
} 

/////////////////////////////////////////////////////
// Muda dinamicamente os valores da lista AREA 
function muda(form,sel) { 
	d=new Array();
	d[0]="Select a departament";
	if (sel == 1) {
		d[1]="Account";
		d[2]="Data Process Center";
		d[3]="Sales";
		d[4]="Industrial";
		d[5]="Technical";
		d[6]="Purchase";
		d[7]="Human Resources";
	} else {
		form.area.options[7]=null;
		d[1]="Sales";
		d[2]="Technical"; }
	
	f=document.getElementById("area").length -1;	
	for (count=0; count<f; count++) {
		document.getElementById("area").options[0]=null; }
 		
	if (sel == 1) { sel = 8 } else { sel = 3 }	
	for (count=0; count<sel; count++) {
 		document.getElementById("area").options[count] = new Option(d[count],d[count]); }
} //muda


/////////////////////////////////////////////////////
function sevazio(form) {
if  ((form.rad[0].checked == false) && (form.rad[1].checked == false))
{ alert('Choose an option in the field. "Doubts and suggestions about:*"!');
return; }

var narea=form.area.selectedIndex;
if ((form.area.options[narea].text=="") || (narea == 0))
	{ alert('Choose a department which you want to contact*!');
	form.area.focus();
	return; } 

if (isNaN(form.nome.value) == false) {
alert('Type your Name!');
form.nome.focus();
return; }

var e = form.email.value
var arroba=false
for (Count = 0; Count <e.length; Count++) {
if (e.charAt(Count) == "@")  var arroba=true;
}
if (arroba == false) {
alert('Type your e-mail correctly!');
form.email.focus();
return; }

if (form.ddd.value=="") {
alert('Type your Area Code!');
form.ddd.focus();
return; }

if (form.telefone.value=="") {
alert('Type your telephone!');
form.telefone.focus();
return; }

form.submit();
}
