/**
 *	The common scripts
 *
 */


// Removes spaces at the beginning and at the end of a string  	
function trim(sString) {
	while (sString.substring(0, 1) == ' ') {
		sString = sString.substring(1, sString.length);
	}
	
	while (sString.substring(sString.length-1, sString.length) == ' ') {
		sString = sString.substring(0, sString.length-1);
	}
	
	return sString;
}


// Checks if a field is empty or has only spaces
function isEmptyField(id) {
	var field = document.getElementById(id);
	
	if (trim(field.value) == '') {
		return true;
	}
	else {
		return false;
	}
}
