function newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status) {
	var dw=50;
	var dh=60;
	
	var posx;
	var posy;
	
	switch (winLoc) {
		case "center":
			posx = (screen.width - w - dw)/2;
			posy = (screen.height - h - dh)/2;
			break;
		case "lowright":
			posx = screen.width - w - dw;
			posy = screen.height - h - dh;
			break;
		case "upright":
			posx = screen.width - w - dw;
			posy = 0;
			break;
		case "lowleft":
			posx = 0;
			posy = screen.height - h - dh;
			break;
		default: // "upleft"
			posx = 0;
			posy = 0;
			break;
	}
		
	// Set window properties
	var sWindowprops = "height=" + h + ",width=" + w + ",left=" + posx + ",screenx=" + posx + ",top=" + posy
	+ ",screeny=" + posy + ",scrollbars=" + scroll + ",menubar=" + menu + ",toolbar=" + tool + ",resizable=" + resize + ",location=" + address + ",status=" + status;
	
	// Open new window
	var myWindow=window.open(page, target, sWindowprops);
	myWindow.opener= window;
	myWindow.focus();
	return false;
}

function imageWindow(page,target,winLoc) {
	var w = 1000;
	var h = 800;
	var scroll = 'yes';
	var menu = 'yes';
	var tool = 'no';
	var resize = 'no';
	var address = 'no';
	var status = 'no';
	newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status);
}

function videoWindow(page,target,winLoc) {
	var w = 1000;
	var h = 500;
	var scroll = 'yes';
	var menu = 'yes';
	var tool = 'no';
	var resize = 'no';
	var address = 'no';
	var status = 'no';
	newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status);
}

function progressWindow(page,target,winLoc) {
	var w = 520;
	var h = 180;
	var scroll = 'no';
	var menu = 'no';
	var tool = 'no';
	var resize = 'no';
	var address = 'no';
	var status = 'no';
	newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status);
}

function popWindow(page,target,winLoc) {
	var w = 1000;
	var h = 450;
	var scroll = 'yes';
	var menu = 'no';
	var tool = 'no';
	var resize = 'yes';
	var address = 'no';
	var status = 'no';
	newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status);
}
function popWindow2(page,target,winLoc) {
	var w = 1000;
	var h = 600;
	var scroll = 'yes';
	var menu = 'no';
	var tool = 'no';
	var resize = 'yes';
	var address = 'no';
	var status = 'no';
	newWindow(page,target,winLoc,w,h,scroll,menu,tool,resize,address,status);
}