function centerWindow(windowWidth, windowHeight) {
	var x = 0;
	var y = 0;
	switch (navigator.appName) {
		case "Microsoft Internet Explorer" :
			x = ((window.screen.availWidth/2 - windowWidth/2) > 0)? (window.screen.availWidth/2 -  windowWidth/2) : 0;
			y = ((window.screen.availHeight/2 - windowHeight/2) > 0)? (window.screen.availHeight/2 - windowHeight/2) : 0;
		break;
		case "Opera" :
			var dopX = (window.screen.availWidth - window.document.body.offsetWidth)/2;
			var dopY = (window.screen.availHeight - window.document.body.offsetHeight)/2;
			
			x = ((window.screen.availWidth/2 - windowWidth/2 - dopX) > 0)? (window.screen.availWidth/2 -  windowWidth/2 - dopX) : 0;
			y = ((window.screen.availHeight/2 - windowHeight/2 - dopY) > 0)? (window.screen.availHeight/2 - windowHeight/2 - dopY) : 0;
		break;
	}

	var str = "resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + windowWidth +", height=" + windowHeight + ", top=" + y + ", left=" + x;
	return str;
}


function PupUpWindow(filename, width, height) {
	var wnd_h = window.open(filename, 'PopUpWindow', centerWindow(width,height)+',status=yes,scrollbars=yes');
	wnd_h.focus();
}

function pupUpImageWindow(filename, width, height) {
	var wnd_h = window.open(filename, 'PopUpWindow', centerWindow(width,height)+',status=no,scrollbars=no');
	wnd_h.focus();
}