//function $(id){ 		return (id[0] == '#')?document.getElementById((id.replace('#',''))):(id[0] == '.')?document.getElementByClassName((id.replace('.',''))):document.getElementById(id); }
function isset(id){ 	return typeof id != undefined; }
function empty(id){ 	return id == ""; }
function unset(id){ 	id=null; }
function xhr(){ 		return window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); }
var xhr = xhr();

ajax = function(S){
	if(xhr){
		if(!isset(S.method))
			S.method = 'GET';
		xhr.onreadystatechange = function(){
			if(xhr.readyState == 1)
				S.loading.call();
			else if(xhr.readyState == 2)
				S.loaded.call();
			else if(xhr.readyState == 3)
				S.interactive.call();
			else if(xhr.readyState == 4){
				if(S.ID) $(S.ID).innerHTML=xhr.responseText;
				S.complete.call();
			}
		}
		xhr.open("GET", S.URL, true); 
		xhr.send(null);
	}
};

ErrorLog = function(e){
	var str = url+'site_inc/AjaxError.inc.php?m='+e+'&p='+document.location;
	Ajax(str);
};
/*hide = function(id){
	if(typeof id == 'array'){
		for (var i in array){
			if($(array[i]) != null){
				$(array[i]).style.display="none";
			}
		}
	}else{
		$(id)?$(id).style.display="none":id.style.display="none";
	}
};
show = function(id){
	if(typeof id == 'array'){
		for (var i in array){
			if($(array[i]) != null)
				$(array[i]).style.display="block";
		}
	}else{
		$(id)?$(id).style.display="block":id.style.display="block";
	}
};*/