var myFilterFunc = function(dataSet, row, rowNumber)
{
	document.formname.selectname2[0].selected = true;
	document.formname.selectname3[0].selected = true;
	document.formname.selectname4[0].selected = true;
	expression = new
RegExp(document.formname.selectname[document.formname.selectname.selectedIndex].value);
if (row["rubric"].search(expression) != -1)
	return row;                     // Return the row to keep it in the data set.
	return null;                    // Return null to remove the row from the data set.
	
}

var myFilterFunc2 = function(dataSet, row, rowNumber)
{
	document.formname.selectname[0].selected = true;
	document.formname.selectname3[0].selected = true;
	document.formname.selectname4[0].selected = true;
	expression2 = new
RegExp(document.formname.selectname2[document.formname.selectname2.selectedIndex].value);
if (row["location"].search(expression2) != -1)
	return row;                     // Return the row to keep it in the data set.
	return null;                    // Return null to remove the row from the data set.
	
}

var myFilterFunc3 = function(dataSet, row, rowNumber)

	{
	document.formname.selectname[0].selected = true;
	document.formname.selectname2[0].selected = true;
	document.formname.selectname4[0].selected = true;
expression3 = new
RegExp(document.formname.selectname3[document.formname.selectname3.selectedIndex].value);
if (row["method"].search(expression3) != -1)
	return row;                     // Return the row to keep it in the data set.
	return null;                    // Return null to remove the row from the data set.
	
}

var myFilterFunc4 = function(dataSet, row, rowNumber)

	{
	document.formname.selectname[0].selected = true;
	document.formname.selectname2[0].selected = true;
	document.formname.selectname3[0].selected = true;
expression4 = new
RegExp(document.formname.selectname4[document.formname.selectname4.selectedIndex].value);
if (row["session"].search(expression4) != -1)
	return row;                     // Return the row to keep it in the data set.
	return null;                    // Return null to remove the row from the data set.
	
}



function checkSeats(region, search){
    var seats = search('{totalseats}');
    return seats >= 0 ? 'classfull' : ''
}




function displayMethod(region, search){
    var methodrow = search('{method}');


   	if (methodrow=='CON' || methodrow=='CONX')
	  {return ''}
	
	if (methodrow=='WEB')
	  {return '-<span class="method bold">ONLINE</span>'}
	
	if (methodrow=='HYB' || methodrow=='HYBX')
		{return '-<span class="method bold">HYBRID</span>'}
				
	if (methodrow=='TWY' || methodrow=='TWA')
		{return '-<span class="method bold">DISTANCE</span>'}
		
	if (methodrow=='TWYX' || methodrow=='TWAX')
		{return '-<span class="method bold">DISTANCE/HYBRID</span>'}
}

function displaySession(region, search){
    var sessionrow = search('{session}');


   	if (sessionrow=='A' || sessionrow=='M1')
	  {return '<em>1st half of term</em>'}
	
	if (sessionrow=='B' || sessionrow=='M2')
	  {return '<em>2nd half of term</em>'}
	
	if (sessionrow=='HS1' || sessionrow=='HS2' || sessionrow=='HS3' || sessionrow=='HS4' || sessionrow=='HS5')
	  {return '<em>Only meets once</em>'}
	
	if (sessionrow=='DR1' || sessionrow=='DW1')
	  {return '<em>First 5 weeks of term</em>'}
	
	if (sessionrow=='DR2' || sessionrow=='DW2')
	  {return '<em>Second 5 weeks of term</em>'}

	if (sessionrow=='DR3' || sessionrow=='DW3')
	  {return '<em>Last 5 weeks of term</em>'}
	

	
}


function changecourse(){  		
	var userInput = document.getElementById(document.formname.selectname.value).title;
	document.getElementById('pagetitle').innerHTML = userInput;
	document.getElementById('nocoursetitle').innerHTML = userInput;
}
	
function changelocation(){  		
	var userInput = document.getElementById(document.formname.selectname2.value).title;
	document.getElementById('pagetitle').innerHTML = userInput;
	document.getElementById('nocoursetitle').innerHTML = userInput;
}

function changemethod(){  		
	var userInput = document.getElementById(document.formname.selectname3.value).title;
	document.getElementById('pagetitle').innerHTML = userInput;
	document.getElementById('nocoursetitle').innerHTML = userInput;
}

function changesession(){  		
	var userInput = document.getElementById(document.formname.selectname4.value).title;
	document.getElementById('pagetitle').innerHTML = userInput;
	document.getElementById('nocoursetitle').innerHTML = userInput;
}



/* getElementByClass
/**********************/

var allHTMLTags = new Array();

function getElementByClass(theClass) {

//Create Array of All HTML Tags
var allHTMLTags=document.getElementsByTagName("td");

//Loop through all tags using a for loop
for (i=0; i<allHTMLTags.length; i++) {

//Get all tags with the specified class name.
if (allHTMLTags[i].className==theClass) {

//Place any code you want to apply to all
//pages with the class specified.
//In this example is to “display:none;” them
//Making them all disappear on the page.

allHTMLTags[i].style.display='none';

}
}
}
