
var halfX;
var halfY;
var fullX;
var fullY;


function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function initial() {
	IE = document.all ? true : false;
	fox = new RegExp("Firefox","i");
	chrome = new RegExp("Chrome","i");
	safari = new RegExp("Safari","i");
	opera = new RegExp("Opera","i");
	if (IE) {
		fullX = document.body.clientWidth;
		fullY = getWindowHeight();
	}
	else if (fox.test(navigator.userAgent) || chrome.test(navigator.userAgent) || safari.test(navigator.userAgent) || opera.test(navigator.userAgent)) {
		fullX = document.body.clientWidth;
		fullY = getWindowHeight();
	}
	else {
		fullX = pageXOffset;
		fullY = pageYOffset;
	}
	halfX = Math.floor(fullX / 2);
	halfY = fullY / 2;
}
initial();

var b = document.getElementById("bcontent");
var lastObj;
if (b) {
	b.innerHTML += "<div id=\"cpop\" style=\"position:absolute; left:0px; top:0px\"></div>";
	var cp = document.getElementById("cpop");
	arrA = b.getElementsByTagName("img");
	for (i = 0;i < arrA.length;i++) {
		obj = arrA[i];
		var objst = new Image();
		objst.p = obj;
		objst.onload = function() {
			if (this.width > 350) {
				this.p.width = 350;
				this.p.p = this;
				this.p.height = Math.floor(this.height * 350 / this.width);
				this.p.onmouseover = showLP;
			}
		}
		objst.src = obj.src;
	}
	arrT = b.getElementsByTagName("table");
	for (i = 0;i < arrT.length;i++) {
		obj = arrT[i];
		if (obj.width > 330) obj.width = 330;
		if (parseInt(obj.style.width) > 330) obj.style.width = "330px";
	}
}
function showLP() {
	if (cp.p == this) return;
	cp.p = this;
	cp.innerHTML = "<img src=\"" + this.src + "\" />";
	cp.style.left = (halfX - (this.p.width / 2)) + "px";
	scrollY = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : window.pageYOffset;
	ypos = scrollY + (halfY - (this.p.height / 2));
	if (ypos < scrollY) ypos = scrollY;
	cp.style.top = ypos + "px";
	this.onmouseover = "";
	//this.onmouseout = hideLP;
	cp.onmouseout = hideLP;
	lastObj = this;
}
function hideLP() {
	cp.innerHTML = "";
	cp.style.top = "-5000px";
	cp.p = null;
	cp.onmouseout = "";
	lastObj.onmouseout = "";
	lastObj.onmouseover = showLP;
}

