Event.observe(window, 'load', function(){
	function refresh_tip() {
		if ('' == $('query').value.strip()) {
			$('query').value = window.search_tip;
		}
	}
	Event.observe($('query'), 'blur', refresh_tip);
	Event.observe($('query'), 'focus', function(){
		if (window.search_tip == $('query').value.strip()) {
			$('query').value = '';
		}
	});
	refresh_tip();
	if (window.news_shops && 1 < window.news_shops.length) {
		var current_shop = 0;
		var show_next_shop = function() {
			new Effect.Fade($('news'), {afterFinish: function(){
				current_shop += 1;
				if (current_shop >= window.news_shops.length) { current_shop = 0; }
				$('news').innerHTML = window.news_shops[current_shop];
				new Effect.Appear($('news'), {afterFinish: function(){
					setTimeout(show_next_shop, 1000);
				}});
			}});
		}
		show_next_shop();
	}
});