var host="http://"+location.host+"/";

function newClass(obj,nameClass) {
	$('#'+obj).removeClass();
	$('#'+obj).addClass(nameClass);
}
function endLoader(obj) {
	
	if (t==undefined) var t=0;
	$('#'+obj).show();
	$('#'+obj+"Loader").hide();
	
}
function ajaxErrorAlert() {
	alert("Извините произошла ошибка попробуйте повторить попытку");
}
function ajaxError(xhr) {
	if(xhr.status == 404) alert('Извините, запрашиваемой страницы не существует!');
	if(xhr.status != 404) ajaxErrorAlert();
}

function status(e) {

	function el(e){return document.getElementById(e);}
	
	var x,y,t='';
	var str=new String(Math.random());
	var obj="status_"+str.substr(10);

	if(!el(obj)) {
		var newp = document.createElement("div");
		newp.setAttribute("id", obj);
		document.body.appendChild(newp)		
	}
					
	var ct=el(obj);
	
	ct.className="status";

	if (document.all) {x=e.clientX+document.documentElement.scrollLeft;y=e.clientY+document.documentElement.scrollTop;}
	else {x=e.pageX;y=e.pageY;}

	t+="<center>Пожалуйста подождите<br /><img src=\"design/loading.gif\"><br />идет загрузка...</center>";

	el(obj).innerHTML=t;

	ct.style.left=x-(el(obj).offsetWidth/2)+'px';
	ct.style.top=y-(el(obj).offsetHeight/2)+'px';
	return obj;

}