// require that at least one checkbox be checked
function IsCheckboxChecked(f)
{
   var error = "";
   var count = 0;
   for (var i = 0 ; i < f.length ; ++i) {
     if (f[i].checked) { ++count; }
   }
   if (count == 0) {
     return false;
   }else{
     return true;
   }
}


function startClock(mstimeout)
{
setTimeout("displayWarning()", mstimeout-60000);
}
function displayWarning()
{
var baseRef = window.location.href.substring(0,window.location.href.lastIndexOf("/"));
if (confirm("Your session time will expire in 60 seconds.  Would you like to continue your internet session?"))
{
 startClock();
 if (typeof window.location.replace != 'undefined')
 {
  window.location.reload();
 }
 else
 {
  window.location.reload();
 }
}
else
{
 if (typeof window.location.replace != 'undefined')
 {
 window.location.replace("member_logout.asp");
 }
 else
 {
 window.location.href("member_logout.asp");
 }
}
}



function CheckIsIE() 
{ 
if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;} 
else { return false; } 
} 


function PrintThisPage() 
{ 

if (CheckIsIE() == true) 
{ 
document.printframe.focus(); 
document.printframe.print(); 
} 
else 
{ 
window.frames['printframe'].focus(); 
window.frames['printframe'].print(); 
} 

} 



var nn = (navigator.appName == "Netscape");


//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TD"

var ns6=document.getElementById&&!document.all
var ie=document.all

function isDigit(theDigit) 
{ 
var digitArray = new Array('0','1','2','3','4','5','6','7','8','9'),j; 

for (j = 0; j < digitArray.length; j++) 
{if (theDigit == digitArray[j]) 
return true 
} 
return false 

} 
/*************************************************************************/ 
/*Function name :isPositiveInteger(theString) */ 
/*Usage of this function :test for an +ve integer */ 
/*Input parameter required:thedata=string for test whether is +ve integer*/ 
/*Return value :if is +ve integer,return true */ 
/* else return false */ 
/*function require :isDigit */ 
/*************************************************************************/ 
function isPositiveInteger(theString) 
{ 
var theData = new String(theString) 

if (!isDigit(theData.charAt(0))) 
if (!(theData.charAt(0)== '+')) 
return false 

for (var i = 1; i < theData.length; i++) 
if (!isDigit(theData.charAt(i))) 
return false 
return true 
} 
/**********************************************************************/ 
/*Function name :isDate(s,f) */ 
/*Usage of this function :To check s is a valid format */ 
/*Input parameter required:s=input string */ 
/* f=input string format */ 
/* =1,in mm/dd/yyyy format */ 
/* else in dd/mm/yyyy */ 
/*Return value :if is a valid date return 1 */ 
/* else return 0 */ 
/*Function required :isPositiveInteger() */ 
/**********************************************************************/ 
function isDate(s,f) 
{var a1=s.split("/"); 
var a2=s.split("-"); 
var e=true; 
if ((a1.length!=3) && (a2.length!=3)) 
{ 
e=false; 
} 
else 
{if (a1.length==3) 
var na=a1; 
if (a2.length==3) 
var na=a2; 
if (isPositiveInteger(na[0]) && isPositiveInteger(na[1]) && isPositiveInteger(na[2])) 
{ if (f==1) 
{var d=na[1],m=na[0]; 
} 
else 
{var d=na[0],m=na[1]; 
} 
var y=na[2]; 
if (((e) && (y<1000)||y.length>4)) 
e=false 
if (e) 
{ 
v=new Date(m+"/"+d+"/"+y); 
if (v.getMonth()!=m-1) 
e=false; 
} 
} 
else 
{ 
e=false; 
} 
} 
return e 
}


function hidestatus(statusmsg){
  window.status = statusmsg; 
}


function wopen(url, name, w, h)
{
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,titlebar=no');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}


function checkDate(v) 
{ 
var s=v.value; 
if (isDate(s,1)) //mm/dd/yyyy format 
return true;
else 
alert("The inputted date value is not valid!"); 
return false; 
} 


function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}


// This next little bit of code tests whether the user accepts cookies.
var WM_acceptsCookies = false;
if(document.cookie == '')
{
  document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
  if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1)
  {
  WM_acceptsCookies = true; 
  }
}
else
{
WM_acceptsCookies = true;
}


// Basic Confirm
function BasicConFirm(MyMsg,MyUrl) { 
if (confirm(MyMsg) ) 
{ 
location=MyUrl;
} 
} 


function WM_setCookie (name, value, hours, path, domain, secure) {
  if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
   var not_NN2 = (navigator && navigator.appName 
               && (navigator.appName == 'Netscape') 
               && navigator.appVersion 
               && (parseInt(navigator.appVersion) == 2))?false:true;

   if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
       if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
        var numHours = hours;
       } else if (typeof(hours) == 'number') { // calculate Date from number of hours
        var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
       }
   }
   document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' 
+ path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); 
// Set the cookie, adding any parameters that were specified.
  }
} // WM_setCookie


function WM_readCookie(name) {
  if(document.cookie == '') { // there's no cookie, so go no further
   return false; 
  } else { // there is a cookie
   var firstChar, lastChar;
   var theBigCookie = document.cookie;
   firstChar = theBigCookie.indexOf(name);     // find the start of 'name'
   var NN2Hack = firstChar + name.length;
   if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
       firstChar += name.length + 1; // skip 'name' and '='
       lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
       if(lastChar == -1) lastChar = theBigCookie.length;
       return unescape(theBigCookie.substring(firstChar, lastChar));
   } else { // If there was no cookie of that name, return false.
       return false;
   }
  }     
} // WM_readCookie


function WM_killCookie(name, path, domain) {
var theValue = WM_readCookie(name); // We need the value to kill the cookie
if(theValue) {
    document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' 
+ path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
}
} // WM_killCookie


