function addDOMLoadEvent(f){if(!window.__ADLE){var n=function(){if(arguments.callee.d)return;arguments.callee.d=true;if(window.__ADLET){clearInterval(window.__ADLET);window.__ADLET=null}for(var i=0;i<window.__ADLE.length;i++){window.__ADLE[i]()}window.__ADLE=null};if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,false);/*@cc_on @*//*@if (@_win32)document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");var s=document.getElementById("__ie_onload");s.onreadystatechange=function(){if(this.readyState=="complete")n()};/*@end @*/if(/WebKit/i.test(navigator.userAgent)){window.__ADLET=setInterval(function(){if(/loaded|complete/.test(document.readyState)){n()}},10)}window.onload=n;window.__ADLE=[]}window.__ADLE.push(f)}
if (!Array.prototype.push)
{Array.prototype.push=function(elem)
{this[this.length]=elem;}}
var EventManager=
{_registry:null,
Initialise:function()
{if (this._registry==null)
{this._registry=[];
EventManager.Add(window,"unload",this.CleanUp);}},
Add:function(obj,type,fn,useCapture)
{this.Initialise();
if (typeof obj=="string")
obj=document.getElementById(obj);
if (obj==null||fn==null)
return 0;
if (obj.addEventListener)
{obj.addEventListener(type,fn,useCapture);
this._registry.push({obj:obj,type:type,fn:fn,useCapture:useCapture});
return 1;}
if (obj.attachEvent&&obj.attachEvent("on"+type,fn))
{this._registry.push({obj:obj,type:type,fn:fn,useCapture:0});
return 1;}
return 0;},
CleanUp:function()
{for (var i=0;i<EventManager._registry.length;i++)
{with (EventManager._registry[i])
{if (obj.removeEventListener)
obj.removeEventListener(type,fn,useCapture);
else if (obj.detachEvent)
obj.detachEvent("on"+type,fn);}}
EventManager._registry=null;}};
