<!--

function EventTools(evt)
{
	if (!evt || evt==undefined) this.evt = window.event;
	else this.evt=evt;
}

EventTools.prototype.getEvent=function()
{
	return this.evt;
}

EventTools.prototype.getTarget=function()
{
	if (this.evt.target) targ = this.evt.target;
	else if (this.evt.srcElement) targ = this.evt.srcElement;
	 if( targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
		
	return targ;
}

EventTools.prototype.getKeyCode=function()
{
	if (this.evt.keyCode) code = this.evt.keyCode;
	else if (this.evt.which) code = this.evt.which;
	
	return code;
}

EventTools.prototype.getChar=function()
{
	var chr=String.fromCharCode(this.getKeyCode());
	return chr;
}

EventTools.prototype.isNewLineChar=function()
{
	return (this.getChar()=="\r");
}

EventTools.prototype.isTabChar=function()
{
	return (this.getChar()=="\t");
}

EventTools.prototype.getType=function()
{
	return this.evt.type;
}

EventTools.prototype.getMouseX=function()
{
	if(this.evt.clientX) mouseX = (this.evt.clientX + document.body.scrollLeft);
	else mouseX = this.evt.pageX;
	
	return mouseX;
}

EventTools.prototype.getMouseY=function()
{
	if(this.evt.clientY) mouseY = (this.evt.clientY + document.body.scrollTop);
	else mouseY = this.evt.pageY;
	
	return mouseY;
}

EventTools.prototype.preventDefault=function()
{
	if (this.evt.preventDefault) 
			this.evt.preventDefault();
  else
    	this.evt.returnValue = false;
}


//alert("test();new RegExp;if babla,else lblo;New return".match(new RegExp("new|if|else|return","g")));

//-->
