
(function($){

	$(document).ready(function(){

		// rollover.
		$('#menu img.over, #area img.over, #area input.over').each(function(){
			// preload image.
			var img = new Image();
			img.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1-over$2');
			$(this)
				// store the image sources.
				.data('image', {
					defaultSrc: this.src,
					hoverSrc: img.src
				})
				.hover(
					function(){
						this.src = $(this).data('image').hoverSrc;
					},
					function(){
						this.src = $(this).data('image').defaultSrc;
					}
				);
		});

		// status current.
		$('#area img.on').each(function(){
			this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, '$1-over$2');
		});

		// open link as '_blank'.
		$('#area a[rel=external]').click(function(){					
			window.open(this.href, '_blank');
			return false;
		});
		
		$('.fontsizeswitcher .li01').click(
			function(){
				setActiveStyleSheet('small'); return false;
			}
		);
		$('.fontsizeswitcher .li02').click(
			function(){
				setActiveStyleSheet('default'); return false;
			}
		);
		$('.fontsizeswitcher .li03').click(
			function(){
				setActiveStyleSheet('large'); return false;
			}
		);
		

	});

})(jQuery);

