var currentImg = null;

var isIE;

function startup(){
	isIE = /MSIE/.test(navigator.userAgent);
}

function zoomimg(evt, $i, col, w){
	X = (evt.pageX ? evt.pageX : evt.clientX);
	Y = (evt.pageY ? evt.pageY : evt.clientY) + 10;
	if (col == 'm') 
		X = X - (w / 2);
	else 
		if (col == 'r') 
			X = X - w;
	var div = returnObjById('img-zoom');
	div.style.display = "";
	if (currentImg != $i) {
		div.innerHTML = "<img width=\"" + w + "\" src=\"" + $i + "\" onmouseover=\"hidezoom()\">";
		currentImg = $i;
	}
	div.style.left = X + 'px';
	// handle differently for IE
	if (isIE) {
		div.style.top = (document.documentElement.scrollTop + Y) + 'px';
	} else {
		div.style.top = Y + 'px';
	}
}

function hidezoom() {
	returnObjById('img-zoom').style.display = "none";
}

function showimg(img){
	window.open(img, '_blank','top=100, left=100, height=500, width=750, status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no');
}

function returnObjById(id) {
	if (document.getElementById)
		var returnVar = document.getElementById(id);
	else if (document.all)
		var returnVar = document.all[id];
	else if (document.layers)
		var returnVar = document.layers[id];
	return returnVar;
}
