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

function invasion_validate(thisform) {
	with (thisform) {
		if (yourName.value == "") {
			alert("Please fill in your first name.");
			return false
		}
		if (city.value == "") {
			alert("Please fill in your city.");	
			return false
		}
		if (schoolName.value == "") {
			alert("Please fill in your school name.");
			return false
		}
	}
}

function share_validate(thisform) {
	with (thisform) {
		if (yourname.value == "") {
			alert("Please fill in your name.");
			return false
		}
		if (friendname.value == "") {
			alert("Please fill in your friend\'s name.");	
			return false
		}
		if (validate_email(friendemail,"Please enter a valid email address.")==false){ 
			friendemail.focus();
			return false
		}
		
	}
}