/**
 * common.js
 *
 * javascript common issues
 */

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/, '');
};
String.prototype.checkEmail = function() {
	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	return this.match(re);
}

function popup(url, w, h, full) {
	if (full == undefined) {
		full = true;
	}
	if (full) {
		var f = "width=" + w + ", height=" + h + ",status, toolbar, location, menubar, resizable, scrollbars";
	} else {
		var f = "width=" + w + ", height=" + h;
	}
	var w = window.open(url, 'w', f);
}