//Javascript
function checkTimeValues(formobj, fieldRequired, fieldDescription){
// dialog message
var alertMsg = "Incorrect input on the following fields:\n";
var l_Msg = alertMsg.length;

	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if(obj.value > 12 || obj.value < 1){
				alertMsg += " - " + fieldDescription[i] + "\n";
			}
		}//end if (obj)
	}//end loop

	if (alertMsg.length == l_Msg){
		return 1;
	}else{
		alert(alertMsg);
		return 0;
	}
}

function checkForm(formobj, fieldRequired, fieldDescription){
// dialog message
var alertMsg = "Please complete the following fields:\n";
var l_Msg = alertMsg.length;

	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == 0 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}//end case select one
				break;
			case "text":
			case "password":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}//end case textarea
				break;
			default:
			}//end switch
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}//end if (obj)
	}//end loop

	if (alertMsg.length == l_Msg){
		return 1;
	}else{
		alert(alertMsg);
		return 0;
	}
}



function checkpassword(password, confirm_password){

	if(password == confirm_password){
		return 1;
	}
	else
	{
		return 'Your password and confirmation password did not match.';
	}
	
}