function toggle(whichDiv1,whichDiv2)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var aDiv1 = document.getElementById(whichDiv1);
		var class1 = aDiv1.className;
		
		if (class1 == 'filter-option-link-open')
		{
			aDiv1.className = 'filter-option-link-closed';
		}
		else if (class1 == 'filter-option-link-closed')
		{
			aDiv1.className = 'filter-option-link-open';
		}		
		
		var aDiv2 = document.getElementById(whichDiv2);
		var class2 = aDiv2.className;
		
		if (class2 == 'filter-option-content-show')
		{
			aDiv2.className = 'filter-option-content-hide';
		}
		else if (class2 == 'filter-option-content-hide')
		{
			aDiv2.className = 'filter-option-content-show';
		}		
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var aDiv1 = document.all[whichDiv1];
		var class1 = aDiv1.className;
		
		if (class1 == 'filter-option-link-open')
		{
			aDiv1.className = 'filter-option-link-closed';
		}
		else if (class1 == 'filter-option-link-closed')
		{
			aDiv1.className = 'filter-option-link-open';
		}		
		
		var aDiv2 = document.all[whichDiv2];
		var class2 = aDiv2.className;
		
		if (class2 == 'filter-option-content-show')
		{
			aDiv2.className = 'filter-option-content-hide';
		}
		else if (class2 == 'filter-option-content-hide')
		{
			aDiv2.className = 'filter-option-content-show';
		}		
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichDiv].style;
		style2.display = style2.display? "":"block";
	}	
}

function forceClose(whichDiv1,whichDiv2)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var aDiv1 = document.getElementById(whichDiv1);
		
		aDiv1.className = 'filter-option-link-closed';
		
		var aDiv2 = document.getElementById(whichDiv2);
		
		aDiv2.className = 'filter-option-content-hide';
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var aDiv1 = document.all[whichDiv1];
		
		aDiv1.className = 'filter-option-link-closed';
		
		var aDiv2 = document.all[whichDiv2];

		aDiv2.className = 'filter-option-content-hide';
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichDiv].style;
		style2.display = "";
	}	
}

var st1;

function createSortableTable()
{
	st1 = new SortableTable(document.getElementById("course-table"), ["None", "CaseInsensitiveString", "Number", "CaseInsensitiveString", "CaseInsensitiveString", "CaseInsensitiveString"]);
}

function doAction(a,formName)
{
	document.getElementById("find-courses-progress-container").style.display = "none";
	document.getElementById("find-courses-progress").style.display = "block";
	retrieveURL(a,formName,createSortableTable);
}

function setShowClosed(checkbox)
{
	var url = 'search.do?dispatch=setShowClosed&showClosed=';
	if (checkbox.checked)
		url = url + 'true';
	else
		url = url + 'false';
	retrieveURL(url);
}
