function popWindow(url, width, height, win) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	if (win == undefined) win = "_blank";
	newwindow = window.open(url, win, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	if (window.focus) newwindow.focus();
}
function openWindow(url, win){
	if (win == undefined) win = "_blank";
	newwindow = window.open(url, win);
	if (window.focus) newwindow.focus();
}

function getURLVar(param) {
	var q = document.location.search || document.location.hash;
	if(q) {
		var pairs = q.substring(1).split("&");
		for (var i=0; i < pairs.length; i++) {
			if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
				return pairs[i].substring((pairs[i].indexOf("=")+1));
			}
		}
	}
	return "";
}