// JavaScript for validating forms create the validation object 

function Validation()
{
	this.isEmpty = isEmpty;
  this.isEmailAddress = isEmailAddress;
	this.isDropDown	= isDropDown;
	this.isAlphabetic = isAlphabetic;
}

//---------------Functions/Methods -------------

// check to see if input is whitespace only or empty for all required fields

function isDropDown(input)
{
    if (input == 0) 
		{
       return false;
    }    
		else
		{
			return true;
		}
}  
function isEmpty(input)
{
	if (input.match(/^s+$/) || input == "")
	{
		return true;
	}
	else
	{
		return false;
	}
}

//test for valid email address
function isEmailAddress(input)
{
	if (input.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/))
	{
		return true;
	}
	else
	{
		return false;
	}
}

//check to see if the input is Alphabetic for Firstname and LastName
function isAlphabetic(input)
{
	if (input.match(/^[a-zA-Z]+$/))
	{
		return true;
	}
	else
	{
			return false;
	}
}