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 checkCategory() {
	var category = document.searchform.category.options[document.searchform.category.selectedIndex].value;
	document.searchform.hidcategory.value = category;
	searchform.action = "index.php";
	searchform.submit();
}

function checkTheme() {
	var theme = document.searchform.theme.options[document.searchform.theme.selectedIndex].value;
	document.searchform.hidtheme.value = theme;
	searchform.action = "index.php";
	searchform.submit();
}

function checkArtist() {
	var artistauthor = document.searchform.artistauthor.options[document.searchform.artistauthor.selectedIndex].value;
	document.searchform.hidartistauthor.value = artistauthor;
	
	if (artistauthor == "Legacy Worship") {
		searchform.action = "music_worship.php";
		searchform.submit();
	}
	if (artistauthor == "Cornelis van Heyningen") {
		searchform.action = "music_worship.php";
		searchform.submit();
	}
	if (artistauthor == "Louise Hefer") {
		searchform.action = "music_instrumental.php";
		searchform.submit();
	}
}

function checkForm() {
	var fullname = document.myform.fullname;
	var email = document.myform.email;
	var phonecell = document.myform.phonecell;
	var postal = document.myform.postal;
	var comments  = document.myform.comments;
	
	if (fullname.value == "") {
		alert("Please enter Full Name");
		fullname.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('@') == -1) {
		alert("Please enter valid E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('.') == -1) {
		alert("Please enter valid E-Mail Address");
		email.focus();
		return false;
	}
	if (phonecell.value == "") {
		alert("Please enter Phone / Cell Number");
		phonecell.focus();
		return false;
	}
	if (postal.value == "") {
		alert("Please enter Postal Address");
		postal.focus();
		return false;
	}
	if (postal.value.indexOf('"') != -1) {
		alert('Please remove quoation mark/s (") from Postal Address');
		postal.focus();
		return false;
	}
	if (comments.value == "") {
		alert("Please enter Comments");
		comments.focus();
		return false;
	}
	if (comments.value.indexOf('"') != -1) {
		alert('Please remove quotation mark/s (") from Comments');
		comments.focus();
		return false;
	}
	document.myform.action = "ordersend.php";
	return true;
}

function checkContactForm() {
	var fullname = document.myform.fullname;
	var email = document.myform.email;
	var phonecell = document.myform.phonecell;
	var comments = document.myform.comments;
	
	if (fullname.value == "") {
		alert("Please enter Full Name");
		fullname.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('@') == -1) {
		alert("Please enter valid E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('.') == -1) {
		alert("Please enter valid E-Mail Address");
		email.focus();
		return false;
	}
	if (phonecell.value == "") {
		alert("Please enter Phone / Cell Number");
		phonecell.focus();
		return false;
	}
	if (comments.value == "") {
		alert("Please enter Comments");
		comments.focus();
		return false;
	}
	document.myform.action = "contactus2.php";
	return true;
}