function createXMLHttpRequest() {
  var xmlReq = false;
  // branch for native XMLHttpRequest object
  if(window.XMLHttpRequest) {
    try {
      xmlReq = new XMLHttpRequest();
    } catch(e) {
      xmlReq = false;
    }
  // branch for IE/Windows ActiveX version
  } else if(window.ActiveXObject) {
    try {
      xmlReq = new  ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
        xmlReq = new  ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
        xmlReq = false;
      }
    }
  }
  return xmlReq;
}

function callServer(method, url, func, arg) {
  if (!method) method='GET';
  var xmlReq = createXMLHttpRequest();
   
  if(xmlReq) {
    xmlReq.onreadystatechange = function() {
      // only if xmlReq shows "loaded"
      if (xmlReq.readyState == 4 ) {
      	
        func(arg, xmlReq.responseText);
        

      }
     
     
    };
     try{
  xmlReq.open("GET", url, true);
  }catch( err ){alert("wwwwwwwwwwwwww");}
  
  


    
    xmlReq.send( null );
    
    return false;
  }
  return true;
}

function callServerSubs(method, url, func, arg) {
  if (!method) method='GET';
  var xmlReq = createXMLHttpRequest();
   
  if(xmlReq) {
    xmlReq.onreadystatechange = function() {
      // only if xmlReq shows "loaded"
      if (xmlReq.readyState == 4 ) {
      	
        func(arg, xmlReq.responseText);
        

      }
     
     
    };
     try{
  xmlReq.open("GET", url, true);
  }catch( err ){alert("wwwwwwwwwwwwww");}
  
  


    
    xmlReq.send( null );
    
    return false;
  }
  return true;
}

function ourFunc(element, text){
	
	var otdihElement = document.getElementById( element );
	
	try{
	otdihElement.innerHTML = text;
	}catch( err ){
		alert("error" + text);
	}
	
}

function ourFuncSubs(element, text){
	
	var otdihElement = document.getElementById( element );
	
	try{
	otdihElement.innerHTML = text;
	}catch( err ){
		alert("error" + text);
	}
	
}