﻿function IndexAJAX(ClassId,HtmlId,Url)
{    
	   if(ClassId!="")
	   {	         
			$.ajax({
			 type: "GET",
			 url: Url+".asp",
			 data: "ClassId="+ClassId,
			 dataType: "html",
			 timeout: 20000,
			 success: function(data){
				 if(data!="") 
				 {
					// alert(data);
				   $("#"+HtmlId).html(data);
				 }
				 else
				 {
				   alert("请求没有成功,请联系管理员!"); 
				 }			 
			 
			 },
			 error: function(){
				//alert('对不起，服务器可能太忙，请稍后请求！')
			}  
			}); 
		}
		else
		{
		   $("#"+HtmlId).html("还没有数据!");
		}
}

//这个函数的作用是弹出一个新的窗口
function url(url)
{
totalx = screen.availWidth;
totaly = screen.availHeight;
x = totalx/2-700/2;
y = totaly/2-420/2;
window.open(url,"","toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,height=380,width=465,top="+y+",left="+x+"");
}


/*var XMLHttp = {
    _objPool: [],
    
    _getInstance: function ()
    {
        for (var i = 0; i < this._objPool.length; i ++)
        {
            if (this._objPool[i].readyState == 0 || this._objPool[i].readyState == 4)
            {
                return this._objPool[i];
            }
        }
        
        // IE5中不支持push方法
        this._objPool[this._objPool.length] = this._createObj();

        return this._objPool[this._objPool.length - 1];
    },

    _createObj: function ()
    {
        if (window.XMLHttpRequest)
        {
            var objXMLHttp = new XMLHttpRequest();

        }
        else
        {
            var MSXML = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
            for(var n = 0; n < MSXML.length; n ++)
            {
                try
                {
                    var objXMLHttp = new ActiveXObject(MSXML[n]);        
                    break;
                }
                catch(e)
                {
                }
            }
         }
        // mozilla某些版本没有readyState属?
        if (objXMLHttp.readyState == null)
        {
            objXMLHttp.readyState = 0;

            objXMLHttp.addEventListener("load", function ()
                {
                    objXMLHttp.readyState = 4;
                    
                    if (typeof objXMLHttp.onreadystatechange == "function")
                    {
                        objXMLHttp.onreadystatechange();
                    }
                },  false);
        }

        return objXMLHttp;
    },
    
    // ?发送请??方法[post,get], 地址, 数据, 回调函数)
    sendReq: function (method, url, data, callback)
    {
        var objXMLHttp = this._getInstance();

        with(objXMLHttp)
        {
            try
            {
                // 加随机数防止缓存
                if (url.indexOf("?") > 0)
                {
                    url += "&randnum=" + Math.random();
                }
                else
                {
                    url += "?randnum=" + Math.random();
                }
                open(method, url, true);
                //alert('ok2');
                // 设定请求编码方式
                setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
                send(data);
                onreadystatechange = function ()
                {
                    if (objXMLHttp.readyState == 4 && (objXMLHttp.status == 200 || objXMLHttp.status == 304))
                    {
                        callback(objXMLHttp);
                    }
                }
            }
            catch(e)
            {
                alert(e);
            }
        }
    }
};*/