		function Evt(evt) {
			this.evt = evt ? evt : window.event; 
			this.source = this.evt.target ? this.evt.target : this.evt.srcElement;
			this.x = this.evt.pageX ? this.evt.pageX : (this.evt.clientX+(document.documentElement.scrollLeft || document.body.scrollLeft));
  		this.y = this.evt.pageY ? this.evt.pageY : (this.evt.clientY+(document.documentElement.scrollTop || document.body.scrollTop));
      if(navigator && navigator.vendor && navigator.vendor.indexOf('Apple')==0){
        this.y=window.innerHeight-this.evt.pageY+document.body.scrollTop+16;
      }
		}
		
		Evt.prototype.toString = function () {
			return "Evt [ x = " + this.x + ", y = " + this.y + " ]";
		};
		
		Evt.prototype.consume = function () {
			if (this.evt.stopPropagation) {
				this.evt.stopPropagation();
				this.evt.preventDefault();
			} else if (this.evt.cancelBubble) {
				this.evt.cancelBubble = true;
				this.evt.returnValue  = false;
			}
		};
		
		Evt.addEventListener = function (target,type,func,bubbles) {
			if (document.addEventListener) {
				target.addEventListener(type,func,bubbles);
			} else if (document.attachEvent) {
				target.attachEvent("on"+type,func,bubbles);
			} else {
				target["on"+type] = func;
			}
		};
	
		Evt.removeEventListener = function (target,type,func,bubbles) {
			if (document.removeEventListener) {
				target.removeEventListener(type,func,bubbles);
			} else if (document.detachEvent) {
				target.detachEvent("on"+type,func,bubbles);
			} else {
				target["on"+type] = null;
			}
		};

   
var DHTML = {
   setOpacity:  function(node,val) {
      if(node.filters){
  			try {	node.style.filter="alpha(opacity="+(val*100)+")";	} catch (e) { }
      }else{        
        try { node.style.opacity = val;} catch (e) { }
        try { node.style.MozOpacity = val;} catch (e) { }
      }
		},
   setElementSize: function (elmt,w,h){
       elmt.style["width"]=w+"px";
       elmt.style["height"]=h+"px";       
       if(elmt.offsetWidth>0&&elmt.offsetWidth!=w){ elmt.style["width"]=(w-(elmt.offsetWidth-w))+"px"; }
       if(elmt.offsetHeight>0&&elmt.offsetHeight!=h){ elmt.style["height"]=(h-(elmt.offsetHeight-h))+"px"; }
    },

   getSelectedText: function(){ 
     if (window.getSelection) return window.getSelection(); 
     else if (document.getSelection) return document.getSelection();
     else if (document.selection) return document.selection.createRange().text;
     else return;
   }
    
};    

