var Width = 25;
var WidthR = 25;

function TogglePopout ()
{
	if (Width <= 25)
		ExpandPopout ();
	else
	{
		document.getElementById('popouttext').style.display = 'none';
		document.getElementById('backbutton').style.display = 'none';
		WithdrawPopout ();
	}
	
}

function WithdrawPopout ()
{
	if (Width > 25)
	{
		Width -= 50;
		document.getElementById('popout').style.width = Width + 'px';
		setTimeout('WithdrawPopout()', 15);
	}
}

function ExpandPopout ()
{
	WithdrawPopoutR ();

	if (Width < 450)
	{
		Width += 50;
		document.getElementById('popout').style.width = Width + 'px';
		setTimeout('ExpandPopout()', 15);
	}
	else
	{
		document.getElementById('popouttext').style.display = '';
		document.getElementById('backbutton').style.display = '';
	}
}

function QuickPop ()
{
	if (Width <= 25)
		document.getElementById('popout').style.width = '30px';
}

function UnQuickPop ()
{
	if (Width <= 25)
		document.getElementById('popout').style.width = '25px';
}

// RIGHT BAR

function TogglePopoutR ()
{
	if (WidthR <= 25)
		ExpandPopoutR ();
	else
	{
		document.getElementById('popouttextr').style.display = 'none';
		document.getElementById('backbuttonr').style.display = 'none';
		WithdrawPopoutR ();
	}
	
}

function WithdrawPopoutR ()
{	
	if (WidthR > 25)
	{
		WidthR -= 50;
		document.getElementById('popoutr').style.width = WidthR + 'px';
		setTimeout('WithdrawPopoutR()', 15);
	}
}

function ExpandPopoutR ()
{
	WithdrawPopout ();
	
	WidthR += 50;
	document.getElementById('popoutr').style.width = WidthR + 'px';
	
	if (WidthR < 450)
		setTimeout('ExpandPopoutR()', 15);
	else
	{
		document.getElementById('popouttextr').style.display = '';
		document.getElementById('backbuttonr').style.display = '';
	}
}

function QuickPopR ()
{
	if (WidthR <= 25)
		document.getElementById('popoutr').style.width = '30px';
}

function UnQuickPopR ()
{
	if (WidthR <= 25)
		document.getElementById('popoutr').style.width = '25px';
}