var setLoader = function(show, id) {
	var domId = (id) ? id : "status";
	document.getElementById(domId).src = show ? www + 'admin/images/ajax-loader.gif' : www + 'admin/images/spacer.gif';
}

var setStatus = function(html, id) {
	var domId = (id) ? id : "status-msg";
	document.getElementById(domId).innerHTML = html;
}

var logout = function() {
	
	Ext.Ajax.request({
		url: www + 'admin/ajax.php?q=logout',
		method: 'post',
		success: function(r) {
			var res = Ext.util.JSON.decode(r.responseText);
			if (res.success) {
				window.location.href = www;
			} else {
				alert('Došlo je do greške prilikom odjave. Probaj se opet odlogirati.');
			}
		}
	});
	
}

var sh = function(id, show) {
	document.getElementById(id).style.display = (show)
		? show
		: (document.getElementById(id).style.display == 'block' ? 'none' : 'block');
}