function checkKeyword() {
	if (!searchkeyword.search.value) {
		alert('Please fill out the keyword field and try again.');
		return returnValue = false;
	} else {
		return returnValue = true;
	}
}
//
function sendFriend(id) {
	var where = 'friend.php?url='+document.location.href+'&id='+id;
	window.open(where,'friendsend','width=600,height=340');
}
//
function isEmpty() {
	field1 = document.friend_form.friend.value 
	field2 = document.friend_form.sender.value

  	if (field1 == "" || field1 == null || !isNaN(field1) || field1.charAt(0) == ' ') {
		alert("\"Name of Friend\" is a mandatory field.\r\nPlease try again.")
		return false;
    }

  	if (field2 == "" || field2 == null || field2.charAt(0) == ' ') {
		alert("\"Your Name\" is a mandatory field.\r\nPlease try again.")
		return false;
    }
	
    return true;
}
//
function isValidEmail() {
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,3}$/i;
	email1 = document.friend_form.friend_email.value;
	email2 = document.friend_form.sender_email.value;

   	if (email1.search(validRegExp) == -1) {
		alert('A valid e-mail address is required for your friend.\r\nPlease try again.');
		return false;
    }
	
	if (email2.search(validRegExp) == -1) {
		alert('A valid e-mail address is required for you.\r\nPlease try again.');
		return false;
    }
	
    return true; 
}
//
function checkForm() {
	if (isEmpty()) {
		if (isValidEmail()) {
			return true;
		}
	}
	
	return false;
}
//
function setText(param) {
	display = param;
}

//
function checkUpDel() {
	if(confirm('Are you sure you want to '+display+' this record?')) {
		return true;
	} else {
		return false;
	}
}

