
function scroll(target)
{
	$( target ).ScrollTo(1000, 'easein');
}

// 画像リスト
var Imgs = {
	list: '',
	initialize: function() {
		this.list = document.getElementById( 'menu' ).getElementsByTagName( 'A' );
		for (i=0; i<this.list.length; i++) {
			if ( this.list[i].id == MYNAME ) {
				this.list[i].getElementsByTagName( 'IMG' )[0].src = this.list[i].getElementsByTagName( 'IMG' )[0].src.replace('img/','img/h_');
			} else {
				var base = this.list[i].id;
				Imgs[base] = { pre: new Image(), aft: new Image() };
				Imgs[base].pre.src = 'img/menu_btn_'+base+'.png';
				Imgs[base].aft.src = Imgs[base].pre.src.replace('img/','img/h_');
				Imgs.list[i].onmouseover = function(){
					this.getElementsByTagName( 'IMG' )[0].src = Imgs[this.id].aft.src;
				}
				Imgs.list[i].onmouseout = function(){
					this.getElementsByTagName( 'IMG' )[0].src = Imgs[this.id].pre.src;
				}
			}
		}
	}
};

$(function()
{
	Imgs.initialize();
	$('.scroll a, .scroll').attr( 'href', function(){ return "javascript:scroll('"+$(this).attr('href')+"');"; } );
	$('.scroll_range').click( function(){
		var target = this.id.split('_')[1];
		scroll('#'+target);
	});
	if (MYNAME == 'top' && $('div.recent').height() < 150) {
		$('div.recent').height(150);
	}
});

