// DIGERATI\ GmbH. All rights reserved.
// $Id: window.js,v 1.1 2003/02/14 17:36:05 renek Exp $
// Standard window functions.

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


function newWindow(url, name, width, height, toolbar, status, scrollbar, resizable) {
	getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable);
    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) {
	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);
	} else  {
		return  getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable);
	}
}

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

function getNewWindowRandomized(url, name, width, height, toolbar, status, scrollbar, resizable) {
	if (width && (width > 0) 
		  && (height) 
		  && (height > 0)) {
		xMax = screen.width - width;
		yMax = screen.height - height;
		xPos = Math.round((Math.random() * xMax));
		yPos = Math.round((Math.random() * yMax));
		return getNewWindowPositioned(url, name, xPos, yPos, width, height, toolbar, status, scrollbar, resizable);
	} else  {
		return  getNewWindow(url, name, width, height, toolbar, status, scrollbar, resizable);
	}
}

function newWindowRandomized(url, name, width, height, toolbar, status, scrollbar, resizable) {
    getNewWindowRandomized(url, name, width, height, toolbar, status, scrollbar, resizable);
    return false;
}

function getNewWindowKiosk(url, name) {
	return window.open(url,name,'fullscreen=yes, width=' + screen.width + ',height=' + screen.height);
}

function newWindowKiosk(url, name) {
	getNewWindowKiosk(url, name);
	return false;
}

function getNewWindowKioskRelocated(url, name, xPos, yPos, width, height) {
	newWin = getNewWindowKiosk(url, name);
	if ((width) && (width > 0)
		&& (height)
		&& (height > 0)) {
		newWin.resizeTo(width, height);
	}
	newWin.moveTo(xPos, yPos);
    return newWin;
}

function newWindowKioskRelocated(url, name, xPos, yPos, width, height) {
    getNewWindowKioskRelocated(url, name, xPos, yPos, width, height);
    return false;
}





