
// prototype.js use $();
// jQuery       use scroll_jq$();
jQuery.noConflict();
var scroll_jq$ = jQuery;


// Initialization

scroll_jq$.scroll = {
	init: function() {
		for (module in scroll_jq$.scroll) {
			if (scroll_jq$.scroll[module].init)
				scroll_jq$.scroll[module].init();
		}
	}
};

scroll_jq$(document).ready(scroll_jq$.scroll.init);


scroll_jq$.scroll.hover = {

	init: function() {
		scroll_jq$('DIV.totop IMG.Hover')
			.bind('click', this.top)
		scroll_jq$('A.Scroll')
			.bind('click', this.click)
			.each(this.preload);
	},

	preload: function() {
		var params = this.href.split('#');
		var pos = scroll_jq$('a[name='+params[1]+']').offset();
		this.dst=(pos.top)?pos.top:0;
	},
	click: function() {
		scroll_jq$('html,body').animate({ scrollTop: this.dst }, 'slow');
		return false;
	},
	top: function() {
		scroll_jq$('html,body').animate({ scrollTop: 0 }, 'slow');
		return false;
	}
};

