String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function checkEmpty(field, arg) {

if (arg.trim().length == 0) {

alert('Please enter a value for the ' + field);
return false;
}
return true;
}

function checkEntries() {

if (!(checkEmpty('Surname', document.forms[0].pincode.value)) || !(checkEmpty('Initials', document.forms[0].serial.value))) {
	alert('Please fill in both fields');
   return false;
}

return true;

}

