		
		(function (){
			if( !window.ADS ) window.ADS = {};
			var v = 'v' == '\v' ? 'ie' : 'w3c';
			function readyDom(){ 
				// 构造函数 
			}	
			readyDom.prototype = {
				t1 : false,
				t2 : true,
				arr : [],
				loading : function (func){
					// t 判断延迟后的加载
					if(!this.t1){
						if(this.t2){
							// 判断页面是否加载完成 只有没加载完成才运行加载方法
							// 只加载一次
							this.ready();
							this.t2 = false;
						}
						// 其他方法插入到数组里直接加载
						this.arr.push(func);					
					}else{
						// 如果页面加载完成 其他调用 直接运行
						func();
					}
				},
				state : function (_this){
					if(window.attachEvent){
						_this.method(_this);
					}else{
						return function (){
							_this.method(_this);
						} 
					}
				},
				method : function o(_this){
					_this.t1 = true;
					for(var i=0; i<_this.arr.length; i++){
						_this.arr[i]();
					}
				},
				ready : function (){
					if(!window.ActiveXObject){
						document.addEventListener('DOMContentLoaded',this.state(this),false);
					}else{
						try{
							readyDom.id ? clearTimeout(readyDom.id) : '';
							document.body.doScroll('left');
						}catch(e){
							readyDom.id = setTimeout((function (_this){
								return function (){
									 _this.ready();
								}
							})(this),10);
							return false;
						}
						this.state(this);
					}					
				}		
			}
			var oo = new readyDom();
			window['ADS']['loading'] = function (func){
				oo.loading(func);
			}
		})();

		(function (){
			/*if(!window.ADS) window.ADS = {};
			function loading(func){
				if( typeof func != 'function' ) return false;
				if( window.attachEvent ) window.attachEvent( "onload" , func );
				else window.addEventListener( "load" , func ,false );
			}
			window['ADS']['loading'] = loading;*/
			function $(id) {
				if(!document.getElementById(id)) return false;
				else return document.getElementById(id);
			}		
			window['ADS']['$'] = $;
			
			function addEvent( node , type , fn ){
				if( node.nodeType != 1 && node != document ) return false;
				if( node.attachEvent ){
					node['e' + type + fn] = fn;
					node[type + fn] = function (){
						node['e' + type + fn](window.event); 
						return false;
					}
					node.attachEvent( 'on' + type , node[type + fn] );
				} else {
					node.addEventListener( type , fn , false );
				}
			}
			window['ADS']['addEvent'] = addEvent;
			
			function removeEvent( node , type , listener ) {
				if(node.nodeType != 1){ return false; }
				if(node.removeEventListener){
					node.removeEventListener(type , listener ,false);
				}else if(node.detachEvent) {
					node.detachEvent("on" + type , listener);
				}
			}
			window['ADS']['removeEvent'] = removeEvent;
			
			function $$( tag , parent ){
				if(parent){ 
					if(parent.getElementsByTagName(tag)[0])
						return parent.getElementsByTagName(tag);
				}else if(document.getElementsByTagName(tag)[0])
					return document.getElementsByTagName(tag);
				else return false;
			}
			window['ADS']['$$'] = $$;
			
			function stopPropagation( e ){
				e = getEventObject(e);
				if(e.stopPropagetion){
					e.stopPropagetion();
				} else {
					e.cancelBubble = true;
				}
			}
			window['ADS']['stopPropagation'] = stopPropagation;
			
			function preventDefault( e ){
				e = getEventObject( e );
				if( e.preventDefault ){
					e.preventDefault();
				} else {
					return false;
				}
			}
			window['ADS']['preventDefault'] = preventDefault;
			
			function addClassName(node , newClassName){
				if(node.nodeType == 1 && typeof newClassName == 'string')
					node.className += ' ' + newClassName;				
			}
			window['ADS']['addClassName'] = addClassName;
		})();
