//JS scripts for lps_platform page class - php_page.php

//(c)2009 Bruce G. Mills, www.lonepinestudio.com
//all rights reserved.
/***
This script is licensed for use exclusively by authorized customers of Bruce G. Mills for use under a single
designated URL. Unless otherwise stated, the right to use this script is "as is" basis without warranty or 
guarantee, express, implied or otherwise. It may not be copied, moved, sold or passed on by transfer
of ownership without the written permission of Bruce G. Mills, bruce@lonepinestudio.com By accepting the installation 
of this file, the licensee accepts sole responsibility for determining the appropriateness and acceptability of its 
intended use, for insuring compliance with the terms of this notice and for the tems of any additional development or 
site licensing agreements with Bruce G. Mills. 
***/


signupForms = true;
//alert("signup forms loading");

// signup form
		
function validateSignup()
{
	if ( (frm = document.signupform) )
	{
		if ( isEmpty(frm.firstname.value) )
		{
			alert("First name is required.");
			frm.firstname.focus();
			return false;
		}
		else if ( !isAlphaExt(frm.firstname.value) )
		{
			alert("The entry must consist of aphabetic characters and may contain hyphens or spaces. It cannot be more than 16 characters in length.");
			frm.firstname.focus();
			return false;
		}
		if ( isEmpty(frm.lastname.value) )
		{
			alert("Last name is required.");
			frm.lastname.focus();
			return false;
		}
		else if ( !isAlphaExt(frm.lastname.value) )
		{
			alert("The entry must consist of aphabetic characters and may contain hyphens or spaces. It cannot be more than 24 characters in length.");
			frm.lastname.focus();
			return false;
		}
		if ( isEmpty(frm.orgname.value) )
		{
			alert("Organization name is required.");
			frm.orgname.focus();
			return false;
		}
		else if ( !isAlphaNumExt(frm.orgname.value) )
		{
			alert("The entry must consist of aphabetic-numeric characters and may contain hyphens or spaces. It cannot be more than 32 characters in length.");
			frm.orgname.focus();
			return false;
		}
		if ( isEmpty(frm.jobtitle.value) )
		{
			alert("Job title is required.");
			frm.jobtitle.focus();
			return false;
		}
		else if ( !isAlphaExt(frm.jobtitle.value) )
		{
			alert("The entry must consist of aphabetic characters and may contain hyphens or spaces. It cannot be more than 32 characters in length.");
			frm.jobtitle.focus();
			return false;
		}
		if ( isEmpty(frm.phoneno.value) )
		{
			alert("Phone number is required. International numbers with up to 18 characters are accepted.");
			frm.phoneno.focus();
			return false;
		}
		else if ( !isNumExt(frm.phoneno.value) || frm.phoneno.value.length < 12 )
		{
			alert("Phone number may consist of numerals and hyphens, dots, or spaces and must be at least 12 characters including area code and hyphens.");
			frm.phoneno.focus();
			return false;
		}
		if ( !isEmail(frm.email) )
		{
			return false;
		}
		if ( isEmpty(frm.message.value) )
		{
			alert("There is no message.");
			frm.message.focus();
			return false;
		}
		/*
		if ( isTag(frm.message) )
		{
			alert("The message must be comprised of plain text. HTML markup characters are not accepted.");
			frm.message.focus();
			return false;
		}
		*/
		return true;
	}
}


//alert("signup forms loaded");



