function getHttpObject() {
    var XMLhttpObject = null;
    try{
        XMLhttpObject = new XMLHttpRequest();
    }catch(e){
        try{
            XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(e){
                return null;
            }
        }
    }
    return XMLhttpObject;
}


function addListener(obj, eventType, func, cap){
  if(obj.attachEvent){
    obj.attachEvent('on' + eventType, func);
  }else if(obj.addEventListener){
    obj.addEventListener(eventType, func, cap);
  }else {
    alert('No support on your Browser');
    return false;
  }
}
