function Utilites() {
	this.Find_Control = function(id) {
		if (document.getElementById)
			var returnVar = document.getElementById(id);
		else if (document.all)
			var returnVar = document.all[id];
		else if (document.layers)
			var returnVar = document.layers[id];
		return returnVar;
	}
	this.Find_ElementCoords = function(id) {
		var coords = {x: 0, y: 0};
		var obj = this.Find_Control(id);
		if (obj != null) {
			if (obj.offsetParent) {
				coords.x = obj.offsetLeft;
				coords.y = obj.offsetTop;
				while (obj = obj.offsetParent) {
					coords.x += obj.offsetLeft;
					coords.y += obj.offsetTop;
				}
			}
		}
		return coords;
	}
	this.Cursor_Position = function(evt) {
        evt = evt || window.event;
        var cursor = {x: 0, y: 0};
        if (evt.pageX || evt.pageY) {
            cursor.x = evt.pageX;
            cursor.y = evt.pageY;
        }
        else {
            cursor.x = evt.clientX +
                (document.documentElement.scrollLeft ||
                 document.body.scrollLeft) -
                 document.documentElement.clientLeft;
            cursor.y = evt.clientY +
                (document.documentElement.scrollTop ||
                 document.body.scrollTop) -
                 document.documentElement.clientTop;
        }
        return cursor;
    }
	this.Get_ElementSize = function(id) {
		var size = {width: 0, height: 0};
		var obj = this.Find_Control(id);
		if (obj != null) {
			if (document.layers) {
				size.width = obj.clip.width;
				size.height = obj.clip.height;
				return size;
			}
			else {
				if (navigator.userAgent.indexOf('Opera 5') != -1 ||
					navigator.userAgent.indexOf('Opera/5') != -1) {
					size.width = obj.style.pixelWidth;
					size.height = obj.style.pixelHeight;
					return size;
				}
				else {
					size.width = obj.offsetWidth;
					size.height = obj.offsetHeight;
				}
			}
		}
		return size;
	}
	this.Set_ElementStyle = function(id, attribute, value) {
		var obj = this.Find_Control(id);
		switch (attribute) {
			case "position": { obj.style.position = value; break; }
			case "visibility": { obj.style.visibility = value; break; }
			case "display": { obj.style.display = value; break; }
			case "left": { obj.style.left = value + "px"; break; }
			case "top": { obj.style.top = value + "px"; break; }
			case "height": { obj.style.height = value + "px"; break; }
			case "width": { obj.style.width = value + "px"; break; }
			case "top": { obj.style.top = value + "px"; break; }
			case "class": { obj.className = value; break; }
		}
	}
	this.Check_ElementStyleProperty = function(id, styleProperty) {
		var obj = this.Find_Control(id);
		if (obj.currentStyle)
			var styleValue = obj.currentStyle[styleProperty];
		else 
		if (window.getComputedStyle)
			var styleValue = document.defaultView.getComputedStyle(obj, null).getPropertyValue(styleProperty);
		return styleValue;
	}
	this.Check_ElementClass = function(id) {
	    var obj = this.Find_Control(id);
	    if (obj != null) {
	        return obj.className;
	    }
	    else {
	        return '';
	    }   
	}
}
var util = new Utilites();