var ns = false;
var ie = false;

if (document.layers) { ns = true; }
if (document.all) { ie = true; }

if (ie && ns) { ie = false; }

function createWindow(url, title, width, height, top, left, toolbar, status, scrollbars, resizeable) {
	var properties = "width=" + width + ",height=" + height +  ",top=" + top + ",left=" + left +  ",toolbar=" + toolbar + ",status=" + status + ",scrollbars=" + scrollbars + ",resizeable=" + resizeable; 
	if (ie) {
		properties = "width=" + width + ",height=" + height +  ",screenY=" + top + ",screenX=" + left +  ",toolbar=" + toolbar + ",status=" + status + ",scrollbars=" + scrollbars + ",resizeable=" + resizeable; 
	}
	createWindowWithProperties(url, title, properties);
}

function createCenteredWindow(url, title, width, height, toolbar, status, scrollbars, resizeable) {
	var left = screen.availWidth / 2 - width / 2;
	var top = screen.availHeight / 2 - height / 2;
	createWindow(url, title, width, height, top, left, toolbar, status, scrollbars, resizeable);
}

function createWindowWithProperties(url, title, properties) {
  window.open(url, title, properties);
}


function swapImage(imgID, newImgObj) {
	document.images[imgID].src = newImgObj.src;
}

