if(Leder == undefined) var Leder = {};
_Leder_Login = null;
Leder.Login = function()
{
	this.mainContainerDiv = document.createElement('div');
	this.buttonDiv = document.createElement('div');
	this.boxDiv = document.createElement('div');
	this.hidden = true;
	this.title = "Leder Login";
	this.button_id = "leder_login_title";
	this.container_id = "leder_login";
	this.box_id = "leder_login_box";
	this.timeleft = false;
	this.out = false;
	this.open_close_div = document.createElement('div');
	this.open_close_div.className = "open_close_div";
}
Leder.Login.prototype =  
{
	init: function(_self_ref)
	{
		_Leder_Login = _self_ref;
	},
	hide: function(hide)
	{
		if(hide)
		{
			if(this.timeleft ==  false)
			{
				if(!this.hidden)
				{
				this.hidden = true;
				this.buttonDiv.style.backgroundColor="";
				this.mainContainerDiv.className = "leder_login";
				//this.mainContainerDiv.style.height="15";
				this.set_title();
				this.boxDiv.style.borderWidth = "0px";
				}
			}
		}
		else
		{
			this.hidden = false;
			this.mainContainerDiv.className = "leder_login_unhide";
			this.boxDiv.style.borderWidth = "1px";
			this.timeleft =  true;
			setTimeout("_Leder_Login.timed_out();", 3000);
			this.set_title();
			this.buttonDiv.style.backgroundColor="#FFFFFF";
		}
		//this.toggle_open_indicator();
		
	},
	change_title: function(new_title)
	{
		this.title = new_title;
		
	},
	toggle_open_indicator: function()
	{
		if(this.hidden)
		{
			this.open_close_div.innerHTML = "+";
		}
		else
		{
			this.open_close_div.innerHTML = "-";
		}
	},
	setDivs: function()
	{
		if(document.getElementById(this.container_id))
			this.mainContainerDiv = document.getElementById(this.container_id);
		
		if(document.getElementById(this.button_id))
		{
			this.buttonDiv = document.getElementById(this.button_id);
			
		}
		if(document.getElementById(this.box_id))
		{
			this.boxDiv = document.getElementById(this.box_id);
			this.set_title();
		}
		this.set_actions();
	},
	timed_out: function()
	{
		this.timeleft =  false;
		if(this.out == true)
		{
			this.hide(true);
		}
	},
	set_title: function()
	{
		
		var renew_link = "";
		/*
		var open_close = "+";
		*/
		if(this.hidden)
		{
			open_close = "+";
		}
		else
		{
			open_close = "-";
		}
		
		//this.buttonDiv.style.height="15";
		this.buttonDiv.innerHTML = open_close + " " + this.title;
	},
	set_actions: function()
	{
		this.buttonDiv.onclick = new Function("_Leder_Login.hide_unhide();");
		this.boxDiv.onmouseover = new Function("_Leder_Login.out = false; _Leder_Login.hide(false);");
		this.boxDiv.onmouseout = new Function("_Leder_Login.out = true; _Leder_Login.hide(true);");
	},
	hide_unhide: function()
	{
		if(this.hidden)
		{
			this.hide(false);
		}
		else
		{
			this.hide(true);
		}
	},
	set_button_id: function(new_id)
	{
		this.button_id = new_id;
	},
	set_box_id: function(new_id)
	{
		this.box_id = new_id;
	},
	set_container_id: function(new_id)
	{
		this.container_id = new_id;
	},
	getDiv: function()
	{}
};
leder_login = new Leder.Login();
