﻿   var http_request = false;

   function makeRequest(url, fire) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance for long operation.');
         return false;
      }
      http_request.onreadystatechange = fire;
      http_request.open('GET', url, true);
//      http_request.setRequestHeader("Connection", "close");
//      http_request.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
//      http_request.setRequestHeader("Pragma", "no-cache");
      http_request.send(null);
   }

   function randomString()
   {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 32;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
   }

