var opened = null;
var armed = null;
var exit = null;

var opened2 = null;
var armed2 = null;
var exit2 = null;

function hide()
{
	if ( opened == null )
	{
		document.getElementById('brands').style.display = 'none';
		document.getElementById('brands').style.visibility = 'hidden';
	}
}

function hide2()
{
	if ( opened2 == null )
	{
		document.getElementById('resellertype').style.display = 'none';
		document.getElementById('resellertype').style.visibility = 'hidden';
	}
}

function armClose()
{
	if ( armed != 'armed' )
	{
		if ( opened == 'brands' )
		{
			exit = setTimeout("closeBrands();",1500);
		}
		armed = 'armed';
	}
}

function armClose2()
{
	if ( armed2 != 'armed' )
	{
		if ( opened2 == 'resellertype' )
		{
			exit2 = setTimeout("closeResellertype();",1500);
		}
		armed2 = 'armed';
	}
}

function killClose()
{
	if ( opened != null && armed == 'armed' )
	{
		clearTimeout(exit);
		armed = null;
	}
}

function killClose2()
{
	if ( opened2 != null && armed2 == 'armed' )
	{
		clearTimeout(exit2);
		armed2 = null;
	}
}

function openBrands()
{
	document.getElementById('brands').style.display = 'block';
	document.getElementById('brands').style.visibility = 'visible';

	if ( opened == null )
	{
		brands.custom({
		  'opacity': [0, 0.90],
		  'width': [0, 150]
		});
		opened = 'brands';
	}
	else if ( opened == 'brands' )
	{
		closeBrands();
	}
}

function openResellertype()
{
	document.getElementById('resellertype').style.display = 'block';
	document.getElementById('resellertype').style.visibility = 'visible';

	if ( opened2 == null )
	{
		resellertype.custom({
		  'opacity': [0, 0.90],
		  'width': [0, 150]
		});
		opened2 = 'resellertype';
	}
	else if ( opened2 == 'resellertype' )
	{
		closeResellertype();
	}
}

function closeBrands()
{
	if ( opened == 'brands' )
	{
		brands.custom({
		  'opacity': [0.90, 0],
		  'width': [150, 0]
		});
		opened = null;
		armed = null;
		setTimeout("hide();",1500);
	}
}

function closeResellertype()
{
	if ( opened2 == 'resellertype' )
	{
		resellertype.custom({
		  'opacity': [0.90, 0],
		  'width': [150, 0]
		});
		opened2 = null;
		armed2 = null;
		setTimeout("hide2();",1500);
	}
}