function activesearch(){
	// Feb 21, 2007 - Rommil Santiago - rommil.santiago@concordia.ca
	// Activates the search options	
	var search_option_list = document.getElementById('search_option_list').getElementsByTagName('li');
	for (var i = 0; i < search_option_list.length; i++){
		search_option_list[i].getElementsByTagName('a')[0].onclick = function(){
			document.getElementById('search_selected').setAttribute('name',this.id);
			document.getElementById('search_option_list').className = this.id;
		};
		search_option_list[i].getElementsByTagName('a')[0].href = '#searchoption';

	}
	// Javascript is active - so allow javascript version of Custom Google Search
	
	if (document.getElementById("javascript_enabled")){
		var js_on = document.getElementById("javascript_enabled");
		js_on.setAttribute('value',true);
	}	
}

function queryclick(){
	var search_toplevel_query = document.getElementById('search_toplevel_query');
	if (search_toplevel_query.value == '')
		search_toplevel_query.value = 'Enter your Query here';
	search_toplevel_query.onclick = function(){
		this.value='';		
		this.onclick = function(){return false;};
		}
	}
	
function queryclick_media(){
	if (document.getElementById('expertsearch_query')){
		var expertsearch_query = document.getElementById('expertsearch_query');
	
		if (expertsearch_query.value == '')
			expertsearch_query.value = 'Enter a Phrase or Keyword';
		expertsearch_query.onclick = function(){
			this.value='';		
			this.onclick = function(){return false;};
			}
		}
	}
	
function breakawaynav_arrows(){	
	if (document.getElementById('breakawaynav')){
		var bodyclasses = document.body.className.split(' ');
		for (var i = 1; i < bodyclasses.length; i++){
				if (document.getElementById(bodyclasses[i])){
					var target = document.getElementById(bodyclasses[i]).getElementsByTagName("a")[0];
					target.className = "list_header_link";
					var last_target = target;
				}
			}
		}
		if (last_target){
			if (last_target.parentNode.getElementsByTagName("ul").length == 0)
				last_target.className="list_header_link active_with_no_arrow";
			else
				last_target.className="list_header_link active_with_arrow";
			}			
	}	
	
	function replaceShareThis(){
	var span = document.getElementsByTagName("span");
	var links = document.getElementsByTagName("a");
	var i;
	var k;

	//for (i = 0; i < span.length; i++){
//		if (span[i].className == "stbuttontext")
//			span[i].innerHTML = "Share This";
//	}
	
	for (k = 0; k < links.length; k++){
		if (links[k].className == "stbutton stico_default"){
			links[k].innerHTML = '<span class="stbuttontext">Share This</span>';
			links[k].className = "";
		}
	}
	
// Now replace the email link
	if (document.getElementById("emaillink") && document.getElementById("sharethis_0")){
		$("#emaillink").replaceWith($("#sharethis_0"));
	}

}
