function formcheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("data[first_name]", "data[nickname]", "data[email]", "data[subject]", "data[information]", "data[agreement]");
	// field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Nickname", "Email", "Subject", "Information", "Agreement");
	// dialog message
	var alertMsg = "The following fields are required:\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 == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " * " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " * " + fieldDescription[i] + "\n";
				}
				break;
                        case "select":
				if (obj.selectedIndex == -1){
					alertMsg += " * " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " * " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null){
					alertMsg += " * " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}