function enableText() {
	document.getElementById('progsearchtxt').style.backgroundColor="#FFFFFF"; 
	disableSelect();
}

function enableSelect() {
	var area = document.getElementById('progarea').value;
	if (area != "CE") {

	document.getElementById('progarea').style.backgroundColor="#FFFFFF"; 
	document.getElementById('progtype').style.backgroundColor="#FFFFFF"; 
	disableText();
} else {
	document.getElementById('progarea').style.backgroundColor="#FFFFFF"; 
	
}
}

function disableText() {
	document.getElementById('progsearchtxt').style.backgroundColor="#CCCCCC"; 

}

function disableSelect() {
	document.getElementById('progarea').style.backgroundColor="#CCCCCC"; 
	document.getElementById('progtype').style.backgroundColor="#CCCCCC"; 
}



function GoogleSearch() {

	// we are doing a google search
	
	// get the search terms
	
	var terms = document.getElementById('progsearchtxt').value;
	
	// redirect browser to search results
	
	if (terms) {
	
	var gsaPrefix = "http://mysearch.humber.ca/search?q=";
	var gsaSuffix = "&client=default_frontend&proxystylesheet=default_frontend&site=all_programs&output=xml_no_dtd&filter=0";
	
	var gsaURL = gsaPrefix + terms + gsaSuffix;
	window.location = gsaURL;
	return false;
	} else {
	return false;
	}
}
function DrupalSearch() {

// we are doing a drupal search


// do we have a program area?
	var area = document.getElementById('progarea').value;
	if (!area) {
		area = "ALL"
	}
// do we have a program type?
	var type = document.getElementById('progtype').value;
	if (!type) {
		type = "ALL"
	}

	// if the program type is CE, then go to the CE programs list
	if (area == "CE") {
	window.location = "http://calendardb.humber.ca/LIS/WebCalendar/CE/CalendarIndex.do?name=programs";
	return false;
	}

// redirect browser to drupal search

var drupalPrefix = "http://www.humber.ca/programsearch?title="
var drupalURL = drupalPrefix + "&tid_1=" + area + "&tid=" + type;

	window.location = drupalURL;
	return false;
}

// if CE is selected as the area, disable type

function checkCE() {
	var area = document.getElementById('progarea').value;
	if (area == "CE") {
	document.getElementById('progtype').style.backgroundColor="#CCCCCC"; 
	}
//

}

