<!-- THIS FILE IS USED FOR TIME VALIDATIONS -->
function validateTime(strTime, fieldName, flagCheckNull, timeFormat){
	if(flagCheckNull){
		if(strTime == ""){
			alert("Please enter " + fieldName);
			return false;
		}
	}
	else{
		if(strTime == "") return true;
	}

	switch(timeFormat){
		default:
			if(strTime.length != 4){
				alert(fieldName + " - Please enter in " + timeFormat + " only");
				return false;
			}

			for(var i = 0; i < strTime.length; i++){
				digit = strTime.substring(i, i+1);
				if( digit < "0" || digit > "9" ){
					alert(fieldName + " - Please enter digits only");
					return;
				}
			}

			var strHour = strTime.substr(0, 2);
			var intHour = parseInt(strHour, 10);

			var strMin = strTime.substr(2, 2);
			var intMin = parseInt(strMin, 10);

			var intSec = 0;

			break;
	}

	if(intHour < 0 || intHour > 23){
		alert(fieldName + " - Please enter hour between 0 and 23");
		return false;
	}

	if(intMin < 0 || intMin > 59){
		alert(fieldName + " - Please enter minute between 0 and 59");
		return false;
	}

	if(intSec < 0 || intSec > 59){
		alert(fieldName + " - Please enter Second Between 0 and 59");
		return false;
	}
	
	return true;
}

