// SmallBizWebs.com JavaScript Document
// Code for HEAD section
//
/* Standard STATIC MM code functions */
//
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//
/* Standard DYNAMIC MM code functions */
//
//
//
// SmallBizWebs.com custom code functions
//
// Copyright SmallBizWebs.com, all rights reserved
//
//
// Code for validating CRM forms
//
function SBW_validateForms(theForm) {
  var errors='';
  if (theForm.EMail.value == "" || theForm.EMail.value == "Your E-Mail") {
    errors = '- Your E-Mail address is required.\n' + errors;
  } 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 (theForm.Name.value == "" || theForm.Name.value == "Your Name") {
    errors = '- Your Name is required.\n' + errors;
  }
  if (errors) {
  alert('The following error(s) occurred:\n\n'+errors);
  return (false);
  }
  else return (true);
}
//
// Code for validating iContact form
//
function SBW_validateICForm(theForm) {
  if (theForm.fields_email.value == "" || theForm.fields_email.value == "Your E-Mail") {
    theForm.fields_email.focus();
    alert("Your E-Mail Address is required.");
    return false;
	}
	var re = /^([A-Z0-9_-]+[A-Z0-9\._-]*@)([A-Z0-9-]+\.)+(([A-Z]{2,4}|museum)$)/i;
	if (!re.test(theForm.fields_email.value)) {
    theForm.fields_email.focus();
    alert("Your E-Mail must be a valid address.");
    return false;
	}
	if (theForm.fields_fname.value == "First Name") {
			theForm.fields_fname.value = "";
	}
	if (theForm.fields_lname.value == "Last Name") {
			theForm.fields_lname.value = "";
	}
	return (true);
}
//
// Code for handling IDX data frame
//

var SBW_scrolled = true

function SBW_initIDX() { // v1.1
 SBW_scrolled = false
}

function SBW_scrollIDX() { // v1.3
 if(!SBW_scrolled) {
   scroll(0,204);
   SBW_scrolled = true
 }
}

/* Calling scripts
<script type="text/javascript" src="SBW_Pre.js"></script>
<script type="text/javascript" for=showIDX event=onreadystatechange>SBW_scrollIDX()</script>
onload="SBW_initIDX()"
SBW_initIDX();
document.showIDX.onreadystatechange = SBW_scrollIDX();
*/
