		function NodeControl()
		{
			this["addNode"] = function(name){
							return document.createElement(name);
						};
			this["addText"] = function(content){
							return document.creatTextNode(content);
						};
			this["append"] = function(a,b){
								a.appendChild(b);
							};
			this["hasNode"] = function(node,name){
								var flag = false;
								if(node.getElementsByTagName(name).length != 0)
									flag = true;
								return flag;
							};
			this["getNodes"] = function(node,name){
								var childs = node.getElementsByTagName(name);
								return childs;
							};
		}
		function EventControl()
		{
			
			this["addEvent"] = function(obj,evtype,fn,useCapture) {
				if (obj.addEventListener) {
					obj.addEventListener(evtype,fn,useCapture);
				} else {
					obj.attachEvent("on"+evtype,function(){
						fn.call(obj);
					});
				}
			}
			this["delEvent"] = function(obj,evtype,fn,useCapture) {
				if (obj.removeEventListener) {
					obj.removeEventListener(evtype,fn,useCapture);
				} else {
					obj.detachEvent("on"+evtype,function(){
						fn.call(obj);
					});
				} 
			}
		}
		function $(id)
		{
			return "string" == typeof id ? document.getElementById(id) : id;
		}
		//a继承b
		function Extend(a,b){
			for(var pro in b)
				a[pro] = b[pro];
		}
		
		//ajax 类
		function ajax(opts){
			this.xhr = false;
			//默认值
			this.opts = {
				method : "get",//请求方式
				url : "",//请求地址
				asynch : true ,//是否异步
				callBack : function(xhr){},//用户的回调函数
				content : null,//send()方法的参数
				readyState : 4,//请求的状态,有5个可取值：0 = 未初始化，1 = 正在加载，2 = 已加载，3 = 交互中，4 = 完成
				status : 200 //服务器的HTTP状态码（200对应OK，404对应Not Found（未找到），等等）
			}
			//赋值
			Extend(this.opts,opts);
			/*创建XHR对象*/
			this.createXHR = function(){
				if(window.XMLHttpRequest)
					this.xhr = new XMLHttpRequest();
				else if(window.ActiveXObject)
					this.xhr = new ActiveXObject("Microsoft.XMLHTTP");
			};
			/*真正的回调函数*/
			this.realCall = function(){
				if(this.xhr == null)
					return;
				if(this.xhr.readyState == this.opts.readyState)
				{
					if(this.xhr.status == this.opts.status)
					{
						this.opts.callBack(this.xhr);
					}
				}
			};
			/*发送请求*/
			this.doRequest = function(){
				this.xhr.onreadystatechange = function(ajaxer){return function(){ return ajaxer.realCall();};}(this);
				this.xhr.open(this.opts.method,this.opts.url,this.opts.asynch);
if(this.opts.method.toLowerCase() == "post")
 this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
				this.xhr.send(this.opts.content);
			};
			this.createXHR();
			this.doRequest();
		}
	/**
		className 类名
		parentNode 在哪个节点下查询
		targetNode 要查询的节点名称
	*/
	function getElementsByClassName(className,parentNode,targetNode){
		//结果
		var result = [];
		if(!className) return result;
		if(!parentNode) parentNode = document;
		if(!targetNode) targetNode = "*";
		//如果浏览器支持...这个方法
		nodes = parentNode.getElementsByTagName(targetNode);
		for(var i=0;i<nodes.length;i++)
		{
			if(nodes[i].getAttribute("class") == className || nodes[i].getAttribute("className") == className)
				result.push(nodes[i]);
		}
		return result;
	}
