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 enlarge2(e, elementId){
    if (ie||ns6){
        crossobj=document.getElementById? document.getElementById(elementId) : document.all(elementId)
        var horzpos=ns6? pageXOffset+e.clientX-170 : ietruebody().scrollLeft+event.clientX-170
        var vertpos=ns6? pageYOffset+e.clientY+10 : ietruebody().scrollTop+event.clientY+10

		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"

		if (crossobj.style.visibility!="visible"){
  	 		crossobj.style.background="#FFFFFF";
    		crossobj.style.visibility="visible"
		}

	    return false
    }
    else //if NOT IE 4+ or NS 6+, simply display image in full browser window
    return true
}
function enlarge3(e, elementId){
    if (ie||ns6){
        crossobj=document.getElementById? document.getElementById(elementId) : document.all(elementId)
        var horzpos=ns6? pageXOffset+e.clientX-300 : ietruebody().scrollLeft+event.clientX-300
        var vertpos=ns6? pageYOffset+e.clientY-765 : ietruebody().scrollTop+event.clientY-765

		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"

		if (crossobj.style.visibility!="visible"){
  	 		crossobj.style.background="#FFFFFF";
    		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.visibility="hidden"
}

function drag_drop(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=="dragbar"||ns6&&e.target.id=="dragbar"){
		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=drag_drop
	}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
