// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

init_home_list = function() {
	var current = false;
	if ($("home-list")) {
		$("home-list").addClassName("activated");
		$$("#home-list dt").each(function(el) {
			if(!el.next().hasClassName("active")) {
				el.next().hide();
			} else {
				current = $(el);
			}
			
			el.observe('mouseover', function() {
				if(current) { current.next().hide(); }
				$(this).next().show();
				current = $(this);

			});
		});
	}
};

document.observe('dom:loaded', init_home_list);

setup_keywords_input = function(){
	keywords_ipt = $$('input#searchcourse.default,input#home-searchcourse.default');
	keywords_ipt.each(function(ki){
		ki.onfocus = function(){ if(this.value == this.defaultValue){ this.value = ''; } };
		ki.onblur = function(){ if(this.value == ''){ this.value = this.defaultValue; } };
		ki.form.onsubmit = function() {
		  input = $(this).down('input.default');
		  if(input.value == input.defaultValue){ input.value = ''; }
		};
	});
};


document.observe('dom:loaded', setup_keywords_input);