// Roll Over ----------------------------------------------------------------------
function onmover(el, sep) {
	if ( ! document.images ) return;
	ary_path = el.src.split('_' + sep + '.');
	sep = 3 - sep;
	document.images[el.id].src = ary_path.join('_' + sep + '.');
}
// ---------------------------------------------------------------------------------
function open_nwin(el) {
	var nwin = window.open(el.href);
	nwin.focus();
	return false;
}
function open_nwin_size(el, w, h) {
	var nwin = window.open(el.href, 'win', 'width=' + w + 'px, height=' + h + 'px, resizable=yes, scrollbars=yes, status=yes, menubar=no, toolbar=no, directories=no, location=yes');
	nwin.focus();
	return false;
}
//slidepage ------------------------------------------------------------------------
function slidePage(point) {
	start=getWinYOffset();
	difference=point-start;
	tmp=difference;
	k = 0.90;
	move();
}
function move() {
	if (Math.abs(tmp)>0.5) {
		tmp=tmp*k;
		window.scroll(0,start+(difference-tmp));
		setTimeout("move()",0);
	} else {
		window.scroll(0,difference+start);
	}
}
function getWinYOffset(){
	if(window.scrollY) return window.scrollY; // Mozilla
	if(window.pageYOffset) return window.pageYOffset; // Opera, NN4
	if(document.documentElement && document.documentElement.scrollTop) { // 以下 IE
		return document.documentElement.scrollTop;
	}
	else if(document.body && document.body.scrollTop) {
		return document.body.scrollTop;
	}
	return 0;
}
//slidepage ----------------------------------------------------------------------
// 牧場写真スライドショー
num1 = 1;
function nextImages(path, tcode, len) {
	num1++;
	if ( len < num1 ) { num1 = 1; }
	num2 = num1 + 1;
	if ( len < num2 ) { num2 = 1; }
	document.picl.src = path + tcode + '/' + tcode + '-' + num1 + '.jpg';
	document.picr.src = path + tcode + '/' + tcode + '-' + num2 + '.jpg';
}
// ---------------------------------------------------------------------------------
