<!--

function openW(urlW, width_w, height_w, scroll_bar) {
	center_x = Math.round((window.screen.availWidth - width_w) / 2);
	center_y = Math.round((window.screen.availHeight - height_w) / 2);
	window.open(urlW,'_blank','top=' + center_y + ',left=' + center_x + ',width=' + width_w + ',height=' + height_w + ',status=no,titlebar=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,scrollbars=' + scroll_bar);
}

function popupWindow(name, url, imgWidth, imgHeight, options) {
	var winWidth 		= 100;
	var winHeight 		= 100;
	var screenHeight 	= screen.availHeight;
	var screenWidth		= screen.availWidth;

	if (imgWidth>screenWidth)		winWidth = screenWidth; else winWidth = imgWidth;
	if (imgHeight>screenHeight)		winHeight = screenHeight; else winHeight = imgHeight;

	var params = "width=" + winWidth + ", height=" + winHeight;
	params += options ? ", " + options.join(",") : "";
	var popup = window.open(url, name, params);
	return popup;
}
function documentWindow(name, content, width, height, scroll) {
	var options = [];
	options.push("scrollbars=" + (scroll ? "yes" : "no"));
	var popup = popupWindow(name, "", width, height, options);
	popup.document.open();
	popup.document.write(content);
	popup.document.close();
	popup.focus();
}
function imageWindow(title, src, width, height, alt)
{
	width = width;
	height = height;
	var name = 'img';
	var html = "<html>";
	html += "<head><title>" + title + "</title></head><body style=\"margin:0px\">";
	html += "<a href=\"javascript:close()\"><img src=\"" + src + "\" border=\"0\" alt=\"" + (alt != undefined ? alt : '') + "\"></a>";
	html += "</body></html>";
	documentWindow(name, html, width, height, false);
}

//-->

