//  Jayakar - SPAR Capital 
//  Check Contact form for basic info
//  SPAR0chkContact.js

function chkContact () {
  var chk_email1 = document.contactform1.email1.value;
  var chk_pix9 = document.contactform1.pix.value.toLowerCase() + "9";
  
  if (document.contactform1.requestor1.selectedIndex == 0)  {
	alert('Please choose a description [You]');
	return false;
  }
  else if (document.contactform1.category1.selectedIndex == 0)  {
	alert('Please choose a category [About]');
	return false;
  }
  else if (document.contactform1.comment1.value == "")  {
	alert('Please enter your comments [Comments/Feedback/Request]');
	return false;
  }
  else if (document.contactform1.comment1.value.length < 4)  {
	alert('Please enter your comments [Comments/Feedback/Request]');
	return false;
  }

  else if (chk_pix9 != "mast9")  {
	alert('Please enter the code (as shown) from the white box into the gray security box!');
	return false;
  }

  else if (document.contactform1.response1[0].checked == true) {
		if (document.contactform1.email1.value.length < 8)  {
	    	alert('Please verify your EMail Address so we can respond to you');
  			return false;
  		}
  		if (chk_email1.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/) == -1)  {
	    	alert('Please verify your EMail Address so we can respond to you');
  			return false;
  		}
  }
  
  document.contactform1.pix9.value = chk_pix9;
  document.contactform1.submit();
}


//  END of SCRIPT

