function checkSignupForm() {
	var fullname = document.myform.fullname;
	var email = document.myform.email;
	var city = document.myform.city;
	var phonecell = document.myform.phonecell;
	var comments = document.myform.comments;
	
	if (fullname.value == "") {
		alert("Full Name please");
		fullname.focus();
		return false;
	}
	if (email.value == "") {
		alert("E-Mail Address please");
		email.focus();
		return false;
	}
	if (city.value == "") {
		alert("City please");
		city.focus();
		return false;
	}
	if (phonecell.value == "") {
		alert("Phone / Cell Number please");
		phonecell.focus();
		return false;
	}
	if (comments.value == "") {
		alert("Comments / Query please");
		comments.focus();
		return false;
	}
	if (comments.value.indexOf('"') != -1) {
		alert("Please remove quotation mark/s from Comments / Query");
		comments.focus();
		return false;
	}
	document.myform.action = "signup.php";
	return true;
}

function checkLoginForm() {
	var username = document.myform.username;
	var password = document.myform.password;
	
	if (username.value == "") {
		alert("Please enter Username");
		username.focus();
		return false;
	}
	if (password.value == "") {
		alert("Please enter Password");
		password.focus();
		return false;
	}
	document.myform.action = "validate.php";
	return true;
}

function checkPostUpdateForm() {
	var postupdate = document.myform.postupdate;
	if (postupdate.value == "") {
		alert("Please enter Details");
		postupdate.focus();
		return false;
	}
	if (postupdate.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from your Details");
		postupdate.focus();
		return false;
	}
	document.myform.action = "postupdate_action.php";
	return true;
}

function checkPostDiscussionForm() {
	var discussion_title = document.myform.discussion_title;
	var discussion_details = document.myform.discussion_details;
	if (discussion_title.value == "") {
		alert("Please enter Title");
		discussion_title.focus();
		return false;
	}
	if (discussion_details.value == "") {
		alert("Please enter Details");
		discussion_details.focus();
		return false;
	}
	if (discussion_details.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from your Details");
		discussion_details.focus();
		return false;
	}
	document.myform.action = "postdiscussion_action.php";
	return true;
}

function checkPostCalendarForm() {
	var date_day = document.myform.date_day;
	var date_month = document.myform.date_month;
	var date_year = document.myform.date_year;
	var calendar_event = document.myform.calendar_event;
	
	if (date_day.selectedIndex == 0) {
		alert("Please select Day");
		date_day.focus();
		return false;
	}
	if (date_month.selectedIndex == 0) {
		alert("Please select Month");
		date_month.focus();
		return false;
	}
	if (date_year.selectedIndex == 0) {
		alert("Please select Year");
		date_year.focus();
		return false;
	}
	if (calendar_event.value == "") {
		alert("Please enter Calendar Event");
		calendar_event.focus();
		return false;
	}
	if (calendar_event.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Calendar Event");
		calendar_event.focus();
		return false;
	}
	document.myform.action = "postcalendar_action.php";
	return true;
}

function checkPostComment() {
	var comment = document.myform.comment;
	if (comment.value == "") {
		alert("Please enter Comments");
		comment.focus();
		return false;
	}
	if (comment.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Comments");
		comment.focus();
		return false;
	}
	document.myform.action = "viewdiscussion_comment.php";
	return true;
}

function checkDeny() {
	var answer = confirm("Are you sure you want to deny this signup request? The client will be informed of this");
	if (answer) {
		document.myform.action = "signuprequests_deny.php";
		return true;
	} else {
		return false;
	}
}

function checkEmailForm() {
	var subject = document.myform.subject;
	var message = document.myform.email;
	
	if (subject.value == "") {
		alert("Please enter Subject");
		subject.focus();
		return false;
	}
	if (subject.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Subject");
		subject.focus();
		return false;
	}
	if (message.value == "") {
		alert("Please enter E-Mail Content");
		message.focus();
		return false;
	}
	if (message.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from E-Mail Content");
		message.focus();
		return false;
	}
	document.myform.action = "sendemail_action.php";
	return true;
}
