/**
 * @param loading - text shown when loading
 * @param waitID - place where loading text shown
 * @param setLoad - whether to show the text
 * @param domain
 * @param inter - setInterval vars
 * @todo loading function
 * @author Tingo
 */
var requestLoading = {
	waitID: 'showLoading',
	setLoad: true,
	domain: '',
	inter: 0,
	showLoading: function(setLoading, time) {
		var waitID = global.$(this.waitID);
		if(setLoading) {
			if(waitID) {
				waitID.innerHTML = '<img src="images/loading.gif" alt="" />';
				var times = 4;
			}
		} else {
			waitID.innerHTML = '';
			this.inter = this.waiting(function() {}, time);
		}
	},
	waiting: function(func, time) {
		return setInterval(func, time);
	},
	listLoading: function(paramArr) {
		//this.changeDisplay(true);
		var waitTime = 200;
		//this.showLoading(this.setLoad, waitTime);
		var paramStr = '';
		for(key in paramArr) {
			if(paramArr[key]) {
				paramStr += key + '=' + paramArr[key] + '&';
			}
		}
		paramStr = paramStr.substr(0, paramStr.length - 1);
		jLoader(this.domain + "index.php?" + paramStr, true, '', "utf-8");
	},
	clearInter: function(display) {
		clearInterval(this.inter);
		//this.changeDisplay(display);
	},
	changeDisplay: function(isDisplay) {
		if(isDisplay) {
			global.$(this.waitID).style.display = '';
		} else {
			global.$(this.waitID).style.display = 'none';
		}
	}
};