// SmallBizWebs.com JavaScript Document
// Copyright SmallBizWebs.com, A Division of The JBI Company, Inc.
// All Rights Reserved, contact SmallBizWebs.com for licensing information.
//
// ===========================
// Code loaded in Head Section
// ===========================
//
// Standard MM code functions
// This section only, copyright Adobe Systems Incorporated
//
//
// SmallBizWebs.com custom code functions
// Copyright SmallBizWebs.com, All Rights Reserved
//
// ====================
// SBW_initParam v1.0
// ====================
//
// var stuff = SBW_initParam(stuff,'initvalue');
//
function SBW_initParam(parm,dflt) {
	if (typeof dflt == 'undefined' || dflt == 'undefined' || dflt == null) dflt = '';
	if (typeof parm == 'undefined' || parm == 'undefined' || parm == null || parm == '') parm = dflt;
	return parm;
}
//
// =====================
// SBW_validateForm v1.1
// =====================
//
// onSubmit="return SBW_validateForm(this,'none')"
//
function SBW_validateForm(theForm,showErr) {
  var errors='';
	showErr = SBW_initParam(showErr,'');
	if (theForm.Email.value == "" || theForm.Email.value == "E-Mail Address") {
    errors = '- Your E-Mail address is required.\n' + errors;
	  if (showErr == 'focus') {
	    theForm.Email.focus();
		}
  } else {
    var re = /^([A-Z0-9_-]+[A-Z0-9\._-]*@)([A-Z0-9-]+\.)+(([A-Z]{2,4}|museum)$)/i;
    if (!re.test(theForm.Email.value)) {
      errors = '- Your E-Mail must be a valid address.\n' + errors;
	  if (showErr == 'focus') {
		    theForm.Email.focus();
			}
    }
  }
  if (errors) {
  alert('Please correct the following error:\n\n'+errors);
  return (false);
  }
  else return (true);
}
