/********************************************************
 * 西门编写的操作的js类XAjax（Beat1.0）
 * 在ajax返回值中用到了回调函数，解决在页面中多次使用ajax加载问题
 * 完成时间：2008-02-28 9：47
 * 版权所有：AJAX中国
 * 网址：http://okajax.com
 * E-mail:westdoorking@163.com
 * 备注：您可以免费使用XAjax类，但是请不要删除版权信息。
 * 如果本类给您的网站造成bug，或者引起不良后果，作者不负任何责任。
 ********************************************************/
    XAjax = function(){
        var http_request = false;
        var result = "Author By ximen";
        this.init = function(){
            http_request = false;
            if (window.XMLHttpRequest) { // Mozilla, Safari,...
                http_request = new XMLHttpRequest();
            }
            else 
                if (window.ActiveXObject) { // IE
                    try {
                        http_request = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e) {
                        try {
                            http_request = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (e) {
							alert("Can't Creat AJAX Object!");
							return false;
                        }
                    }
                }
        }
        this.get = function(url, callback){
			this.init();
            http_request.onreadystatechange = function(){
                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
                        result = http_request.responseText;
                        try {
                            callback(result);
                        } 
                        catch (e) {
							alert("The CallBack Method Wrong!"+e);
							return false;
                        
                        }
                    }
                }
            };
            http_request.open('GET', url, true);
            http_request.send(null);
        }
    }