/*************************************************
	 Developed by Dawn Price
	 Contact:  dawn@afterdawnonline.com

	This file and its contents and links are the 
	property of AfterDawn Online.  This file can not
	be used or copied with out the written permission
	of AfterDawn Online.  
***************************************************/

// This file holds the JavaScripts that will be used for the login scripts.

function CheckData(form) {

	if(form.username.value.length <= 0) {
		alert("Enter a username.");
		form.username.value = "*** Username";
		form.username.focus();
		var problem = true;
	}

	if(form.first.value.length <= 0) {
		alert("Enter your first name.");
		form.first.value = "*** First Name";
		form.first.focus();
		var problem = true;
	}

	if(form.last.value.length <= 0) {
		alert("Enter your last name");
		form.last.value = "*** Last Name";
		form.last.focus();
		var problem = true;
	}

	if(form.email.value.length <= 0) {
		alert("Enter your email address.");
		form.email.value = "*** Email Address";
		form.email.focus();
		var problem = true;
	}

	if(form.pass1.value.length < 8) {
		alert("Enter a password at least 8 charaters long.");
		var problem = true;
	}

	if(form.pass1.value != form.pass2.value) {
		alert("Your confirmed password does not match the entered password.");
		var problem = true;
	}

	if(problem == true) {
		return false;
	} else {
		return true;
	}

}


// check login information
function CheckLogin(form) {

	if(form.first.value.length <= 0) {
		alert("Enter your first name.");
		form.first.value = "*** First Name";
		form.first.focus();
		var problem = true;
	}

	if(form.last.value.length <= 0) {
		alert("Enter your last name");
		form.last.value = "*** Last Name";
		form.last.focus();
		var problem = true;
	}

	if(form.email.value.length <= 0) {
		alert("Enter your email address.");
		form.email.value = "*** Email Address";
		form.email.focus();
		var problem = true;
	}

	if(form.email.value != form.conferm_email.value) {
		alert("Your confirmed email does not match the entered email.");
		var problem = true;
	}

	if(form.address.value.length <= 0) {
		alert("Enter a numeric address.");
		var problem = true;
	}

	if(problem == true) {
		return false;
	} else {
		return true;
	}

}
