var __scroll = {sp:6, fps:16, timer:0};
function setScrollSp(sp) {
	if(typeof sp == "number") {
		this.__scroll.sp = sp;
	}
}
function setScrollFps(fps) {
	if(typeof fps == "number") {
		this.__scroll.fps = fps;
	}
}
function scrollToTop() {
	pageScroll(0, 0);
}
function getScrollLeft() {
	if(navigator.userAgent.indexOf("MSIE") != -1) {
		return (document.compatMode=="CSS1Compat")?document.documentElement.scrollLeft:document.body.scrollLeft;
	} else {
 	 return (window.pageXOffset) ? window.pageXOffset : 0;
 }
}
function getScrollTop() {
	if(navigator.userAgent.indexOf("MSIE") != -1) {
		return (document.compatMode=="CSS1Compat")?document.documentElement.scrollTop:document.body.scrollTop;
	} else {
 	 return (window.pageYOffset) ? window.pageYOffset : 0;
 }
}
function pageScroll(toX, toY, cuX, cuY) {
	clearTimeout(this.__scroll.timer);
	toX = (!toX || toX < 0) ? 0 : toX;
	toY = (!toY || toY < 0) ? 0 : toY;
	cuX = (!cuX) ? 0 + getScrollLeft() : cuX;
	cuY = (!cuY) ? 0 + getScrollTop() : cuY;
	cuX += (toX - getScrollLeft()) / this.__scroll.sp; 
	cuY += (toY - getScrollTop()) / this.__scroll.sp; 
	if(cuX < 0) { cuX = 0; }
	if(cuY < 0) {	cuY = 0;	}
	window.scrollTo(Math.floor(cuX), Math.floor(cuY));
	if(Math.floor(cuX) != toX || Math.floor(cuY) != toY) {
		this.__scroll.timer = setTimeout("pageScroll("+toX+","+toY+"," +cuX+","+cuY+")",this.__scroll.sp);
	}
}



// jQuery_Auto 0.9
// Automatic functions for webpages (using the wonderful jQuery library)

// Copyright: (c) 2006, Michal Tatarynowicz (tatarynowicz@gmail.com)
// Licenced as Public Domain (http://creativecommons.org/licenses/publicdomain/)
// $Id: jquery_auto.js 426 2006-05-06 19:54:39Z Michal $


// prototype.js use $();
// jQuery       use j$();
jQuery.noConflict();
var j$ = jQuery;

j$.auto = {
	init: function() {
		for (module in j$.auto) {
			if (j$.auto[module].init)
				j$.auto[module].init();
		}
	}
};

j$(document).ready(j$.auto.init);


j$.auto.hide = {
	init: function() {
		j$('.Hide').hide();
	}
};

j$.auto.hover = {

	init: function() {
		j$('IMG.ro')
			.bind('mouseover', this.enter)
			.bind('mouseout', this.exit)
			.each(this.preload);
	},

	preload: function() {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_on$2");
	},

	enter: function() {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_on$2");
	},

	exit: function() {
		this.src = this.src.replace(/^(.+)_on(\.[a-z]+)$/, "$1$2");
	}
};
