function _ajaxRequest(jsonn)       
{
	var id = jsonn.id;
	var url = jsonn.url;
	try{var loadingimage = jsonn.loadingimage;}catch(e){}
	if (loadingimage == null)
		loadingimage = "http://img.ingatlan.com/images/ajax-loader.gif";
	try{var callback = jsonn.callback;}catch(e){}
 	if (window.XMLHttpRequest) { var request = new XMLHttpRequest(); } 
	else if (window.ActiveXObject) { var request = new ActiveXObject("Microsoft.XMLHTTP"); }
	request.open('GET', url, true);
	request.onreadystatechange = function() {
			try{if(id != '') document.getElementById(id).innerHTML='<div style="text-align:center;"><img src="'+loadingimage+'"></div>';}catch(e){}
	    if (request.readyState == 4) {
	        if (request.status==200)
	        {
	          if(request.responseText)
	          {
	            var html = request.responseText;
	            try{
	            	if(id != ''){
	                if(document.getElementById(id).style.display=='none')
	                	document.getElementById(id).style.display = 'block';
	                document.getElementById(id).innerHTML = html;
	            	}
	            }catch(e){}
	          }
						
            	if(callback != null){
                callback();
            	}
            
	        }
	    }
	}
	request.send(null);
	return false;
}

function _ajaxRequestXML(jsonn)       
{
	var id = jsonn.id;
	var url = jsonn.url;
	try{var loadingimage = jsonn.loadingimage;}catch(e){}
	if (loadingimage == null)
		loadingimage = "http://img.ingatlan.com/images/ajax-loader.gif";
	try{var callback = jsonn.callback;}catch(e){}
 	if (window.XMLHttpRequest) { var request = new XMLHttpRequest(); } 
	else if (window.ActiveXObject) { var request = new ActiveXObject("Microsoft.XMLHTTP"); }
	request.open('GET', url, true);
	request.onreadystatechange = function() {
			try{
				if(!document.getElementById('loadingimgid'))
				{
					var loader=document.createElement("IMG");
					loader.setAttribute("id","loadingimgid");
					loader.src=loadingimage;
					loader.style.position='absolute';
					var hh = getElementHeight(id);
					var ww = getElementWidth(id);
					if(hh > 0 || ww > 0){
						loader.style.top = parseInt(getElementTop(id) + Math.round(hh / 2) - 12)+"px";
						loader.style.left = parseInt(getElementLeft(id) + Math.round(ww / 2) - 12)+"px";
					}
					document.getElementById(id).appendChild(loader);
				}

				//if(id != '') 
				 //document.getElementById(id).innerHTML='<div style="text-align:center;"><img src="'+loadingimage+'"></div>';
			}catch(e){}
	    if (request.readyState == 4) {
	        if (request.status==200)
	        {
	        	if(request.responseText)
	        	{
	        		//alert(request.responseText);
              var xmlDoc = request.responseXML;
              if(id != ''){
	              if(document.getElementById(id).style.display=='none')
	              	document.getElementById(id).style.display = 'block';
            	}
              for (var bi = 0; (xmlItem = getElementTextNS__("", "doeval", xmlDoc, bi)); ++bi) {
                  eval(xmlItem);
              }
            	var torolni = false;
              for (var bi = 0; (xmlItem = getElementTextNS__("", "response", xmlDoc, bi)); ++bi) {
                if(!torolni) {
               		document.getElementById(id).innerHTML = '';
               		torolni=true;
               	}
                document.getElementById(id).innerHTML += xmlItem;
              }
            }
            else
          	{
          		if(id != '') document.getElementById(id).style.display = 'none';
          	}  
          	if(callback != null){
              callback();
          	} 
	        }
	    }
	}
	request.send(null);
	return false;
}

function getElementTextNS__(prefix, local, parentElem, index) {
    var result = "";
  if (prefix && document.all) {
      result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
  } else {

      result = parentElem.getElementsByTagName(local)[index];
  }
  if (result) {
      if (result.childNodes.length > 1) {
          return result.childNodes[1].nodeValue;
      } else {
          return result.firstChild.nodeValue;           
      }
  } else {
      return;
  }

}