function inputValidation(formObj)
{
	var strBuilder = '';
	var userInput = '';
	var inputElement = '';
	var displayName = '';

	for(var i = 0; i < formObj.elements.length; i++) {
		inputElement = Element.extend(formObj.elements[i]);

		if (inputElement.tagName.toLowerCase() == 'fieldset' || 
			inputElement.type.toLowerCase() == 'image' || 
			inputElement.type.toLowerCase() == 'submit') {
			continue;
		}

		userInput = inputElement.value.stripScripts().stripTags();
		displayName = inputElement.readAttribute('cDisplayName');

		//Required Field validation IF
		if(inputElement.readAttribute('cIsRequired') == 'true')
		{
			//checks to see if txtBx is empty, or if dropdownlist is empty.
			if(userInput == ''){
				strBuilder += '<b>' + displayName + '</b> is a required field.<br/>';
			}else if(userInput == '-1'){
				strBuilder += 'Please select a <b>' + displayName + '</b> from the drop down list.<br/>';
			}
		}

		//Compare Fields validation IF
		if(inputElement.readAttribute('cFieldMatch')){
			var compareAgainst = $(inputElement.readAttribute('cFieldMatch'));
			if(userInput != compareAgainst.value){
				strBuilder += '<b>' + displayName + '</b> does not match <b>' + compareAgainst.readAttribute('cDisplayName') + '</b> <br/>';
			}
		}

		//Regular Expression validation IF
		if(inputElement.readAttribute('cIsRegExMatch') && (userInput != '')) {
			var regExMatch = '';
			switch(inputElement.readAttribute('cIsRegExMatch')){
				case 'email':
					regExMatch = new RegExp('\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*\\.(\\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))');
					if(!regExMatch.test(userInput)){
						strBuilder += 'The value <b>' + userInput + '</b> is not a proper <b>' + displayName + '</b>, please give the email address in the format <b>\'handle@domain.com\'</b><br/>';
					}
					break;
				case 'phone':
					var phoneNumber = '';
					for(var c = 0; c < userInput.length; c++){
						if(parseInt(userInput.charAt(c)) || userInput.charAt(c) == '0'){
							phoneNumber += userInput.charAt(c);
						}
					}
                    regExMatch = new RegExp('^1\\d{10}$');
                    if(!regExMatch.test(userInput)) {
						strBuilder += '<b>'+userInput+'</b> does not seem to be a proper phone number.<br />';
						strBuilder += '&#8226; We require an eleven (11) digit number that includes a country code ex: <b>15192421234</b>.';
						strBuilder += '<br/>';
					}

					break;
				case 'alphanum':
					regExMatch = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$');
					if(!regExMatch.test(userInput)){
						strBuilder += 'The value <b>' + userInput + '</b> is not a proper <b>' + displayName + '</b>, your input can have <b>\'A-Z\', \'a-z\', \'0-9\', \'-\' and \'_\'</b>.<br/>';
					}
					break;
				case 'alphanumspace':
					regExMatch = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9_ -]+[a-zA-Z0-9]$');
					if(!regExMatch.test(userInput)){
						strBuilder += 'The value <b>' + userInput + '</b> is not a proper <b>' + displayName + '</b>, your input can have <b>\'A-Z\', \'a-z\', \'0-9\', \'-\' and \'_\'</b>.<br/>';
					}
					break;
			}
		}

		//Positive number IF
		if(inputElement.readAttribute('cIsPositiveNumber')){
			var number = parseInt(userInput);
			if(number <= 0){
				strBuilder += 'The value ' + userInput + ' is not a positive number.<br/>';
			}
		}

		//Min Length IF
		if(inputElement.readAttribute('cMinLength')){
			var minLength = parseInt(inputElement.readAttribute('cMinLength'));
			if(userInput.length < minLength){
				strBuilder += '<b>' + displayName + '</b> is required to be greater than or equal to ' + minLength + ' characters.<br/>';
			}
		}

		//Max Length IF
		if(inputElement.readAttribute('cMaxLength')){
			var maxLength = parseInt(inputElement.readAttribute('cMaxLength'));
			if(userInput.length > maxLength){
				strBuilder += '<b>' + displayName + '</b> is required to be less than or equal to ' + maxLength + ' characters.<br/>';
			}
		}
	}

	if(strBuilder != '') {		
		popMessageBox('Oops', strBuilder, null, true);
		return false;
	}
	return true;
}