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

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

function enlarge(which, e, position, imgwidth, imgheight){
    crossobj=document.getElementById("showimage");
    var horzpos=(ns6? pageXOffset : ietruebody().scrollLeft)+e.clientX+10;
    var vertpos=(ns6? pageYOffset : ietruebody().scrollTop)+e.clientY+10;
    
    crossobj.style.left=horzpos+"px";
    crossobj.style.top=vertpos+"px";
    crossobj.innerHTML="<img src='"+which+"' width='640' height='480'>";
    crossobj.style.visibility="visible";
    return false;
    
}

function closepreview(){
    crossobj.style.visibility="hidden"
}
function changeToJsMode(nom){
    var items = document.getElementsByTagName("img");
    for (var i = 0; i < items.length; i++){
	if (items[i].className != nom) continue;
	var it = items[i];
	if (ie){
	    it.onmouseover = function(){enlarge(this.src,event);};
	    it.onmouseout = function() { closepreview();};
	} else {
	    it.setAttribute("onMouseOver","return enlarge('"+it.src+"',event)");
	    it.setAttribute("onMouseOut","closepreview()");
	}
    }
}
function initializedrag(e){
    if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
	offsetx=ie2? event.clientX : e.clientX
	offsety=ie2? event.clientY : e.clientY
	
	tempx=parseInt(crossobj.style.left)
	tempy=parseInt(crossobj.style.top)
    }
}

document.onmousedown=initializedrag
