String.prototype.trim = function() {
  return this.replace(/^\s+|\s+$/g,"");
}

function Error() {
  this.msg = "";
}

Error.prototype.add = function(msg) {
	this.msg += msg + "<br />";
}

Error.prototype.isset = function() {
    return(this.msg != "");
}

Error.prototype.show = function() {
	/*
    obj = document.getElementById('error_msg');
	obj.innerHTML = "ERROR<p>" + this.msg + "</p>";
	obj.className = 'show';
	*/
	msg = this.msg.replace(/<br \/>/g,'\r\n');
	alert("Error\r\n" + msg)
}

Error.prototype.hide = function() {
    obj = document.getElementById('error_msg');
	obj.className = 'hide';
}

function isempty(str) {
  return (!str.value.trim().length);
}
