function checkHireForm(f) {
	
	if(f.contact.value == "") {
		alert("Please tell me your name so I know who you are.");
		f.contact.focus();
		return false;
	}
	
	if(f.email.value == "") {
		alert("Please tell me your email address so I can reply to you.");
		f.email.focus();
		return false;
	}
	
	
	if(!checkEmail(f.email.value)) {
		alert("Please check your email address.");
		f.email.focus();
		return false;	
	}
	
	if(f.country.value == "") {
		alert("Please tell me which country you reside in.");
		f.country.focus();
		return false;
	}	
	
	if(f.job.value == "") {
		alert("Please describe the work you'd like me to do.");
		f.job.focus();
		return false;
	}	
	return true;
}

function checkContactForm(f)
{	
	if(f.contact.value == "") {
		alert("Please tell me your name so I know who you are.");
		f.contact.focus();
		return false;
	}
	
	if(f.email.value == "") {
		alert("Please tell me your email address so I can reply to you.");
		f.email.focus();
		return false;
	}
	
	
	if(!checkEmail(f.email.value)) {
		alert("Please check your email address.");
		f.email.focus();
		return false;	
	}
	
	if(f.message.value == "") {
		alert("Please tell me why you are contacting me.");
		f.message.focus();
		return false;
	}
		
	if(f.vercode.value == "") {
		alert("Please prove you are human.");
		f.vercode.focus();
		return false;
	}
	
	return true;
}

function refreshCaptcha(f) {
	document.captcha.src = document.captcha.src + '?' + (new Date()).getTime();
	f.vercode.value='';
	f.vercode.focus();
}

function checkEmail(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		return false
	 }

	 return true 					
}

