function getWindowHeight() {
	if (ie4) {var sSize = document.body.clientHeight; return sSize;}
	else if (ns6) {var sSize = window.innerHeight+5; return sSize;}
	else {var sSize = window.innerHeight; return sSize;}
	return;
}
function getWindowWidth() {
	if (ie4) {var sSize = document.body.clientWidth; return sSize;}
	else if (ns6) {var sSize = document.body.clientWidth; return sSize;}
	else {var sSize = window.innerWidth; return sSize;}
	return;      
}
function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}
function enlarge(which, e, position, imgwidth, imgheight){
	if (ie4||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		if (position=="center"){
			pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop);
			horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2;
			vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2;
			if (window.opera && window.innerHeight) //compensate for Opera toolbar
			vertpos=pgyoffset+window.innerHeight/2-imgheight/2;
			vertpos=Math.max(pgyoffset, vertpos);
		}
		else{
			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";

		if (mac){
			crossobj.innerHTML='<div align="left" valign="top" id="dragbar" style="cursor:hand;color:#000000;font-family:arial;font-size:8pt;background-color:#FFFFFF;min-width:'+imgwidth+'px;background-image:URL(images/mac_toolbar.jpg);">&nbsp;<a href="#" onClick="closepreview();"><img src="images/mac_close.gif" width="20" height="19" border="0"></a></div><img src="'+which+'">';
		}
		else if (ns6) {
			crossobj.innerHTML='<div align="right" valign="bottom" id="dragbar" style="cursor:hand;color:#000000;font-family:arial;font-size:8pt;background-color:#FFFFFF;min-width:'+imgwidth+'px;background-image:URL(images/ie_toolbar.jpg);"><a href="#" onClick="closepreview();"><img src="images/ie_close.gif" width="21" height="27" border="0"></a>&nbsp;&nbsp;</div><img src="'+which+'">';
		}
		else {
			crossobj.innerHTML='<div align="right" valign="bottom" id="dragbar" style="cursor:hand;color:#000000;font-family:arial;font-size:8pt;background-color:#FFFFFF;min-width:'+imgwidth+'px;background-image:URL(images/ie_toolbar.jpg);"><a href="#" onClick="closepreview();return false;"><img src="images/ie_close.gif" width="21" height="27" border="0"></a>&nbsp;&nbsp;</div><img src="'+which+'">';
		}

		crossobj.style.visibility="visible";
		return false;
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
	return true;
}
function closepreview(){
	crossobj.style.left="1 px";
	crossobj.style.top="1 px";
	crossobj.style.visibility="hidden";
}
function drag_drop(e){
	if (ie4&&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 (ie4&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
		offsetx=ie4? event.clientX : e.clientX;
		offsety=ie4? event.clientY : e.clientY;
		tempx=parseInt(crossobj.style.left);
		tempy=parseInt(crossobj.style.top);
		dragapproved=true;
		document.onmousemove=drag_drop;
	}
}
document.onmousedown=initializedrag;
document.onmouseup=new Function("dragapproved=false");