<!--

//  Enlarge Image Function
//  Displays full-size gallery image in floating DIV

var ie = document.all;
var ns6 = document.getElementById && !document.all;

function ietruebody() {
	return (document.compatMode && document.compatMode != "BackCompat" && !window.opera) ? document.documentElement : document.body;
}

function enlargeImg(file, e, caption) {
	if (ie || ns6) {
		crossobj = document.getElementById ? document.getElementById("imgViewer") : document.all.imgViewer;

		var horzpos = ns6 ? (pageXOffset + e.clientX) : (ietruebody().scrollLeft + event.clientX);
		var vertpos = ns6 ? (pageYOffset + e.clientY) : (ietruebody().scrollTop + event.clientY);

		crossobj.style.left = horzpos + "px";
		crossobj.style.top = vertpos + "px";

		var HTML = '<DIV ID="imgDragBar" ALIGN="right"><SPAN ID="imgDragBarText" ONCLICK="closeImg()">Close</SPAN></DIV><IMG SRC="' + file + '" BORDER="0">';
		if (caption) HTML += '<DIV ID="imgCaption" ALIGN="left"><SPAN ID="imgCaptionText">' + caption + '</SPAN></DIV>';

		crossobj.innerHTML = HTML;
		crossobj.style.visibility = "visible";
		return false;
	}
	else {
		alert("Passion for Precision\n\nPlease update your browser to the latest version\nof Microsoft Internet Explorer or Mozilla Firefox.");
		return false;
	}
}

function closeImg() {
	crossobj.style.visibility = "hidden";
}

function dragDrop(e) {
	if (ie && dragApproved) {
		crossobj.style.left = tempx + event.clientX - offsetx + "px";
		crossobj.style.top = tempy + event.clientY - offsety + "px";
	}
	else if (ns6 && dragApproved) {
		crossobj.style.left = tempx + e.clientX - offsetx + "px";
		crossobj.style.top = tempy + e.clientY - offsety + "px";
	}
	return false;
}

function initializeDrag(e) {
	if (ie && event.srcElement.id == "imgDragBar" || ns6 && e.target.id == "imgDragBar") {
		offsetx = ie ? event.clientX : e.clientX;
		offsety = ie ? event.clientY : e.clientY;

		tempx = parseInt(crossobj.style.left);
		tempy = parseInt(crossobj.style.top);

		dragApproved = true;
		document.onmousemove = dragDrop;
	}
}

document.onmousedown = initializeDrag;
document.onmouseup = new Function("dragApproved = false");


//-->