
function checkMailForm(theForm){
	if (theForm.email.value.indexOf('@')<1){
		alert('You must enter an email address')
		theForm.email.value='';
		return false;
	}
	if(theForm.captcha.value == ""){
		alert("Please enter the characters in the image.");
		return false;
	}
	return true;
}

function toggleView(objIn){
	if (objIn.style.display == 'inline'){
		objIn.style.display = 'none'
	}else{
		objIn.style.display = 'inline'
	}
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height){
  if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function checkContactForm(theForm){
	if (theForm.Message.value==''){
		alert('You must enter a message')
		theForm.Message.value='';
		theForm.Message.focus();
		return false;
	}	
	if (theForm.Name.value==''){
		alert('You must enter your name')
		theForm.Name.value='';
		theForm.Name.focus();
		return false;
	}
	if (theForm.Email.value.indexOf('@')<1){
		alert('You must enter an email address')
		theForm.Email.value='';
		theForm.Email.focus();
		return false;
	}
	if(theForm.Captcha.value == ''){
		alert("Please enter the characters in the image.");
		theForm.Captcha.focus();
		return false;
	}
	return true;
}

function checkApplicationForm(theForm){
	if (theForm.Firstname.value==''){
		alert('You must enter your first name')
		theForm.Firstname.value='';
		theForm.Firstname.focus();
		return false;
	}	
	if (theForm.Lastname.value==''){
		alert('You must enter your last name')
		theForm.Lastname.value='';
		theForm.Lastname.focus();
		return false;
	}	
	if (theForm.Age.value==''){
		alert('You must enter your age')
		theForm.Age.value='';
		theForm.Age.focus();
		return false;
	}	
	if (theForm.Email.value.indexOf('@')<1){
		alert('You must enter an email address')
		theForm.Email.value='';
		theForm.Email.focus();
		return false;
	}
	if(theForm.Captcha.value == ''){
		alert("Please enter the characters in the image.");
		theForm.Captcha.focus();
		return false;
	}
	return true;
}
