   /**
    * GOLLUM the wikipedia browser
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GPL.
    *
    * Copyright(c) 2005 by Harald Hanek. All rights reserved.
    *
    * To contact the author write to: harald.hanek@easycp.de
    * The latest version of Wikipedia Browser can be obtained from: http://www.gollum-browser.com
    */
	
function user()
{this._ajax=null;this._btn_login;this._btn_logout;this._btn_user;var oThis=this;this.__logoutresult=function(data){oThis._logoutresult(data);};this.__state=function(e){oThis._state(e);};this.__init=function(){oThis._init();};this._btn_login=new Button('btn_login');this._btn_logout=new Button('btn_logout');this._btn_user=new Button('btn_user');};user.prototype._init=function()
{this._destroy();this._ajax=new xmlhttp();this._ajax._load("isUser",Array(null,this.__state),fetch.data);};user.prototype._isUser=function()
{this._destroy();this._ajax=new xmlhttp();this._ajax._load("isUser",Array(null,this.__logoutresult),fetch.data);};user.prototype._state=function(e)
{if(e==true)
{this._btn_login.setDisabled();this._btn_login.setVisible(false);this._btn_logout.setEnabled();this._btn_logout.setVisible(true);this._btn_user.setEnabled();this._btn_user.setVisible(true);}else{this._btn_login.setEnabled();this._btn_login.setVisible(true);this._btn_logout.setDisabled();this._btn_logout.setVisible(false);this._btn_user.setDisabled();this._btn_user.setVisible(false);}wb.b._load();};user.prototype._login=function()
{dialog(fetch.login,'login','wb.u._init()','modal',505,350,false);};user.prototype._logout=function()
{this._destroy();this._ajax=new xmlhttp();this._ajax._load("logoutUser",Array(null,this.__logoutresult),fetch.data);};user.prototype._logoutresult=function(result)
{if(this._ajax===null)return;this._destroy();if(result==true)
this._state(false);else
alert(result);};user.prototype._user=function()
{dialog(fetch.user,'login','wb.u._init()','modal',505,360,false);};user.prototype._destroy=function()
{if(this._ajax!=null)
{delete this._ajax;this._ajax=null;}};