<!-- Show/hide divs -->
<!-- From:  -->
/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

var cur_info;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_info) hideLayer(cur_info);
  showLayer(id);
  cur_info = id;
}

function showLayer(id) {
  var info = getElemRefs(id);
  if (info && info.css) info.css.visibility = "visible";
}

function hideLayer(id) {
  var info = getElemRefs(id);
  if (info && info.css) info.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

window.onload = function(e) {
  swapLayers('info1');
}
//-->


<!-- Original:  Jeff Harding (jbh@site-ations.com) -->
<!-- Web Site:  http://www.site-ations.com -->
<!-- Modified by:  Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Preload images
var empty = new Image(); empty.src = "fieldempty.gif";
var email = new Image(); email.src = "emailerror.gif";
var phone = new Image(); phone.src = "phoneerror.gif";

var haveerrors = 0;
function showImage(imagename, imageurl, errors) {
document[imagename].src = imageurl;
if (!haveerrors && errors) haveerrors = errors;
}

function validateForm(f) {
haveerrors = 0;
(f.tf100.value.length < 1) // validate first name length
? showImage("tf100error", "../img/site/fieldempty.gif", true)   // no semi-colon after this line!
: showImage("tf100error", "../img/site/blankimage.gif", false); // true = errors, false = no errors

(f.tf800.value.search("@") == -1 || f.tf800.value.search("[.*]") == -1) // validate email
? showImage("tf800error", "../img/site/emailerror.gif", true)
: showImage("tf800error", "../img/site/blankimage.gif", false);

(f.ta100.value.length < 1) // validate last name length
? showImage("ta100error", "../img/site/commentempty.gif", true)
: showImage("ta100error", "../img/site/blankimage.gif", false);

return (!haveerrors);
}
//  End -->