  var  XMLHttpRequestObject  =  false;
  var ajaxLocation = '';
  if  (window.XMLHttpRequest)  {
      XMLHttpRequestObject  =  new  XMLHttpRequest();
    }  else  if  (window.ActiveXObject)  {
        XMLHttpRequestObject  =  new  ActiveXObject("Microsoft.XMLHTTP");
      }

  function  getAjax(data,  div, tename, isele, ServiceName, DisableLoader){
      var StrSplited;
      var preres = '-1';

    if(XMLHttpRequestObject)  {
      var  obj  =  document.getElementById(div);
   //   if(DisableLoader != true) obj.innerHTML  =  "<{$lang.loading_process}>";
      XMLHttpRequestObject.open("GET",  data);
      XMLHttpRequestObject.onreadystatechange  =  function()
      {
        if  (XMLHttpRequestObject.readyState  ==  4  &&
        XMLHttpRequestObject.status  ==  200)  {
          StrSplited = XMLHttpRequestObject.responseText.split("<[ajaxprefix/content]>",3);
          obj.innerHTML  =  StrSplited[StrSplited.length-1];
          if(StrSplited[0] == 'tinytext')  {
              preres = StrSplited[1];
              tinyMCE.get(tename).execCommand("mceSetContent", false, preres);
            } else {
              if(StrSplited.length > 1){
                preres = StrSplited[0];
                tinyMCE.get(tename).execCommand("mceInsertContent", false, "<a href=\"?service="+ServiceName+"&storyid="+preres+"\">"+isele+"</a>");
              }
            }

        }
	$().piroBox_ext();
          if(DisableLoader == true) if(obj.innerHTML.split('<textarea',2).length > 1) tinyinit();
      }
      XMLHttpRequestObject.send(null);
    }
    return preres;
  }
  function  ClearDiv( div){

      var  obj  =  document.getElementById(div);
      obj.innerHTML  =  '';
  }

  function SetHash(AHash) {
    //  var StrSplited;
  //      StrSplited = AHash.split("/",10);
       // if(StrSplited.length > 1) window.location.hash = StrSplited[StrSplited.length-1];
     //   ajaxLocation = window.location.hash;
   //     AjaxLoadParser();
        return true;
   }

  function  AjaxLoadParser(){
     if(window.location.hash != '' || ajaxLocation != window.location.hash) {
        getAjax(window.location.hash.replace('#','')+'&theme=ajaxupdate','content','','','',true);
     }
  }
