var currentSelection;
function schoolChangeSelect(id, item, site, synd, collapse)
{
	if ( typeof site == 'undefined' )
		site = '';

	if (typeof synd == 'undefined' )
		synd = '';
		
	if (typeof collapse == 'undefined' )
		collapse = '0';

	if ( switchingAjax && callInProgress(switchingAjax.transport) )
		switchingAjax.transport.abort();
		
	$('miniRFI_content').addClassName("selected");
	
	disableOtherSchools(id);
	highlightSchool(id,"selected");
	
	var arrow = $('schoolArrow_'+id);
	if(arrow)
		arrow.src = "/img/requestinfo/arrow_on.gif";

	showstatus('loading...');
	loadit(item, site, synd,collapse);
	var dontStop = $('dont_stop');
	if(dontStop)
	{
		dontStop.src = dontStop.src.replace('on\.','off\.');
	}
	
	window.scroll(0,0);

	// set schoolID in global space...
	schoolID = item;
	currentSelection = id;
}

function highlightSchool(num)
{
	
	
	var	className = 'mouseover';
		
	el = $('schoolItem_'+num);
	
	if(el.className.match("selected"))
		return;
	
	addStyleClass(el,className);
	removeStyleClass(el,'disabled');
	
}

function unHighlightSchool(num)
{
	if(num != currentSelection)
	{
		el = $('schoolItem_'+num);
		var arrow = $('schoolArrow_'+num);
		if(arrow)
		{
			arrow.src = "/img/requestinfo/arrow_off.gif";
		}
		
		if(currentSelection)
			addStyleClass(el,'disabled');
			
		removeStyleClass(el,"mouseover");
	}
}


function disableOtherSchools(currentSelectionID)
{
	var schoolItems = $$('table.schoolItem');
	var el;
	
	for(var c = 0; c<schoolItems.length;c++)
	{
		el = schoolItems[c];
		if(el.id == 'schoolItem_'+currentSelectionID)
		{
			el.removeClassName('disabled');
			el.addClassName('selected');	
		}
		else
		{
			el.addClassName("disabled");
			el.removeClassName('selected');
			el.removeClassName('mouseover');
		}
	}
}

function toggleRemainingSchools(link,remainingSchoolsContainer)
{
	if(remainingSchoolsContainer.style.display == 'none')
	{
		remainingSchoolsContainer.style.display = 'block';
		link.innerHTML = "Reduce List of Schools";
	}
	else
	{
		remainingSchoolsContainer.style.display = 'none';
		link.innerHTML = "See All Schools";
	}
	
}