function popImg(src)
{
	var html = "";
			html+= "<html>";
			html+= "<head>";
			html+= "<script>";
			html+= "function resizePopWin(nest_object){"
					+  "var body_margin = 32;"
					+	 "var scroll_bar = 0;"
					+	 "var title_bar = 25;"
					+	 "var form_space = 0;"
					//	+	 "var scale = 1;"	scale = height/width;
					+	 "var additional_range = 100;"
					+	 "var window_width = nest_object.clientWidth + body_margin + scroll_bar;"
					+	 "var content_height = nest_object.clientHeight + body_margin + form_space + title_bar;"
					+	 "var window_height = Math.min(content_height, screen.height);"
					+	 "if (window_height == Math.abs(window_height - content_height) < additional_range && content_height < screen.height - additional_range){"
					+	 "	window_height = content_height;"
					+	 "}"
					+	 "if (window_height < content_height){"
					+	 "	document.body.scroll = 'auto';"
					+	 "}else{"
					+	 "	document.body.scroll = 'no';"
					+	 "}"
					+	 "window.resizeTo(window_width, window_height);"
					+	 "var x = (screen.width) ? (screen.width - window_width) / 2 : 100;"
					+	 "var y = (screen.height) ? (screen.height - window_height) / 2 : 100;"
					+	 "window.moveTo(x, y);"
					+	 "}";
			
			html+= "<\/script>";
			html+= "</head>";
			html+= "<body bgcolor=\"#FFFFFF\"  text=\"#000000\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\" marginheight=\"10\">";
			html+= "<a href=\"javascript:window.close();\"><img  id=\"popup_content\" src=\"" + src + "\" border=\"0\" onload=\"resizePopWin(this)\" alt=\"Close\"></a>";
			html+= "</body>";
			html+= "</html>";
	
	popWin("", 440, 440, "popImgWin", 0, html);
}

function popWin(url, width, height, windowName, scrollbar, content){
	var x = (screen.width) ? (screen.width-width) / 2 : 100;
	var y = (screen.height) ? (screen.height-height) / 2 : 100;

	var features = "width=" + width + "px, height=" + height + "px, top=" + y + "px, left=" + x + "px";
		features += (scrollbar) ? ", scrollbars=no" : "";
		features += ", resizable=no";
	if (!windowName){
		windowName = "untitled";
	}
	var popWindow = window.open(url, windowName, features);

	if (popWin.arguments.length == 6 && content != ""){
		popWindow.document.write(content);
	}
	if (document.layers){
		window.moveTo(x, y);
	}
	popWindow.focus();
}