function PopupPic(img)
{ 
        window.open("gallery_veiwer.asp?img=" + img,"WinName","width=400,height=400,left=" + (screen.width-650)/2 + ",top=" + (screen.height-600)/2 + ",resizable=no,scrollbars=no,status=0");
}  

function replaceChar(form,badchar,goodchar)
{
        form.value=form.value.replace(badchar,goodchar)   
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function closeAndGoto(url) {
  if (window.opener && !window.opener.closed)
    window.opener.location = url;
  window.close();
}

function switchImage() {
   var imgArray = new Array('1','2','3','4','5');
   var test = Math.abs(Math.round(imgArray.length * Math.random()));
   if(test==0) test++;
   returnImg = '<IMG SRC="/images/quotes/'+ test + '.gif" BORDER="0" name="leftImage">'
return returnImg;
}


// browser rec code

version=parseInt(navigator.appVersion);
if (navigator.appVersion.indexOf('5.')>-1){version=5};
if (navigator.appVersion.indexOf('6.')>-1){version=6}; browser='OTHER';
if (navigator.appName=='Netscape'){browser='NS'+version;}
if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE'+version;}
if (navigator.appVersion.indexOf('MSIE 3')>0) {browser='MSIE3';}
if(browser == 'NS5'){browser='NS6'};
if (browser=='MSIE3') {window.location='update.html'}
if (browser=='MSIE4') {window.location='update.html'}
if (browser=='NS3') {window.location='update.html'}
if (browser=='NS4') {window.location='update.html'}
if (browser=='OTHER') {}


// roll-overs

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function addbookmark(bookmarkurl,bookmarktitle)
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function RegFullDomain() {
  if (document.getElementById) {
    document.getElementById('DomainTypeSub').innerHTML = 'www.';
    document.getElementById('DomainTypeFull').innerHTML = '';
    document.f.domain.focus();
    document.f.domain.blur();
  }
}

function RegSubDomain() {
  if (document.getElementById) {
    document.getElementById('DomainTypeSub').innerHTML = '';
    document.getElementById('DomainTypeFull').innerHTML = ' .hoavillage.com';
    document.f.domain.focus();
    document.f.domain.blur();
  }
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Trim
function LTrim(str) 
{
      for (var i=0; str.charAt(i)==" "; i++);
      return str.substring(i,str.length);
     }
     function RTrim(str) {
      for (var i=str.length-1; str.charAt(i)==" "; i--);
      return str.substring(0,i+1);
     }
     function Trim(str) {
      return LTrim(RTrim(str));
}

// Multiple Submit Stopper
var requestSubmitted = false;   
function checkandsubmit(f)
{
      if(requestSubmitted == true)
	{
         alert("You have already submitted the request.. Please wait");
         return;
	}
         requestSubmitted = true;
         f.submit();
	}



// Name check
function NameValid(f)
{
var invalid = "0123456789";
	for (var i=0; i < f.msgname.value.length; i++) 
	{
		temp = "" + f.msgname.value.substring(i, i+1);
		if (invalid.indexOf(temp) != "-1") 
		{
			alert("Please enter your Name");
			return false;
		}
	}
	if ((f.msgname.value.length) <= 1 )
	{
		alert('Please enter your Name');
		return false;
	}
}

// Validate Email
function EmailValid(f)
{
  var field = f; // email field
  var str = f.value; // email string

  // Replace , with .
	var comma;
	var dot
	comma = ","
	dot = "."

	while (str.indexOf(comma)>-1)
	{
		pos= str.indexOf(comma);
		str = "" + (str.substring(0, pos) + dot + 
		str.substring((pos + comma.length), str.length));
	}

  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/; // valid
  if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
    //alert("Thank your for your feedback.");
    field.value = str
    return true;
  }
  alert("\"" + str + "\" is an invalid email address!");
  field.focus();
  field.select();
  return false;
}

// CONTACT SUBJECT
function ContactSubject(f)
{
	if (Trim(f.msgsubject.value) == "" )
	{
		alert('Please type a \"Subject\" for this email');
		return false;
	}
}

// CONTACT BODY
function ContactBody(f)
{
	if (Trim(f.msgbody.value) == "" )
	{
		alert('Please type a \"Message\" for this email');
		return false;
	}
}


// Business Name Valid
function BusinessNameValid(f)
{
   if (f.company.value != '')
   {

	if ((f.company.value.toLowerCase()) == "none" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "home" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "na" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "n\a" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "n/a" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "n-a" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "not applicable" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "no business" )
	{
		f.company.value = ""
	}
	if ((f.company.value.toLowerCase()) == "no" )
	{
		f.company.value = ""
	}
   }
}


// Required Business Name Valid
function BusinessNameRequired(f)
{
	if (Trim(f.company.value) == "")
	{
		alert('Please enter your Company Name');
		return false;
	}
}


// First Name
function FirstNameValid(f)
{
var invalid = "0123456789";
	for (var i=0; i < f.firstname.value.length; i++) 
	{
		temp = "" + f.firstname.value.substring(i, i+1);
		if (invalid.indexOf(temp) != "-1") 
		{
			alert("Please enter a valid First Name");
			return false;
		}
	}
	if ((f.firstname.value.length) <= 1 )
	{
		alert('Please enter a valid First Name');
		return false;
	}
}


// Last Name
function LastNameValid(f)
{
var invalid = "0123456789";
	for (var i=0; i < f.lastname.value.length; i++) 
	{
		temp = "" + f.lastname.value.substring(i, i+1);
		if (invalid.indexOf(temp) != "-1") 
		{
			alert("Please enter a valid Last Name");
			return false;
		}
	}
	if ((f.lastname.value.length) <= 1 )
	{
		alert('Please enter a valid Last Name');
		return false;
	}
}

// ADDRESS1
function Address1Valid(f)
{
	if (Trim(f.address1.value) == "")
	{
		alert('Please enter your Address');
		return false;
	}
}


// DOAMIN
function DomainValid(f)
{
	if (Trim(f.domain.value) == "")
	{
		alert('Please enter a Website Address/Domain');
		return false;
	}
}


// HOA NAME
function HoaNameValid(f)
{
	if (Trim(f.hoaname.value) == "")
	{
		alert('Please enter the name of your Homeowners Association');
		return false;
	}
}


// CONTACT NUMBER
function ContactNumberValid(f)
{
	if (f.contact_telno.value.length > '0') 
	{
		re = /^\(?\+?\-?(\d{3})\)?[\.\-\/\+ ]?(\d{3})[\.\-\/\+ ]?(\d{4})$/
		validContactPhone = re.exec(f.contact_telno.value)
	
		if (validContactPhone)
		{
			f.contact_telno.value = "(" + validContactPhone[1] + ") " + validContactPhone[2] + "-" + validContactPhone[3]
			//f.contact_telno.value = validContactPhone[1] + validContactPhone[2] + validContactPhone[3]
		}
		else
		{
		alert("Contact telephone number\n" + f.contact_telno.value + " isn't a valid phone number");
		return false;
		}
	}
}

// City
function CityValid(f)
{
var invalid = "0123456789";
   if ((f.city.value.substring(0, 3) != '29 ') && (f.city.value.substring(0, 5) != '1000 '))
   {
	for (var i=0; i < f.city.value.length; i++) 
	{
		temp = "" + f.city.value.substring(i, i+1);
		if (invalid.indexOf(temp) != "-1") 
		{
			alert("Please enter a valid City Name");
			return false;
		}
	}
	if ((f.city.value.length) <= 2 )
	{
		alert('Please enter a valid City Name');
		return false;
	}
   }
}

// State
function StateValid(f)
{
	if (f.state.options[0].selected==true)
	{
		alert('Please select a State');
		return false;
	}
}

// Vehicle Registration Color
function VehicleColorValid(f)
{
	if (f.colorid.options[0].selected==true)
	{
		alert('Please select the color of the vehicle');
		return false;
		f.focus();
	}
}

//PMID Selected
function PMIDValid(f)
{
	if (f.pmid.options[0].selected==true)
	{
		alert('Please select a Property Manager');
		return false;
	}
}

// Task Category
function TaskCategory(f)
{
	if (f.taskcategoryid.options[0].selected==true)
	{
		alert('Please select a Category');
		return false;
	}
}

//Violator Member ID
function ViolatorMemberID(f)
{
	if (f.memberidviolator.options[0].selected==true)
	{
		alert('Please select the Violator');
		return false;
	}
}

//Violator Type
function ViolationType(f)
{
	if (f.violationtype.options[0].selected==true)
	{
		alert('Please select the what type of Violation occured');
		return false;
	}
}

// Task Status
function TaskStatus(f)
{
	if (f.taskstatus.options[0].selected==true)
	{
		alert('Please select a Task Status');
		return false;
	}
}

// Task Priority
function TaskPriority(f)
{
	if (f.taskpriority.options[0].selected==true)
	{
		alert('Please select a Priority');
		return false;
	}
}

// Task Owner
function TaskOwner(f)
{
	if (f.ownermemberid.options[0].selected==true)
	{
		alert('Please assign this task to a member');
		return false;
	}
}

// Task Time Start
function TaskTimeStart(f)
{
	if (f.timestart.options[0].selected==true)
	{
		alert('Please select a Start Time');
		return false;
	}
}

// Violation TIme
function ViolationTime(f)
{
	if (f.violationtime.options[0].selected==true)
	{
		alert('Please select the Time the violation occured');
		return false;
	}
}

// SECURITY TITLE
function SecurityTitle(f)
{
	if (Trim(f.title.value) == "")
	{
		alert('You have not entered a Title yet');
		return false;
	}
	return (true);
}

// SECURITY DESCRIPTION
function SecurityDescription(f)
{
	if (Trim(f.description.value) == "")
	{
		alert('You have not entered a Description yet');
		return false;
	}
	return (true);
}

// CONTACT GROUP TITLE
function ContactGroupTitle(f)
{
	if (Trim(f.title.value) == "")
	{
		alert('You have not entered a Title yet');
		return false;
	}
	return (true);
}

// CONTACT GROUP DESCRIPTION
function ContactGroupDescription(f)
{
	if (Trim(f.description.value) == "")
	{
		alert('You have not entered a Description yet');
		return false;
	}
	return (true);
}

// Task Time End
function TaskTimeEnd(f)
{
	if (f.timeend.options[0].selected==true)
	{
		alert('Please select an End Time');
		return false;
	}
}

// TASK TITLE
function TaskTitle(f)
{
	if (Trim(f.title.value) == "")
	{
		alert('You have not entered a Title yet');
		return false;
	}
	return (true);
}

// TASK DESCRIPTION
function TaskDescription(f)
{
	if (Trim(f.description.value) == "")
	{
		alert('You have not entered a Description yet');
		return false;
	}
	return (true);
}

// TASK EMAIL MSG
function TaskEmailMsg(f)
{
	if (Trim(f.emailmsg.value) == "")
	{
		alert('Please enter the email reminder message');
		return false;
	}
	return (true);
}

// Task EMAIL SECURITY LEVEL GROUP
function TaskContactID(f)
{
	if (f.contactid.options[0].selected==true)
	{
		alert('Please select a Contact Group');
		return false;
	}
}

// UnitCnt
function UnitCntValid(f)
{
	if (f.unitcnt.options[0].selected==true)
	{
		alert('Please select the number of units in your community');
		return false;
	}
}

function ZipCodeValid(f) 
{
	var valid = "0123456789";
	var hyphencount = 0;

	if (f.zip.value.length!=5) 
	{
		alert("Please enter your 5 digit zip code.");
		return false;
	}
	for (var i=0; i < f.zip.value.length; i++) 
	{
		temp = "" + f.zip.value.substring(i, i+1);
		if (temp == "-") hyphencount++;
		if (valid.indexOf(temp) == "-1") 
		{
			alert("Invalid characters in your zip code.  Please try again.");
			return false;
		}
			if ((hyphencount > 1) || ((f.zip.value.length==10) && ""+f.zip.value.charAt(5)!="-"))
			{
				alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
				return false;
   			}
	}
}


// Validate Telephone Number
function IsPhoneValid(f)
{
	if (f.value == '')
	{
		alert('Please enter a contact telephone number');
		f.focus();
		f.select();
		return false;
	}
	if ((f.value.charAt(0) == '1') || (f.value.charAt(0) == '0'))
	{
		alert("Please remove the " + f.value.charAt(0) + "\nas the first digit of your telephone number");
		f.focus();
		f.select();
		return false;
	}
	re = /^\(?\+?\-?(\d{3})\)?[\.\-\/\+ ]?(\d{3})[\.\-\/\+ ]?(\d{4})$/
	validPhone = re.exec(f.value)	
	if (validPhone) 
	{
		f.value = "(" + validPhone[1] + ") " + validPhone[2] + "-" + validPhone[3]
		//f.value = validPhone[1] + validPhone[2] + validPhone[3]
	}
	else 
	{
		alert("Telephone number of your Phone/\Fax\n" + f.value + " isn't a valid phone number");
		f.focus();
		f.select();
		return false;
	}
	var the_length=f.value.length;
	tel_num = validPhone[1]  + validPhone[2]  + validPhone[3] 
	// the_length-1
	if (tel_num.charAt(1) == tel_num.charAt(2)) 
	{
		alert(validPhone[1]  + " - number cannot be acivated");
		f.focus();
		f.select();
		return false;
	}
}

// Format Telephone Number
function FormatTelNum(f)
{
	if ((f.value.charAt(0) == '1') || (f.value.charAt(0) == '0'))
	{
		f.value = f.value.substring(1);
	}
	re = /^\(?\+?\-?(\d{3})\)?[\.\-\/\+ ]?(\d{3})[\.\-\/\+ ]?(\d{4})$/
	validPhone = re.exec(f.value)	
	if (validPhone) 
	{
		f.value = "(" + validPhone[1] + ") " + validPhone[2] + "-" + validPhone[3]
		//f.value = validPhone[1] + validPhone[2] + validPhone[3]
	}
	else 
	{
		return false;
	}
	var the_length=f.value.length;
	tel_num = validPhone[1]  + validPhone[2]  + validPhone[3] 
	// the_length-1
	if (tel_num.charAt(1) == tel_num.charAt(2)) 
	{
		alert(validPhone[1]  + " - is not a standard telephone number");
		f.focus();
		f.select();
		return false;
	}
}

// Password
function PasswordValid(f)
{
	var password = Trim(f.password.value).toLowerCase()
	var password2 = Trim(f.password2.value).toLowerCase()
	if (password  == '' || password2  == '')
	{
		alert('Please verify that you have completed\nthe password request.');
		return false;
	}

	if (password.length < 3)
	{
		alert('Your password must be at least 3 characters long. Try again.');
		f.password.value='';
		f.password2.value='';
		return false;
	}

	if (password.indexOf(' ') > -1)
	{
		alert("Spaces are not accepted in your password.");
		f.password.value='';
		f.password2.value='';
		return false;
	}

	if (password != password2)
	{
		alert ("The password entered does not match the verification password.\nPlease re-type the passwords.");
		f.password.value='';
		f.password2.value='';
		return false;
	}
}

// LOGIN USERID
function loginuserid(f)
{
	if (Trim(f.userid.value) == "")
	{
		alert('Please enter your Member Login ID (this should be something you easily remember such as email address or telephone number, etc..)');
		return false;
	}
	else if (Trim(f.userid.value).length < 3 )
	{
		alert('Your Member Login ID must be at least three characters');
		return false;	
	}
}

// LOGIN AFFILIATE LOGINID
function Affiliateloginid(f)
{
	if (Trim(f.loginid.value) == "")
	{
		alert('Please enter your Affiliate Login ID (this should be something you easily remember such as email address or telephone number, etc..)');
		return false;
	}
	else if (Trim(f.loginid.value).length < 3 )
	{
		alert('Your Affiliate Login ID must be at least three characters');
		return false;	
	}
}

// LOGIN PROPERTY MANAGEMENT LOGINID
function PMloginid(f)
{
	if (Trim(f.loginid.value) == "")
	{
		alert('Please enter your Property Management Login ID (this should be something you easily remember such as business name, email address or telephone number, etc..)');
		return false;
	}
	else if (Trim(f.loginid.value).length < 3 )
	{
		alert('Your Property Management Login ID must be at least three characters');
		return false;	
	}
}

// LOGIN UPQ LOGINID
function upqloginid(f)
{
	if (Trim(f.loginid.value) == "")
	{
		alert('Please enter your Login ID (this should be something you easily remember such as business name, email address or telephone number, etc..)');
		return false;
	}
	else if (Trim(f.loginid.value).length < 3 )
	{
		alert('Your Login ID must be at least three characters');
		return false;	
	}
}

//Affiliate Login ID
function ValidAffiliateLoginID(f)
{
	if (Trim(f.affiliateloginid.value) == "")
	{
		alert('Please enter your Affiliate Login ID (this should be something you easily remember such as email address or telephone number, etc..)');
		return false;
	}
	else if (Trim(f.affiliateloginid.value).length < 3 )
	{
		alert('Your Affiliate Login ID must be at least three characters');
		return false;	
	}
}

// LOGIN PASSWORD
function loginpassword(f)
{
	if (Trim(f.password.value) == "")
	{
		alert('Please enter your password');
		return false;
	}
}

// POLL VALIDATION
function pollvote(f)
{
	var radio_choice = false;
	for (counter = 0; counter < f.polloptionid.length; counter++)
	{
		if (f.polloptionid[counter].checked)
		radio_choice = true; 
	}

	if (!radio_choice)
	{
		alert('Please select your vote first.');
	return (false);
	}
	return (true);
}

// POLL QUESTION
function pollquestion(f)
{
	if (Trim(f.question.value) == "")
	{
		alert('Your poll question cannot be empty.');
		return false;
	}
	return (true);
}

// POLL VALUE
function PollValueValid(f)
{
	if (Trim(f.value) == "")
	{
		alert('You must supply at least two response options.');
		return false;
	}
	return (true);
}

// PAGE TITLE
function PageMakerTitle(f)
{
	if (Trim(f.title.value) == "")
	{
		alert('You have not entered a page name yet.');
		return false;
	}
	return (true);
}

// Page Type
function PageMakerPageType(f)
{
	if (f.pagetype.options[0].selected==true)
	{
		alert('Please select if you want this page added as a link in the menu.');
		return false;
	}
}

// Page Publish
function PageMakerPublish(f)
{
	if (f.published.options[0].selected==true)
	{
		alert('Please select if you want to publish this page.');
		return false;
	}
}

// Ensure keypress is number
function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 46 && (charCode < 48 || charCode > 57))
		return false;
	return true;
}


