psfm = {
    e:
        function(id) {
            return document.getElementById(id);
        }
    ,
    DISABLE:
        0
    ,
    ENABLE:
        1
    ,
    LOAD:
        "load"
    ,
    CLICK:
        "click"
    ,
    KEYDOWN:
        "keydown"
    ,
    KEYUP:
        "keyup"
    ,
    attachEvent:
        function(obj, type, func) {
            if (obj.addEventListener) {
                obj.addEventListener(type, func, false);
            } else if (obj.attachEvent) {
                obj.attachEvent('on' + type, func);
            } else {
                obj['on' + type] = func;
            }
        }
}

psfm.formUtil = {
	createHiddenField:
		function(name, value) {
			var e = document.createElement("INPUT");
			e.setAttribute('type','hidden');
			e.setAttribute('name',name); 
			e.setAttribute('value',value); 
			return e;
		}
    ,
	createDIV:
		function(name) {
			var e = document.createElement("DIV");
			e.setAttribute('id',name);
			e.setAttribute('name',name);
			return e;
		}
    ,
	createClickableIMG:
		function(name, src, func) {
			var e = document.createElement("IMG");
			e.setAttribute('id',name);
			e.setAttribute('name',name);
            e.setAttribute('src',src);
            e.setAttribute('onclick',func);
            //psfm.attachEvent(e, psfm.CLICK, func);
			return e;
		}
}

function psfmToolTip(id, left, top, width, height, imgSrc) {
    this.id = id;
    this.left = left;
    this.top = top;
    this.width = width;
    this.height = height;
    this.imgSrc = imgSrc;
}

psfm.toolTip = {
    build:
        function(obj){
            var e = psfm.formUtil.createDIV(obj.id);
            e.style.left = obj.left + "px";
            e.style.top = obj.top + "px";
            e.style.width = obj.width + "px";
            e.style.height = obj.height + "px";
            e.style.backgroundImage = "url(" + obj.imgSrc + ")";
            e.style.position = 'absolute';
	        e.style.zIndex = 1000;
            document.body.appendChild(e);
            return e;
        }
}