function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


function validate_form(thisform)
{

	with (thisform)
	{
	if (validate_email(sts_email,"Email must be filled out!")==false)
	  {
	  
	  thisform.sts_email.style.border="2px solid #FF8305";
	  /*document.getElementById('email_error').innerHTML="Please tell us your email!";*/
	  sts_email.focus();
	  return false;} 
	  else { 
	  thisform.sts_email.style.border="";
	  }

	  
	  if (validate_required(Name,"Name must be filled out!")==false)
	  {
	  thisform.Name.style.border="2px solid #FF8305";
/*		document.getElementById('Name_error').innerHTML="Please tell us your name!";*/
		Name.focus();return false;
	  }
		else 
	  { 
	  thisform.Name_error.innerHTML="*"; 
	  thisform.Name.style.border="";}
	  
	  
	}
}

function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  { return false;}
else {return true}
}
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {return false;}
else {return true;}
}
}