//Restrict Keyboard Input
function keyRestrict(e, validchars) {
 var key='', keychar='';
 key = getKeyCode(e);
 if (key == null) return true;
 keychar = String.fromCharCode(key);
 keychar = keychar.toLowerCase();
 validchars = validchars.toLowerCase();
 if (validchars.indexOf(keychar) != -1)
  return true;
 if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
  return true;
 return false;
}

//Calendar Event
function CalendarEventVal(f)
{
	if (Trim(f.event.value) == "")
	{
		alert('Please enter the Event Description');
		return false;
	}	
}

//Email Note Calendar
function CalendarEmailNote(f)
{
	if ((f.emailnote.disabled==false) && (f.emailnote.value==""))
	{
		alert('Please type your email message or deselect this option.');
		return false;
	}	
}

//AddressBook ownername
function OwnerNameVal(f)
{
	if (Trim(f.ownername.value) == "")
	{
		alert('Please enter the owners name');
		return false;
	}	
}

//Vehicle Registration License
function VehicleRegistrationLicense(f)
{
	if (Trim(f.license.value) == "" )
	{
		alert('Please enter the \"License Plate\" for this vehicle');
		return false;
		f.focus();
	}
}

// FORUM BODY
function ForumBody(f)
{
	if (Trim(f.body.value) == "" )
	{
		alert('Please type a \"Message\" for this message');
		return false;
	}
}

