var lastExpand = '';
var oldDiv = '';
var artists = Array("arlo", "abe", "sarahlee", "annie", "johnny", "titcomb", "seeger", "folkuke");
var backgrounds = Array(8);

function preloadBackgrounds()
{
	for (var id in artists)
	{
		backgrounds[id] = new Image();
		backgrounds[id].src = 'imagebank/artists/expanders/' + artists[id] + '_expander.jpg';
	}
}

function slide(obj)
{
	if (lastExpand == '')
	{
		lastExpand = obj.id;
		getElem(obj.id + '_expander').style.display = 'block';
	}
		
	if (getElemHeight('artistexpand') > 30)
	{
		if (obj.id != lastExpand)
			setTimeout("artistslide.start()", 600);		
	}
	
	oldDiv = lastExpand;
	lastExpand = obj.id;
	artistslide.start();
	setTimeout("updateDivs('" + obj.id + "')", 450);
}

function updateDivs(name)
{
	getElem(oldDiv + '_expander').style.display = 'none';
	getElem(lastExpand + '_expander').style.display = 'block';

	initscrollbar(name); // initialize the scrollbar for items with scrollable divs
}

function getElemHeight(id)
{
	var height = getElem(id).style.height;
	height = height.split('px');
	return height[0];
}