
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Formatting functions //////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	function formatHour (strInput) {
		
		if (strInput.length == 0) {
			return strInput;
			
		} else {
			
			strInput = strInput.toUpperCase();
			
			var booAMPM = strInput.indexOf("AM");
			
			if (booAMPM == "-1") {
				booAMPM = strInput.indexOf("PM");
			}
			
			if (booAMPM == "-1") {
				strInput = strInput.replace(/[a-zA-Z\s]/g, "");
				strInput += " AM";
			}
			
			return strInput;
		}
	}
	
	

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Validation functions //////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function isEmpty (val) {
	if (val == "" || val == null)
		return true;
	else
		return false;
}


function isOptionSelected (obj) {
	
	if (obj.selectedIndex == -1) {
		return false;
		
	} else {
	
		if (obj.options[obj.selectedIndex].value == "-1") {
			return false;
		} else {
			return true;
		}
	}
}


function isValidHour (strVal) {
	var re = /^\d{1,2}\:\d{2} ((am|AM)|(pm|PM))$/
	return re.test(strVal);
}



function isInteger(val) {
	var re = /^-?\d+$/;
    return re.test(val);
}

function isNumeric(val) {
	var re = /^-?\d+(\.\d*)?$/;
	return re.test(val);
}