// FORUM SUBJECT
function ForumSubject(f)
{
	if (Trim(f.subject.value) == "" )
	{
		alert('Please type a \"Subject\" for this message');
		return false;
	}
}

// hoadueamount
function HoaDueAmount(f)
{
	if ((Trim(f.hoadueamount.value)=="") || (f.hoadueamount.value<=0))
	{
		alert('Please enter the amount due each month');
		return false;
	}
}

// HoaDueAmountLateFee
function HoaDueAmountLateFee(f)
{
	if ((Trim(f.hoadueamountlatefee.value)=="") || (f.hoadueamountlatefee.value<=0))
	{
		alert('Please enter the late fee amount');
		return false;
	}
}

//Check if due date exceeds late date
function HoaDueLessLate(f)
{
	if (parseInt(f.hoadueday.value) >= parseInt(f.hoaduelateday.value))
	{
		alert('The late date cannot exceed or be equal the due date');
		return false;
	}
}
 
//Check if dateend exceeds datestart
function TaskDateReverseOverlapCheck(f)
{
	if (Date(f.dateend.value) > Date(f.datestart.value))
	{
		alert('The end date cannot occure before the start date');
		return false;
	}
}

// FORUM TOPIC
function ForumName(f)
{
	if (Trim(f.forumname.value) == "" )
	{
		alert('Please type a \"Topic\" for this message board');
		return false;
	}
}

