$(document).observe('dom:loaded', function() {
	var searchBox = $('txtHeaderSearch');
	if(searchBox == null) {
		return;
	}
	$(searchBox).observe('focus', function(event) {
		if(this.value=='SEARCH') {
			this.value='';
		}
	});
	$(searchBox).observe('blur', function(event) {
		if(this.value=='') {
			this.value='SEARCH';
		}
	});

	var searchButton = $('raleysSearchButton');
	if(searchButton == null) {
		return;
	}
	$(searchButton).observe('click', function(event) {
		Event.stop(event);
		var keyword = $(searchBox).value.strip();
		if((keyword == '') || (keyword == 'SEARCH')){
			alert('Please enter a search term');
			return;
		}				
		window.location = "http://www.raleys.com/www/search_results.jsp?keyword=" + keyword;
	});
});

