
function GetAjaxObj () {
    var xmlHttpReq = false;
    var self = this;
    
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    };
    
    return self.xmlHttpReq;
};


function GetHumanRedableSIZE (size) {
	if (size == -1) {return 'unlimited';};
	var s = 'bytes';
	
	if (size > 1024) {
		size = Math.round(size/1024);
		s = 'Kb';
	};
	
	if (size > 1024) {
		size = Math.round(size/1024);
		s = 'Mb';
	};
	
	if (size > 1024) {
		size = Math.round((size/1024)*100)/100;
		s = 'Gb';
	};
	
	if (size > 1024) {
		size = Math.round((size/1024)*100)/100;
		s = 'Tb';
	};
	
	return size + ' ' + s;
};