// FORUM DESCRIPTION
function ForumDescription(f)
{
	if (Trim(f.description.value) == "" )
	{
		alert('Please type a \"Description\" for this message board');
		return false;
	}
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


// CLASSIFIED TITLE
function Classifiedtitle(f)
{
	if (Trim(f.title.value) == "" )
	{
		alert('Please type a \"Title\" for this Classified Ad');
		return false;
	}
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

// CLASSIFIED CATEGORY
function ClassifiedCategoryID(f)
{
{
	if (f.categoryid.options[0].selected==true)
	{
		alert('Please select an Ad Type');
		return false;
	}
}
}


function parseCurrency(f)
{
	if (Trim(f) == "" )
	{
		alert('Please enter a price');
		return false;
	}
}

function quantity(f)
{
	if (Trim(f) == "" )
	{
		alert('Please enter a quantity');
		return false;
	}
	else if (!IsNumeric(f)) 
	{
		alert('Please enter a valid quantity');
		return false;
	}
}

// CLASSIFIED CONDITION
function ClassifiedConditionID(f)
{
{
	if (f.conditionid.options[0].selected==true)
	{
		alert('Please select the condition of this item');
		return false;
	}
}
}


// REQUEST TYPE
function RequestType(f)
{
{
	if (f.requesttype.options[0].selected==true)
	{
		alert('Please select your request type');
		return false;
	}
}
}

function RequestDescription(f)
{
	if (Trim(f.description.value) == "" )
	{
		alert('Please enter the description of your request');
		return false;
	}
}

//REQUEST VOTE
function RequestResultType(f)
{
{
	if (f.resulttype.options[0].selected==true)
	{
		alert('Please select your vote');
		return false;
	}
}
}

function AccessCode(f)
{
	if (Trim(f.accesscode.value) == "" )
	{
		alert('Please enter a valid Registration Access Code');
		return false;
	}
}

//============================================================================================
//*************************************** Joined *********************************************
//============================================================================================

// Customer Service Support Form
function ContactForm(f)
{
	if (NameValid(f) == false) { f.msgname.focus(); f.msgname.select(); return false; }
	if (EmailValid(f.email) == false) { f.email.focus(); f.email.select(); return false; }
	if (ContactSubject(f) == false) { f.msgsubject.focus(); f.msgsubject.select(); return false; }
	if (ContactBody(f) == false) { f.msgbody.focus(); f.msgbody.select(); return false; }
	checkandsubmit(f);
	return true;
}

// Classified Reply Form
function ClassifiedReplyForm(f)
{
	if (NameValid(f) == false) { f.msgname.focus(); f.msgname.select(); return false; }
	if (EmailValid(f.email) == false) { f.email.focus(); f.email.select(); return false; }
	if (ContactSubject(f) == false) { f.msgsubject.focus(); f.msgsubject.select(); return false; }
	if (ContactBody(f) == false) { f.msgbody.focus(); f.msgbody.select(); return false; }
	checkandsubmit(f);
	return true;
}

// Register Form
function RegisterForm(f)
{
	// if (BusinessNameValid(f) == false) { f.company.focus(); f.company.select(); return false; }
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	// if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	// if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	// if (StateValid(f) == false) { f.state.focus(); return false; }
	if (EmailValid(f.elements[4]) == false) { f.elements[4].focus(); f.elements[4].select(); return false; }
	if (IsPhoneValid(f.elements[7]) == false) { f.elements[7].focus(); f.elements[7].select(); return false; }
	if (loginuserid(f) == false) { f.userid.focus(); f.userid.select(); return false; }
	if (PasswordValid(f) == false) { f.password.focus(); return false; }
	if (UnitCntValid(f) == false) { f.unitcnt.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	if (HoaNameValid(f) == false) { f.hoaname.focus(); f.hoaname.select(); return false; }
	if (DomainValid(f) == false) { f.domain.focus(); f.domain.select(); return false; }
	if (f.agreetos.checked == false) { alert('Please check the box that you agree to the terms and conditions'); return false; }
	checkandsubmit(f);
	return true;
}

function MemberRegisterFormAddressBook(f)
{
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	if (Trim(f.birthday.value) != "" ) { if (checkDate(f.birthday) == false) { f.birthday.focus(); f.birthday.select(); return false; } }
	if (Trim(f.spousebirthday.value) != "" ) { if (checkDate(f.spousebirthday) == false) { f.spousebirthday.focus(); f.spousebirthday.select(); return false; } }
	if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	checkandsubmit(f);
	return true;
}

function MemberLoginForm(f)
{
	if (loginuserid(f) == false) { f.userid.focus(); f.userid.select(); return false; }
	if (loginpassword(f) == false) { f.password.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function AffiliateMemberLoginForm(f)
{
	if (Affiliateloginid(f) == false) { f.loginid.focus(); f.loginid.select(); return false; }
	if (loginpassword(f) == false) { f.password.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function PMLoginForm(f)
{
	if (PMloginid(f) == false) { f.loginid.focus(); f.loginid.select(); return false; }
	if (loginpassword(f) == false) { f.password.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function upqLoginForm(f)
{
	if (upqloginid(f) == false) { f.loginid.focus(); f.loginid.select(); return false; }
	checkandsubmit(f);
	return true;
}

function HOAAccessCodeLoginForm(f)
{
	if (AccessCode(f) == false) { f.accesscode.focus(); f.accesscode.select(); return false; } else { f.acl.value='t'; }
	checkandsubmit(f);
	return true;
}

function PollValidation(f)
{
	if (pollvote(f) == false) { return false; }
	checkandsubmit(f);
	return true;
}

function PollAdmin(f)
{
	if (pollquestion(f) == false) { f.question.focus(); f.question.select(); return false; }
	if (PollValueValid(f.elements[3]) == false) { f.elements[2].focus(); f.elements[2].select(); return false; }
	if (PollValueValid(f.elements[5]) == false) { f.elements[3].focus(); f.elements[3].select(); return false; }
	checkandsubmit(f);
	return true;
}

function ContactUSAdmin(f)
{
	if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	checkandsubmit(f);
	return true;
}

function PageMakerForm(f)
{
	if (PageMakerTitle(f) == false) { f.title.focus(); f.title.select(); return false; }
	//if (PageMakerPageType(f) == false) { f.pagetype.focus(); return false; }
	if (PageMakerPublish(f) == false) { f.published.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function CalendarEvent(f)
{
	if (CalendarEventVal(f) == false) { f.event.focus(); return false; }
	if (CalendarEmailNote(f) == false) { f.emailnote.focus(); return false; }
	checkandsubmit(f);
	return true;	
}

function AddressBook(f)
{
	if (OwnerNameVal(f) == false) { f.ownername.focus(); return false; }
	checkandsubmit(f);
	return true;	
}

function ForumPost(f)
{
	if (ForumSubject(f) == false) { f.subject.focus(); f.subject.select(); return false; }
	if (ForumBody(f) == false) { f.body.focus(); f.body.select(); return false; }
	checkandsubmit(f);
	return true;	
}

function ForumTopicPost(f)
{
	if (ForumName(f) == false) { f.forumname.focus(); f.forumname.select(); return false; }
	if (ForumDescription(f) == false) { f.description.focus(); f.description.select(); return false; }
	checkandsubmit(f);
	return true;	
}

function ClassifiedManage(f)
{
	if (Classifiedtitle(f) == false) { f.title.focus(); f.title.select(); return false; }
	if (ClassifiedCategoryID(f) == false) { f.categoryid.focus(); return false; }
	if (checkDate(f.postdate) == false) { f.postdate.focus(); f.postdate.select(); return false; }
	if (checkDate(f.expiredate) == false) { f.expiredate.focus(); f.expiredate.select(); return false; }
	//if (parseCurrency(f.price.value) == false) { f.price.focus(); f.price.select(); return false; }
	//if (quantity(f.quantity.value) == false) { f.quantity.focus(); f.quantity.select(); return false; }
	if (ClassifiedConditionID(f) == false) { f.conditionid.focus(); return false; }
	checkandsubmit(f);
	return true;	
}

function HOARequestForm(f)
{
	if (RequestType(f) == false) { f.requesttype.focus(); return false; }
	if (RequestDescription(f) == false) { f.description.focus(); f.description.select(); return false; }
	checkandsubmit(f);
	return true;
}

function HOARequestVoteForm(f)
{
	if (RequestResultType(f) == false) { f.resulttype.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function MemberRegAccessCode(f)
{
	if (AccessCode(f) == false) { f.accesscode.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function MemberRegisterForm(f)
{
	if (loginuserid(f) == false) { f.userid.focus(); f.userid.select(); return false; }
	if (PasswordValid(f) == false) { f.password.focus(); return false; }
	if (AccessCode(f) == false) { f.accesscode.focus(); return false; }
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	if (Trim(f.birthday.value) != "" ) { if (checkDate(f.birthday) == false) { f.birthday.focus(); f.birthday.select(); return false; } }
	if (Trim(f.spousebirthday.value) != "" ) { if (checkDate(f.spousebirthday) == false) { f.spousebirthday.focus(); f.spousebirthday.select(); return false; } }
	if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	checkandsubmit(f);
	return true;
}

function MemberGlobalUser(f)
{
	if (loginuserid(f) == false) { f.userid.focus(); f.userid.select(); return false; }
	if (PasswordValid(f) == false) { f.password.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function RegistrationAccessCode(f)
{
	if (AccessCode(f) == false) { f.accesscode.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function ForgotPassword(f)
{
	if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	checkandsubmit(f);
	return true;
}

function AffiliateRegForm(f)
{
	if (ValidAffiliateLoginID(f) == false) { f.affiliateloginid.focus(); f.affiliateloginid.select(); return false; }
	if (PasswordValid(f) == false) { f.password.focus(); return false; }
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	if (IsPhoneValid(f.telephone) == false) { f.telephone.focus(); f.telephone.select(); return false; }
	checkandsubmit(f);
	return true;
}

function PMRegForm(f)
{
	if (loginuserid(f) == false) { f.userid.focus(); f.userid.select(); return false; }
	if (PasswordValid(f) == false) { f.password.focus(); return false; }
	if (BusinessNameRequired(f) == false) { f.company.focus(); f.company.select(); return false; }
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	//if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	//if (IsPhoneValid(f.telephone) == false) { f.telephone.focus(); f.telephone.select(); return false; }
	if (EmailValid(f.elements[14]) == false) { f.elements[14].focus(); f.elements[14].select(); return false; }
	if (IsPhoneValid(f.elements[17]) == false) { f.elements[17].focus(); f.elements[17].select(); return false; }
	checkandsubmit(f);
	return true;
}

function UPQAccessRegForm(f)
{
	if (upqloginid(f) == false) { f.loginid.focus(); f.loginid.select(); return false; }
	if (BusinessNameRequired(f) == false) { f.company.focus(); f.company.select(); return false; }
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	if (Address1Valid(f) == false) { f.address1.focus(); f.address1.select(); return false; }
	if (CityValid(f) == false) { f.city.focus(); f.city.select(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }	
	if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	if (IsPhoneValid(f.telephone) == false) { f.telephone.focus(); f.telephone.select(); return false; }
	checkandsubmit(f);
	return true;
}

function AffiliatePaymentRegister(f)
{
	checkandsubmit(f);
	return true;
}

function DuesAdmin(f)
{
	if (HoaDueAmount(f) == false) { f.hoadueamount.focus(); f.hoadueamount.select(); return false; }
	if (HoaDueAmountLateFee(f) == false) { f.hoadueamountlatefee.focus(); f.hoadueamountlatefee.select(); return false; }
	if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	checkandsubmit(f);
	return true;
}

function ChangeDomain(f)
{
	if (DomainValid(f) == false) { f.domain.focus(); f.domain.select(); return false; }
	checkandsubmit(f);
	return true;
}

function pmRegSite(f)
{
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	if (DomainValid(f) == false) { f.domain.focus(); f.domain.select(); return false; }
	if (HoaNameValid(f) == false) { f.hoaname.focus(); f.hoaname.select(); return false; }
	checkandsubmit(f);
	return true;
}

function pmRegSiteDocs(f)
{
	if (HoaNameValid(f) == false) { f.hoaname.focus(); f.hoaname.select(); return false; }
	if (PMIDValid(f) == false) { f.pmid.focus(); return false; }
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	checkandsubmit(f);
	return true;
}

function HOAFinderSearch(f)
{
	if (ZipCodeValid(f) == false) { f.zip.focus(); f.zip.select(); return false; }
	checkandsubmit(f);
	return true;
}

function TaskManagerForm(f)
{
	if (TaskCategory(f) == false) { f.taskcategoryid.focus(); return false; }
	if (Trim(f.datestart.value) == ""){ alert('Please enter a Strating Date'); f.datestart.focus(); return false;}
	if (Trim(f.datestart.value) != "" ) { if (checkDate(f.datestart) == false) { f.datestart.focus(); f.datestart.select(); return false; } }
	if (TaskTimeStart(f) == false) { f.timestart.focus(); return false; }
	
	if (Trim(f.dateend.value) != "")
	{
		if (checkDate(f.dateend) == false)
		{
			f.dateend.focus(); f.dateend.select(); return false;
		}
		else
		{
			if (TaskTimeEnd(f) == false)
			{
				f.timeend.focus(); return false;
			}
			else
			{
				if (TaskDateReverseOverlapCheck(f) == false) { return false; }
			}
		}
	}
	
	if (TaskStatus(f) == false) { f.taskstatus.focus(); return false; }
	if (TaskPriority(f) == false) { f.taskpriority.focus(); return false; }
	if (TaskOwner(f) == false) { f.ownermemberid.focus(); return false; }
	if (TaskTitle(f) == false) { f.title.focus(); return false; }
	if (TaskDescription(f) == false) { f.description.focus(); return false; }
	
	if (f.emailalert.checked)
	{
		if (TaskEmailMsg(f) == false) { f.emailmsg.focus(); return false; }
		if (TaskContactID(f) == false) { f.contactid.focus(); return false; }
	}
	
	checkandsubmit(f);
	return true;
}

function SubTaskManagerForm(f)
{
	if (TaskStatus(f) == false) { f.taskstatus.focus(); return false; }
	if (TaskOwner(f) == false) { f.ownermemberid.focus(); return false; }
	if (TaskTitle(f) == false) { f.title.focus(); return false; }
	if (TaskDescription(f) == false) { f.description.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function EventCalendarForm(f)
{
	if (TaskCategory(f) == false) { f.taskcategoryid.focus(); return false; }
	if (Trim(f.datestart.value) == ""){ alert('Please enter a Strating Date'); f.datestart.focus(); return false;}
	if (Trim(f.datestart.value) != "" ) { if (checkDate(f.datestart) == false) { f.datestart.focus(); f.datestart.select(); return false; } }
	if (TaskTimeStart(f) == false) { f.timestart.focus(); return false; }
	
	if (Trim(f.dateend.value) != "")
	{
		if (checkDate(f.dateend) == false)
		{
			f.dateend.focus(); f.dateend.select(); return false;
		}
		else
		{
			if (TaskTimeEnd(f) == false)
			{
				f.timeend.focus(); return false;
			}
			else
			{
				if (TaskDateReverseOverlapCheck(f) == false) { return false; }
			}
		}
	}
	
	if (TaskTitle(f) == false) { f.title.focus(); return false; }
	if (TaskDescription(f) == false) { f.description.focus(); return false; }
	
	if (f.emailalert.checked)
	{
		if (TaskEmailMsg(f) == false) { f.emailmsg.focus(); return false; }
		if (TaskContactID(f) == false) { f.contactid.focus(); return false; }
	}
	
	checkandsubmit(f);
	return true;
}

function ViolationForm(f)
{
	if (ViolatorMemberID(f) == false) { f.memberidviolator.focus(); return false; }
	if (Trim(f.violationdate.value) == ""){ alert('Please enter the Date of the violation'); f.violationdate.focus(); return false;}
	if (Trim(f.violationdate.value) != "" ) { if (checkDate(f.violationdate) == false) { f.violationdate.focus(); f.violationdate.select(); return false; } }
	if (ViolationTime(f) == false) { f.violationtime.focus(); return false; }
	if (ViolationType(f) == false) { f.violationtype.focus(); return false; }
	if (Trim(f.fine.value) == ""){ f.fine.value = '0'; }
	checkandsubmit(f);
	return true;
}

function SecurityLevelForm(f)
{
	if (SecurityTitle(f) == false) { f.title.focus(); return false; }
	if (SecurityDescription(f) == false) { f.description.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function ContactGroupForm(f)
{
	if (ContactGroupTitle(f) == false) { f.title.focus(); return false; }
	if (ContactGroupDescription(f) == false) { f.description.focus(); return false; }
	checkandsubmit(f);
	return true;
}

function FAQForm(f)
{
	if (Trim(f.question.value) == ""){ alert('Please enter the Question'); f.question.focus(); return false;}
	if (Trim(f.answer.value) == ""){ alert('Please enter the Answer'); f.answer.focus(); return false;}
	checkandsubmit(f);
	return true;
}

function ContactDirectoryMembers(f)
{
	if (IsCheckboxChecked(f.mid) == false) { alert('Please select at least one person you want to contact via email.'); return false; }
	checkandsubmit(f);
	return true;
}

function ContactImportantContacts(f)
{
	//if (IsCheckboxChecked(f.cid) == false) { alert('Please select at least one person you want to contact via email.'); return false; }
	checkandsubmit(f);
	return true;
}

function ImportantContactForm(f)
{
	if (BusinessNameValid(f) == false) { f.company.focus(); f.company.select(); return false; }
	checkandsubmit(f);
	return true;
}

function AssociationOnlineProcForm(f)
{
	checkandsubmit(f);
	return true;
}

function PMManagerForm(f)
{
	if (FirstNameValid(f) == false) { f.firstname.focus(); f.firstname.select(); return false; }
	if (LastNameValid(f) == false) { f.lastname.focus(); f.lastname.select(); return false; }
	//if (EmailValid(f.emailaddress) == false) { f.emailaddress.focus(); f.emailaddress.select(); return false; }
	//if (IsPhoneValid(f.telephone) == false) { f.telephone.focus(); f.telephone.select(); return false; }
	checkandsubmit(f);
	return true;
}

function VehicleRegistrationForm(f)
{
	if (VehicleRegistrationLicense(f) == false) { f.license.focus(); return false; }
	if (StateValid(f) == false) { f.state.focus(); return false; }
	if (VehicleColorValid(f) == false) { f.colorid.focus(); return false; }
	checkandsubmit(f);
	return true;
}