function closebm () {
//	$(this).fadeOut('slow');

	$(this).parent().animate({
		opacity: 'hide',
		height: 'hide'
	}, 'medium');

	//$(this).slideUp('slow',function(){
	//	$(this).fadeOut('slow');
	//});
}

function createXbm(e) {
	if (e) {
		var text = e.html();
		e.empty();
		var eContent = $('<div>' + text + '</div>').addClass('contentx');
		var eIcon = $('<img src="/_/art/_blank.gif" />').addClass('icon');
		var eCloseBox = $('<img src="/_/art/_blank.gif" />').addClass('closebox');
		e.addClass('xbm');
		eContent.appendTo(e);
		eIcon.prependTo(e);
		eCloseBox.prependTo(e);
		eCloseBox.click(closebm);
		$('<div style="clear:both"></div>').appendTo(e);
	}
}

function selectSearch(e) {
	var searchForEnum;
	try {
		searchForEnum = e.children('a').attr('href').substring(1);
		$('#search_cat_enum').val(searchForEnum);
		$('#search_cat_title').html(e.children().html())
	} catch (e) {
		searchForEnum = 'artists';
		$('#search_cat_enum').val(searchForEnum);
		$('#search_cat_title').html('Artists')
	}
//	$('#search_cat .sub li').show();
//	e.hide();
}

function createAPL(e,elid) {
	//$('.apl-container').show();
	$('#apl-container-'+e.i).show();
	if (elid) {
		$('#'+elid).hide();
	}
	$('#apl-'+e.i+'-'+e.p).show().html('<div class="ticker">&nbsp;</div>').load('/-/dxpl/',e);
	return false;
}

$(document).ready(function(){
	createXbm($('.rbm'));
	createXbm($('.gbm'));
	createXbm($('.ybm'));
	
//	selectSearch($('#search_cat .sub li.default'));

	$('#search_cat .sub li').click(function(e){
		selectSearch($(this));
		return false;
	});
});

function follow(i,k,t,a){
	
}
