// JavaScript Document
function validateForm(){
	var f = document.form2;
	var rgxObjE = /\w+.?\w+@\w+[.]\w+.?\w{1,4}/;
	
	if (!rgxObjE.test(f.email.value) && f.email.value != '')
	{
		alert(f.email.value + " is not a valid email address!");
		return false;
	} 
	
	f.sent.value = "1";
	f.submit();
	return true;
}

function toggleLayer( elem )
{
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display == '' && elem.offsetWidth != undefined && elem.offsetHeight != undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  
  vis.display = (vis.display =='' || vis.display == 'block' )? 'none' : 'block';
}

function swapLayers(a, b)
{
  var elem1, elem2;
  if( document.getElementById )// this is the way the standards work
  {
  	elem1 = document.getElementById( a );
	elem2 = document.getElementById( b );
  }
  else if( document.all ) // this is the way old msie versions work
  {	
    elem1 = document.all[a];
	elem2 = document.all[b];
  }
  else if( document.layers ) // this is the way nn4 works
  {	  
    elem1 = document.layers[a];
	elem2 = document.layers[b];
  }
  
  toggleLayer(elem1);
  toggleLayer(elem2); 	
}

