﻿// JScript 文件

//获取浏览器的类型
        var Browser = new Object();
        Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined');
        Browser.isIE = window.ActiveXObject ? true : false;
        Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
        Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);


//根据不同浏览器取得不同的对象
        function getElement(aID)
        {
          return (document.getElementById) ? document.getElementById(aID): document.all[aID];
        }

 //创建XMLHTTP对象
        function makeRequest()
        {
            
        
            var http_request=false;
            if(window.XMLHttpRequest)//其他浏览器
            {
                
                 //Mozilla,Safari,...
                 http_request=new XMLHttpRequest();
                 if(http_request.overrideMimeType)
                 {
                     http_request.overrideMimeType('text/xml');
                 }
             }
             else if(window.ActiveXObject)//ie浏览器
             {
                //IE
                  try{
                         http_request=new ActiveXObject("Msxml2.XMLHTTP");
                         
                     }
                  catch(e)
                    {
                         try
                         {
                            http_request=new ActiveXObject("Microsoft.XMLHTTP");
                            
                         }
                         catch(e)
                         {
                         }
                     }
             }
             
             //如果创建对象失败
             if(!http_request){
                     alert('Giving up:(Cannot create an XMLHTTP instance)');
                     return false;
             }
             
            
            return http_request;
        }
        
        //取得url后面的参数
         function getQueryString(s)
			{
				var theurl=window.location.href;
				//alert(theurl);
				var index1=theurl.indexOf(s+"=");
				if(index1==-1) return "";
				//alert(index1);
				var index2=theurl.indexOf("&",index1);
				//alert(index2);
				if(index2==-1) index2=theurl.length;
				//alert(index1+s);
				return theurl.substring(index1+s.length+1,index2);
            }    

