function RemoteLogin(host_name,login,passw)
	{
	var _this=null;
	this.host_name=host_name;
	this.login=login;
	this.passw=passw;
	this.ajax_script='login/ajax.php';
	this.initialize();
	}
RemoteLogin.prototype=({
initialize: function() {
	this.container=document.getElementById('login');
	_this=this;
},
getFormFields: function(obj) {
	while (obj && obj.nodeName != "FORM") {
		obj=obj.parentNode;
	}
	return obj.elements;
},
printBlock: function() {
	var ajax=new Ajax(this.ajax_script,this.container,'Block','html');
	ajax.method='POST';
	ajax.execute(
		new Array('course_id',this.courseId),
		new Array('html',null),
		new Array('block',null)
		);
}

});

function print_info(html) {
	return html;
}
function getResponse(xml) {
	if(!xml) {
		return "Undefined error. Please <a href=\"\" onclick=\"window.location.reload()\">reload</a> this page";
	}

	var output='';
	var root	=xml.documentElement;
	var cls=(root.getAttribute('success'))?'success':'bugs';
	var info	=root.getElementsByTagName('info');
	var notif	=root.getElementsByTagName('notification');
	var error	=root.getElementsByTagName('error');
	output+="<div class=\""+cls+"\">";
	if(info.length) {
		for(var i=0;i<info.length;i++) { output+="<div class=\"info\">"+getElemText(info[i])+"</div>"; }
	}
	if(notif.length) {
		for(i=0;i<notif.length;i++) { output+="<div class=\"notification\">"+getElemText(notif[i])+"</div>"; }
	}
	if(error.length) {
		for(i=0;i<error.length;i++) { output+="<div class=\"error\">"+getElemText(error[i])+"</div>"; }
	}
	output+="</div>";
	return output;
}
