/*

 valid8forms.js

***** CheckEmail(CheckMe) 
	Returns 'true' if the address appears to be OK, 'false' otherwise.

***** NewPageWithParam(PassThis)
	Tag the PassThis variable on to the end of the URL that calls
	the next page. 
	Usage: NewPageWithParam('Send this text')
	Adds ?Send%20this%20text to the end of the URL.
	
***** ExtractSubject()
	Extracts text from URL and assigns it to 'subject'
	
*/

function CheckEmail(CheckMe) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(CheckMe))
	{
		return (true)
	}
	return (false)
}


// Passes parameter on URL
function NewPageWithParam(PassThis) 
{
	document.location.href="get.html?" + PassThis
}

// Deconstruct information passed on URL
function ExtractSubject()
{
	var SubjectLine=unescape(document.location.search.substring(1));
	if (SubjectLine.length == 0) SubjectLine = 'Info request from Website';
	document.forms[0].subject.value = SubjectLine;
//	alert (document.forms[0].subject.value);
}

// Confirm cancel form
function ConfirmCancel()
{
  if (confirm("Are you sure you want to clear the form?\nClick OK to clear it."))
   {
      document.forms[0].reset();
   }
  return;
}

// alert ('valid8forms.js loaded ok');
