
function setupAccordion(ul){

var studentCenter = $('#' + ul + ' .student');

var szNormal = 16, szSmall  = 16, szFull   = 690 - (16*(studentCenter.length-1)); //szFull should be calculated based on the number of items
$("#"+ul+" .student").css("background-position", "-"+ (studentCenter.length-1)*16 +"px 0px !important");
  var count = 0;
  studentCenter.each(function(student, i) {
    count++;
	$(this).bind("click", function() {
	    	$('#'+this.id).nextAll().children('.label').removeClass('offleft');
	    	$('#'+this.id).nextAll().children('.label').removeClass('onright');
	    	$('#'+this.id).nextAll().children('.label').addClass('offright');

	    	$('#'+this.id).prevAll().children('.label').removeClass('offright');
	    	$('#'+this.id).prevAll().children('.label').removeClass('onright');
	    	$('#'+this.id).prevAll().children('.label').addClass('offleft');

	    	$('#' + this.id + ' .label').removeClass('offleft');
	    	$('#' + this.id + ' .label').removeClass('offright');
	    	$('#' + this.id + ' .label').addClass('onright');
	    	
	    	$('.student').css('width',szSmall);
	    	$('#'+this.id).css('width',szFull);
	    	
	 	swapProfile(this.id);   	
	    	//alert('#'+this.id);
        	//alert($('#'+this.id).next().attr('id'));
	});
});

}

function swap(ul,label){
    $(".studentCenterUl").css('display','none');
    $("#"+ul).css('display','block');
    $("#profilePlayerController a").css("background-color","#BABABA");
    $("#profilePlayerController a").css("color","#5A5A5A");
    
    
    var parent;
    parent = $('#' + ul.replace("Ul","")).parent();
    $(parent).addClass('selected');
    $(label).css("background-color","#5A5A5A");
    $(label).css("color","#EEEEEE");
     $("#"+ ul + ' LI:first-child').click();

}


function swapProfile(profile){
//alert("/_utility/ajaxProfile.aspx?id="+profile.substring(7));
//$$("#profileCopy").setHTML("<img src=\"/_images/common/spinner.gif\" /> Loading...");
$('#profileCopy').load("/_utility/ajaxProfile.aspx?id="+profile.substring(7));


}