function openPopUp(page, w, h) {
	var height = h;
	var width = w;

	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	if (window.screen) {
	    	var ah = screen.availHeight - 30;
	    	var aw = screen.availWidth - 10;

	    	var xc = (aw - width) / 2;
	    	var yc = (ah - height) / 2;

	    	str += ",left=" + xc + ",screenX=" + xc;
	    	str += ",top=" + yc + ",screenY=" + yc;
	}
  	return window.open(page, "", str+",scrollbars=yes,resizable=yes");
}

function OpenPopup(page, w, h) {
	return openPopUp(page, w, h);
}

function OpenWithPopup(aElement, w, h) {
	if(aElement.href == null) return null;
	else {
		var page = aElement.href;
		//page = page.substring(page.lastIndexOf("/")+1);
		//page = "popup/"+page;

		OpenPopup(page, w, h);
		return false;
	}
}
