if (typeof(Prototype) != 'undefined') {
	Event.observe(window, 'load', function() {
		// highlight notice area
		if ($('notice')) {
			new Effect.Highlight('notice', {duration:1.5, keepBackgroundImage:true});
		}
		
		// target links
		$$('a[href^=#]:not([href=#])').each(function(obj) {
			obj.observe('click', function(event) {
					var link = this.hash.substr(1);
					new Effect.ScrollTo(link, {offset:-5});
					$(link).focus();
					Event.stop(event);
			});
		});
		
		// form inputs
		$$('input,select,textarea').each(function(obj) {
			obj.observe('focus', function() { this.addClassName('focus');    });
			obj.observe('blur', function()  { this.removeClassName('focus'); });
		});
		
		// focus first
		if (document.forms.length) {
			$$('input[type!=hidden],select,textarea')[0].focus();
		}
	});
}
