
function set_login(obj) {
	
	login_fields = $('form_login').serialize();
	param = login_fields;
	new Ajax.Updater('', "ajax/setLogin.php", {parameters: param, method:"post",evalScripts:true,onComplete:function (req) {if (req.responseText) alert(req.responseText); else {onToolsTabClick($('link_tab_0')); get_user_prefs();}}, onFailure:show_failure, onException:show_exception });		
	
	return true;
}

function get_user_prefs() {
	new Ajax.Updater('', "ajax/getUserPrefs.php", {parameters: param, method:"post",evalScripts:true,onComplete:function (req) {if (req.responseText) set_user_prefs(req); }, onFailure:show_failure, onException:show_exception });			
}

function set_user_prefs(req) {
	tmp = req.responseXML.getElementsByTagName('ajax')[0];
	for (i=0;i<tmp.childNodes.length;i++) {
		if (tmp.childNodes[i].getAttribute('type')=='bg_lightbox') {
			window.overlayColor = tmp.childNodes[i].firstChild.data;
			initLightbox();
		}		
	}
}


function getPWD(obj) {
	
	login_fields = $('form_fpw').serialize();
	param = login_fields;
	new Ajax.Updater('', "ajax/getPWD.php", {parameters: param, method:"post",evalScripts:true,onComplete:function (req) {if (req.responseText) $('tab_tools_0').innerHTML = req.responseText}, onFailure:show_failure, onException:show_exception });		
	
	return true;
}