﻿//<![CDATA[
function ViewOriginalImage(obj, strURL, intWidth, intHeight) {
	var intLeft = ((parseInt(document.documentElement.clientWidth, 10) - intWidth) / 2);
	if (intLeft < 0) intLeft = 0;

	var intTop = ((parseInt(document.documentElement.clientHeight, 10) - intHeight) / 2);
	intTop = (intTop < 0 ? 0 : intTop) + getTop();

	$("div.imageview").html(
		"<a href=\"javascript:;\" onclick=\"ViewImageHide();\"><img src=\"" + strURL + "\" alt=\"\" " + 
		"style=\"width:" + intWidth + "px;height:" + intHeight + "px;\" /></a>"
	);
	$("div.imageview")
		.css("position", "absolute")
		.css("top", parseInt(intTop, 10) + "px")
		.css("left", parseInt(intLeft, 10) + "px")
		.css("width", intWidth + "px")
		.css("height", intHeight + "px")
		.css("z-index", 100000)
		.fadeIn(100);
	return false;
}
function ViewImageHide() {
	$("div.imageview").fadeOut(100);
}
function getTop() {
	if (document.documentElement.scrollTop) {
		return document.documentElement.scrollTop;
	}
	else if (window.pageYOffset) {
		return window.pageYOffset;
	}
	else {
		return 0;
	}
}
function addImageViewDiv() {
	$(document.body)
		.append("<div class=\"imageview\" style=\"display:none;border:3px solid gray;\"></div>");
}
//]]>