function echeck(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					
	}
	
function ValidateForm(){

	if ((document.fono_download.your_name.value==null)||(document.fono_download.your_name.value=="")){
		alert("Please enter a your name")
		document.fono_download.your_name.focus()
		return false
	}	
	if ((document.fono_download.your_email.value==null)||(document.fono_download.your_email.value=="")){
		alert("Please enter your email")
		document.fono_download.your_email.focus()
		return false
	}
	if (echeck(document.fono_download.your_email.value)==false){
		alert("Your email address is invalid")
		document.fono_download.your_email.value=""
		document.fono_download.your_email.focus()
		return false
	}
	if (document.fono_download.friend_email_1.value){
		if (echeck(document.fono_download.friend_email_1.value)==false){
			alert("Your 1st friends email is invalid")
			document.fono_download.friend_email_1.value=""
			document.fono_download.friend_email_1.focus()
			return false
		}
	}
	if (document.fono_download.friend_email_2.value){
		if (echeck(document.fono_download.friend_email_2.value)==false){
			alert("Your 2nd friends email is invalid")
			document.fono_download.friend_email_2.value=""
			document.fono_download.friend_email_2.focus()
			return false
		}
	}
	if (document.fono_download.friend_email_3.value){
		if (echeck(document.fono_download.friend_email_3.value)==false){
			alert("Your 3rd friends email is invalid")
			document.fono_download.friend_email_3.value=""
			document.fono_download.friend_email_3.focus()
			return false
		}
	}
	if (document.fono_download.friend_email_4.value){
		if (echeck(document.fono_download.friend_email_4.value)==false){
			alert("Your 4th friends email is invalid")
			document.fono_download.friend_email_4.value=""
			document.fono_download.friend_email_4.focus()
			return false
		}
	}
	if (document.fono_download.friend_email_5.value){
		if (echeck(document.fono_download.friend_email_5.value)==false){
			alert("Your 5th friends email is invalid")
			document.fono_download.friend_email_5.value=""
			document.fono_download.friend_email_5.focus()
			return false
		}
	}
	
	return true
 }

