// Popup Functions

function getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location) {
	return window.open(url, name,"width=" + width + ",height=" + height + ", toolbar=" + toolbar + ",status=" + status + ",scrollbars=" + scrollbar + ",resizable=" + resizable + ",menubar=" + menubar + ",location=" + location);
}

function newWindow(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location) {
	getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location);
    return false;
}

function getNewWindowPositioned(url, name, xPos, yPos, width, height, toolbar, status, scrollbar, resizable) {
	newWin = getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable);
	newWin.moveTo(xPos, yPos);
	return newWin;
}

function newWindowPositioned(url, name, xPos, yPos, width, height, toolbar, status, scrollbar, resizable) {
    getNewWindowPositioned(url, name, xPos, yPos, width, height, toolbar, status, scrollbar, resizable);
    return false;
}

function getNewWindowCentered(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location) {
	if (width && (width > 0) 
		  && (height) 
		  && (height > 0)) {
		xPos = (screen.width - width) / 2;
		yPos = (screen.height - height) / 2;
		return getNewWindowPositioned(url, name, xPos, yPos, width, height, toolbar, status, scrollbar, resizable, menubar, location);
	} else  {
		return  getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location);
	}
}

function newWindowCentered(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location) {
    getNewWindowCentered(url, name, width, height, toolbar, status, scrollbar, resizable, menubar, location);
    return false;
}