/*******************************************************************************
 * Copyright (c) 2003 Alister Lewis-Bowen
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Alister Lewis-Bowen <alister@different.com>
 ******************************************************************************/

function checkform(form)
{
        if (form.sName.value == "") 
        {
                alert( "Please enter your name. Thank you." );
                form.sName.focus();
                return false ;
        }
        if (form.sEmail.value == "") 
        {
                alert( "Please enter your email address. Thank you." );
                form.sEmail.focus();
                return false ;
        }
        if (!validateEMailAddress(form.sEmail.value)) 
        {
                alert("Please enter a valid email address. Thank you.");
                form.sEmail.value.focus();
                return false;
        }
        if (form.sCategory.selectedIndex == -1) 
        {
                alert( "Please enter your request. Thank you." );
                form.request.focus();
                return false ;
        }
}

//
//	Configurable vars
//
//var URL = 'http://friendsattheadvent.org/cgi-sys/cgiwrap/alister/friendsattheadvent.org/Mailer.pl';
//var XMLURI = '/data/xml/contact.xml';

//
// Validate the fields in the contact  form, build the GET method
// URL and submit it.
//
//function onSubmit()
//{
//	var AMP = '&';
//	if (document.all.sName.value == '')
//	{
//		alert("Please enter your name. Thank you.");
//		document.all.sName.focus();
//		return false;
//	}
//	if (!validateEMailAddress(document.all.sEmail.value)) 
//	{
//		alert("Please enter a valid email address. Thank you.");
//		document.all.sEmail.focus();
//		return false;
//	}
//	if (document.all.sCategory.selectedIndex == -1)
//	{
//		alert("Please select a subject category. Thank you.");
//		document.all.sCategory.focus();
//		return false;
//	}
//	location.href = URL + '?' +
//		"xmluri=" + XMLURI + AMP +
//		"sName=" + escape(document.all.sName.value) + AMP +
//		"sEmail=" + escape(document.all.sEmail.value) + AMP +
//		"sCategory=" + escape(document.all.sCategory.options[document.all.sCategory.selectedIndex].text) + AMP +
//		"sComments=" + escape(document.all.sComments.value) + AMP +
//		"sReferrer=" + document.referrer;
//	return true;
//}

