var IE = false;

function callMe(url, callback){
  ajaxObject = function() {
  try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e){
  try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch(e){
  try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e){
  try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){
  try { return new XMLHttpRequest() } catch(e){
  throw new Error( "This browser does not support XMLHttpRequest." );
  }}}}}}
  ajax = new ajaxObject();
  ajax.onreadystatechange = function(){
    if(ajax.readyState == 4){
      if(ajax.status == 200){
        callHandle(url,ajax.responseText,callback);
      }
    }
  };
  if(url.indexOf('time') == -1){
    url += '?time='+Number(new Date());
  }
  ajax.open('GET', 'ajax/'+url, true);
  ajax.send(null);
}
function callHandle(url,json, callback){
  location.href = "#"+url.replace(/,small_1/,'').split('?')[0];

  try{
    if(typeof(JSON) === "object" && typeof(JSON.parse) === "function")
      var obj = JSON.parse(json);
    else
      eval("var obj = "+json+";");
    if(obj.title) document.title = obj.title;
  }catch(e){
   var obj = json;
  }
  if(typeof(callback) === "function"){
    callback(obj);
  }
}

function AddLoad(func){
  var last = window.onload;
  if(typeof(last) !== 'function')
    window.onload = func;
  else
    window.onload = function(){last(); func();}
}
