function verifyemail(email) {
	if (email=="" || email.indexOf("@")==-1 || email.indexOf(".")==-1){
		return false;
	}
	email = email.toLowerCase();
	NotAllowed = Array("..",".@","@.","@@"," ",";" , ",");
	Allowed = Array("_","-","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",".","@");
	for (Ji=0;Ji< NotAllowed.length;Ji++){
		if (email.indexOf(NotAllowed[Ji])!=-1){	// Finds a character which is not allowed
			return false;
			break;
		}
	}	// --- Check . or @ is present either at the start or at the end
	if (email.substr(0,1)=="." || email.substr(0,1)=="@" || email.lastIndexOf(".")==(email.length-1) || email.lastIndexOf("@")==(email.length-1)){
		return false;	
	}
	TT = email.substring(email.indexOf("@")+1);
	if (TT.indexOf(".")==-1){ // Check . is not present after @
		return false;
	}
	if (TT.indexOf("@")!=-1){	// there are more than 1 @s in the email
		return false;
	}
	//-------------- Verify Allowed Characters --------------
	var found=false;
	for (Ji=0;Ji< email.length;Ji++){
		found = false;
		for (Ki=0;Ki< Allowed.length;Ki++){
			if (email.substr(Ji,1)==Allowed[Ki]){
				found=true;
				break;
			}
		}
		if (found==false){
			return false;
		}
	}
	//--------- If All tests above are OK then return true
	return true;
}
function chkFields(){
	if (document.frm.ReName.value==''){
		alert('Please write recipient name');
		document.frm.ReName.focus();
		return false;
	}else if (document.frm.ReEmail.value==''){
		alert('Please write recipient email address ');
		document.frm.ReEmail.focus();
		return false;
	}else if (document.frm.Amount.value==''){
		alert('Please write Gift Amount');
		document.frm.Amount.focus();
		return false;
	}else if (isNaN(document.frm.Amount.value)){
		alert('Gift Amount should be a number.');
		document.frm.Amount.focus();
		return false;
	}else if (verifyemail(document.frm.ReEmail.value)==false){
		alert('The email address provided is not valid. Please write a valid email address');
		document.frm.ReEmail.focus();
		return false;
	} else {
		return true;
	}
		
}