function HttpAjax() { 
    var self = this;    
    this.createXMLHttpRequest = function() {
	    try { 
		    return new ActiveXObject("Msxml2.XMLHTTP"); 
	    } 
	    catch (e) {
	    }
	    try { 
		    return new ActiveXObject("Microsoft.XMLHTTP"); 
	    } 
	    catch (e) {
	    }
	    try {
		    return new XMLHttpRequest(); 
	    } 
	    catch(e) {
	    }
	    return null;
    }
    this.toString = function() {
        return "BoDao.Web.HttpAjax";
    }
    
    this.create = function(url, callbackHandler, onErrorHandler) {
        var xmlReq = this.createXMLHttpRequest();
        if (xmlReq != null) {        
		    xmlReq.open("GET", url, true);
		    xmlReq.onreadystatechange = function() {
                switch(xmlReq.readyState)
                {
                    case 0: 
                        break;
                    case 1: 
                        break;
                    case 2: 
                        break;
                    case 3: 
                        break;
                    case 4: 
                        callbackHandler(xmlReq);
                        break;
                    default:
                        onErrorHandler();
                        break;
                    }
                }
		    xmlReq.send(null);
		    return xmlReq;
        }
        else {
			throw "System does not support Ajax.";
        }
    }
    this.setVisible = function(controlId, visible) {
        if (document.getElementById(controlId) != null)
            document.getElementById(controlId).style.visibility = (visible ? "visible" : "hidden");
    }
	this.setDisplay = function(controlId, displayMode) {
        if (document.getElementById(controlId) != null)
            document.getElementById(controlId).style.display = displayMode;
	}
    this.updateContent = function (url, controlId) {
      var processingIcon;
      var _controlContent=document.getElementById(controlId);
      if( _controlContent!=null){
         _controlContent.innerHTML="<img src=\"../../IMS_Img/Index/Loading.gif\"/>";
      }		
        var xmlReq = this.createXMLHttpRequest();
        
        if (xmlReq != null) {
		    xmlReq.open("GET", url, true);
		    xmlReq.onreadystatechange = function() {
                switch(xmlReq.readyState)
                {
                    case 0: 
                        break;
                    case 1: 
                        break;
                    case 2: 
                        break;
                    case 3: 
                        break;
                    case 4: 
                        updateContent_callback(xmlReq, controlId);
                        break;
                    default:
                        updateContent_onError(controlId);
                        break;
                    }
                }
		    xmlReq.send(null);
        }
        else {
           
        }
    }   
 
    function updateContent_callback(rValue, controlId) {
      var rsp = rValue.responseText;
      var _control=document.getElementById(controlId);
      if(_control!=null)
          _control.innerHTML=rsp;  
    }   
    function updateContent_onError(controlId) {
        if (document.getElementById(controlId) != null)
            document.getElementById(controlId).innerHTML = "·þÎñÆ÷³ö´í£¬ÇëÉÔºòÔÙÊÔ£¡.";    
    }
}

function GetDailyArcticle(ControlID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetFoodOrder.ashx?num="+Math.random(),ControlID); 
}

function GetHotProductTitle(ControlID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetHotProduct.ashx?num="+Math.random(),ControlID); 
}

function GetHotEnterprise(ControlID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetEnterpriseOrder.ashx?num="+Math.random(),ControlID); 
}

function GetSercieByBrandID(ControlID,brandID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetSercis.ashx?brandID="+brandID+"&num="+Math.random(),ControlID); 
}

function GetCartypeBySercieID(ControlID,SercieID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetCarType.ashx?SercieID="+SercieID+"&num="+Math.random(),ControlID); 
}

function GetChannelByPid(ControlID,channelID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetChannel.ashx?channelID="+channelID+"&num="+Math.random(),ControlID); 
}

function GetArea(ControlID,proviceID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetArea.ashx?proviceID="+proviceID+"&num="+Math.random(),ControlID); 
}

function GetSuppType(ControlID,suppID){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/GetSuppType.ashx?suppID="+suppID+"&num="+Math.random(),ControlID); 
}

function CheckUser(ControlID,username,psw){ 
     var _ajax_=new HttpAjax();    
     _xmlReq_ = _ajax_.updateContent("/AjaxFile/CheckLogin.ashx?username="+username+"&psw="+psw+"&num="+Math.random(),ControlID); 
}
