// Arthur Wang  06/04/11 /police/js/communications.js for /police/about/dispatcher/contact.shtml 

function validate(frm) {
if (document.getElementById("Over 18").checked == false) {
	alert("Please verify your age by selecting the checkbox \"I am eighteen years old or older.\"");
	return false;
}
else{
var themessage = "You are required to complete the following fields: ";

if (frm.Category.value==""){
themessage =  themessage + " - Category ";
}

if (frm.Name.value=="") {
themessage = themessage + " - Name";
}
if (frm.Street_Address.value=="") {
themessage = themessage + " -  Street Address ";
}

if (frm.City.value=="") {
themessage = themessage + " -  City ";
}

if (frm.Phone.value=="") {
themessage = themessage + " -  Telephone ";
}
//alert if fields are empty and cancel form submit
if (themessage == "You are required to complete the following fields: ") {
frm.submit();
}
else {
alert(themessage);
return false;
   }
  }
}

var maxLength=1000;
function LimitThis() {
	var myObject=event.srcElement;
	if (myObject.value.length==maxLength*1) return false;
}

function CountThis(visCnt) { 
	var myObject=event.srcElement;
	if (myObject.value.length>maxLength*1) myObject.value=myObject.value.substring(0,maxLength*1);
	if (visCnt) visCnt.innerText=maxLength-myObject.value.length;
	
}

