function browserCheck()
{
        var b = navigator.appName;
        if (b=="Netscape") this.b = "ns";
        else if (b=="Microsoft Internet Explorer") this.b = "ie";
        else if (b=="Konqueror") this.b = "konqueror";
        else this.b = b;
        this.v = parseInt(navigator.appVersion);
        this.opera = (navigator.userAgent.indexOf('Opera')>0);
        if (this.opera) this.b = "opera";
        this.ns = (this.b=="ns" && this.v>=4);
        this.ns4 = (this.b=="ns" && this.v==4);
        this.ns5 = (this.b=="ns" && this.v==5);
        this.ie = (this.b=="ie" && this.v>=4);
        this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
        this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
        if (this.ie5) this.v = 5;
        this.konqueror = (this.b=="konqueror" && this.v>=4);
        this.k4 = (this.b=="konqueror" && this.v==4);
        this.k5 = (this.b=="konqueror" && this.v==5);
        this.min = (this.ns||this.ie);
}
is = new browserCheck();

function getRef(obj)
{
  return (typeof obj == "string") ? (is.ie ? document.all[obj] : document.getElementById(obj)) : obj;
}

function getScrollX()
{
  var x = window.pageXOffset ||
          document.body.scrollLeft ||
          document.documentElement.scrollLeft;

  return x ? x : 0;
}

function getScrollY()
{
  var x = window.pageYOffset ||
          document.body.scrollTop ||
          document.documentElement.scrollTop;

  return x ? x : 0;
}

function getClientWidth()
{
  var x = window.innerWidth ||
          document.documentElement.clientWidth ||
          document.body.clientWidth;

  return x ? x : 0;
}

function getClientHeight()
{
  var x = window.innerHeight ||
          document.documentElement.clientHeight ||
          document.body.clientHeight;


  return x ? x : 0;
}

function getScreenWidth()
{
   var x = screen.width ||
           java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;

   return x ? x : 0;
}

function getScreenHeight()
{
   var x = screen.height ||
           java.awt.Toolkit.getDefaultToolkit().getScreenSize().height;

   return x ? x : 0;
}

function setWidth(obj, x)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  obj.style ? obj.style.width = x + "px" : obj.width = x;
}

function setHeight(obj, x)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  obj.style ? obj.style.height = x + "px" : obj.height = x;
}

function setTop(obj, x)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  obj.style ? obj.style.top = x + "px" : obj.top = x;
}

function setLeft(obj, x)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  obj.style ? obj.style.left = x + "px" : obj.left = x;
}

function getWidth(obj)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  var x = obj.style?obj.style.width:obj.width;

  return x ? x : 0;
}

function getHeight(obj)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
  var x = obj.style?obj.style.height:obj.height;

  return x ? x : 0;
}

function getTop(obj)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
//  var x = obj.style?obj.style.top:obj.top;

	if (is.ie)
	{
		var x = 0;
		elt = obj;
		while (elt != null) {
			x += elt["offsetTop"];
			elt = elt.offsetParent;
		}
	}
	else var x = obj.offsetTop;

  return x ? x : 0;
}

function getLeft(obj)
{
  obj = (typeof obj == "string") ? getRef(obj) : obj;
//  var x = obj.style?obj.style.left:obj.left;
	if (is.ie)
	{
		var x = 0;
		elt = obj;
		while (elt != null) {
			x += elt["offsetLeft"];
			elt = elt.offsetParent;
		}
	}
	else var x = obj.offsetLeft;


  return x ? x : 0;
}

function setDisplay(obj, display_type)
{
	obj = (typeof obj == "string") ? getRef(obj) : obj;
	if((is.ie && 'none' != display_type) || ('undefined' == display_type || undefined == display_type)) display_type = 'block';
	obj.style.display = display_type;
}

function changeDisplay(obj, display_type)
{
	obj = (typeof obj == "string") ? getRef(obj) : obj;
	if((is.ie && 'none' != display_type) || ('undefined' == display_type || undefined == display_type)) display_type = 'block';
	(obj.style.display == 'none' || obj.style.display == '') ? obj.style.display = display_type : obj.style.display = 'none';
}

function getMouseX(e)
{
	if (!is.ie) document.captureEvents(Event.MOUSEMOVE);

	x = (is.ie) ? event.clientX + document.body.scrollLeft : e.pageX;

	return 0<x ? x : 0;
}
window.getMouseLeft = window.getMouseX;

function getMouseY(e)
{
	if (!is.ie) document.captureEvents(Event.MOUSEMOVE);

	x = (is.ie) ? event.clientY + document.body.scrollTop : e.pageY;

	return 0<x ? x : 0;
}
window.getMouseTop = window.getMouseY;
