function scrollBody()
{
	return document.documentElement.scrollTop || document.body.scrollTop;
}

var flagDel = false;
function ImgUP(url, width, height)
{
	if(!document.getElementById('this_div_for_img_up'))
	{
	  var d = document.createElement("DIV")
	  d.id = "this_div_for_img_up";
	  d.style.position = "absolute";
	  d.style.zIndex = "200";
    var w1 = w()
    var h1 = h()
    ww = w1 - mousex;
    if(ww > mousex) d.style.left = mousex + "px";
      else d.style.left = (mousex - width) + "px";
    hh = h1 - (mousey - scrollBody());
    if(hh > (mousey - scrollBody())) d.style.top = mousey + "px";
      else d.style.top = (mousey - height) + "px";
	  var i = document.createElement('img');
	  i.src = url;
	  d.appendChild(i)
	  document.body.appendChild(d)
	}
	flagDel = false;
}

function DelImgUP()
{
		flagDel = true;
		setTimeout("DelImgUP2()", 200);
}

function DelImgUP2()
{
	if(flagDel && document.getElementById('this_div_for_img_up'))
	{
	var d = document.getElementById("this_div_for_img_up");
	while(d.firstChild)d.removeChild(d.firstChild);
	d.parentNode.removeChild(d)
	}
	else flagDel = false;
}

var mousex = 0;
var mousey = 0;

isDOM       = document.getElementById
isOpera     = isOpera5 = window.opera && isDOM
isOpera6    = isOpera && window.print
isOpera7    = isOpera && document.readyState
isMSIE      = document.all && document.all.item && !isOpera 
isMSIE5     = isDOM && isMSIE
isNetscape4 = document.layers
isMozilla   = isDOM && navigator.appName == "Netscape"
if(isNetscape4) document.captureEvents(Event.MOUSEMOVE);

function h()
{
    var ie = ( navigator.appName.indexOf( "Microsoft Internet Explorer" ) == -1 ) ? false : true;
    if ( !ie ) {
        dHeight = document.body.scrollHeight;
        wHeight = window.innerHeight;
    } else {
        dHeight = document.body.clientHeight;
        wHeight = document.documentElement.clientHeight;
    }
   nuheight = Math.max( dHeight,wHeight );
   return nuheight;
} 
function w()
{
    var ie = ( navigator.appName.indexOf( "Microsoft Internet Explorer" ) == -1 ) ? false : true;
    if ( !ie ) {
        dHeight = document.body.scrollWidth;
        wHeight = window.innerWidth
    } else {
        dHeight = document.body.clientWidth;
        wHeight = document.documentElement.clientWidth;
    }
   nuheight = Math.max( dHeight,wHeight );
   return nuheight;
} 
if(isMSIE || isOpera7)
{
	document.onmousemove = function()
	{
		mousex = event.clientX + document.body.scrollLeft;
		mousey = event.clientY + scrollBody();
	}
}
else if (isOpera)
	{
		document.onmousemove = function()
		{
			mousex = event.clientX;
			mousey = event.clientY;
		}
	}
else if (isNetscape4 || isMozilla)
{
	document.onmousemove = function(e)
	{
		mousex = e.pageX; 
		mousey = e.pageY;
	}
}