//attachEvent
if(!window.attachEvent && window.addEventListener){
	Window.prototype.attachEvent = HTMLDocument.prototype.attachEvent=
	HTMLElement.prototype.attachEvent=function(en, func, cancelBubble)
	{
		var cb = cancelBubble ? true : false;
		this.addEventListener(en.toLowerCase().substr(2), func, cb);
	};
}

//event
if(window.addEventListener){	
	HTMLElement.prototype.__defineGetter__("runtimeStyle", element_prototype_get_runtimeStyle);
	window.constructor.prototype.__defineGetter__("event", window_prototype_get_event);
	Event.prototype.__defineGetter__("srcElement",event_prototype_get_srcElement);
	//Event.prototype.__defineGetter__("keyCode",   event_prototype_get_keyCode);
}

function event_prototype_get_keyCode(){
	if(document.all) return window.event.keyCode;
	//return event.which;
}

function element_prototype_get_runtimeStyle(){	
	return this.style;
}

function window_prototype_get_event(){
	return SearchEvent();
}

function event_prototype_get_srcElement(){
	return this.target;
	//return document.activeElement;
}

function SearchEvent(){	
	if(document.all)//IE
		return window.event;

	func=SearchEvent.caller;
	while(func != null){
		var arg0=func.arguments[0];
		if(arg0){
			if(arg0.constructor == Event)
				return arg0;
		}
		func = func.caller;
	}
	return null;
}