// JavaScript Document


//Call all the functions****************

function onSubmitFunctions() {

  if (nameCheck() ==false) {
  return false; 
  }
  if (emailCheck() ==false) {
  return false; 
  }
  if (catCheck() ==false) {
  return false; 
  }
  if (comCheck() ==false) {
  return false; 
  }
  if (SendIt() == false) { 
  return false; 
	} 
} 



//Enf of Call all the functions****************

function EnterFunc() {
	i=1
	i=i+++1 
	while (i < 11) {
	for (x = 1; x < 10; x++) { document.all['ROW'+i+'_' +x].style.display="none";
		}
		i++
	}
}

//Input field checks

function nameCheck() {
	var f=document.mailMe;
	if(f.Name.value=="") {
	alert("Please enter your name.");
	f.Name.focus();
	return false;
	}
} 

function emailCheck() {
	var f=document.mailMe;	
     var estr = new String(f.Email.value);
    var atindex = estr.indexOf("@");
     if(atindex ==-1){
         alert("You must enter a valid EMail Address.")
         f.Email.focus();
          return false;
	}
}

//End of INPUT Field Checks

//Radio Field Check*****

function catCheck() {
	var f=document.mailMe;
	var fldVal;
	var isChecked;

isChecked = false;
fldVal = f.Category.length;
for ( i = 0; i < fldVal; i++ ) {
if ( f.Category[i].checked ) {
isChecked = true;
	}
}
if ( ! isChecked ) {
alert( 'Please select a category.' );
f.Category[0].focus();
return false;
	}
}

//End of Radio Field Check

function comCheck() {
	var f=document.mailMe;
	if(f.Comments.value=="") {
	alert("Please enter your comments.");
	f.Comments.focus();
	return false;
	}
} 



function SendIt(){
var f=document.mailMe;
	f.submit();
	return false;
}