
	var flag = false;

	function Content()
	{
		this.content = document.getElementById('content');
		this.cont = document.getElementById('cont');
		this.btns = document.getElementById('menu').getElementsByTagName('a');
	}
	
	Content.prototype.animate = function()
	{
		if(this.cont.offsetWidth < 550) 
		{
			this.cont.style.width = this.cont.offsetWidth + Math.ceil((550 - this.cont.offsetWidth) / 2) + 'px';
			this.cont.style.left = (550 - this.cont.offsetWidth) / 2 + 'px';
		}

		if(this.cont.offsetHeight < 520 && this.cont.offsetWidth > 540) 
		{
			this.cont.style.height = this.cont.offsetHeight + Math.ceil((520 - this.cont.offsetHeight) / 2) + 'px';
			this.cont.style.top = (520 - this.cont.offsetHeight) / 2 + 'px';
		}

		if(this.cont.offsetHeight < 520 || this.cont.offsetWidth < 550) 
		{
			window.setTimeout('new Content().animate()', 100);
		}
	}
	
	Content.prototype.show = function(page)
	{
		if(!flag) this.animate();
		flag = true;
		
		window.location.href = '#' + page;
		
		for(var i = 0; i < this.btns.length; i++)
		{
			if(this.btns[i].id == 'btn_' + page)
			{
				this.btns[i].className = 'active';
				this.btns[i].blur();
			}
			else 
			{
				this.btns[i].className = '';
			}
		}
		
		this.content.style.backgroundImage = 'url(images/main-bg-gray.jpg)';
		
		var request = new AJAX();
		request.load('view.php?page=' + page);
		request.result('cont');
	}
	
	Content.prototype.hide = function()
	{
		flag = false;
		
		window.location.href = '#';
		
		for(var i = 0; i < this.btns.length; i++) 
		{
			this.btns[i].className = '';
		}
		
		this.content.style.backgroundImage = 'url(images/main-bg.jpg)';
		
		with(this.cont) 
		{
			innerHTML = '';
			style.width = 1 + 'px';
			style.height = 1 + 'px';
			style.top = 260 + 'px';
			style.left = 275 + 'px';
		}
	}
	
