function ROfunction(){
	var imgNum=document.getElementsByTagName("img");
	var inputNum=document.getElementsByTagName("input");
	overNum=new Array;
	for(i=0;i<imgNum.length;i++){overNum[i]=imgNum[i];}
	for(i=0;i<inputNum.length;i++){overNum[i+imgNum.length]=inputNum[i];}
	for(i=0;i<overNum.length;i++){
		if(overNum[i].className.indexOf("Rover")!=-1){
			overNum[i].overimg=new Image();
			if(overNum[i].className.indexOf(":")!=-1){
				Replace=overNum[i].className.split(":");
				Replace=Replace[1].split(" ");
				overNum[i].overimg.src=Replace[0];
			}else{
				Replace = overNum[i].src.length;
				overNum[i].overimg.src=overNum[i].src.substring(0,Replace-4)+"_o"+overNum[i].src.substring(Replace-4,Replace);
			}
			overNum[i].setAttribute("out",overNum[i].src);
			overNum[i].onmouseover=new Function('this.src=this.overimg.src;');
			overNum[i].onmouseout=new Function('this.src=this.getAttribute("out");');
		}
	}
}
window.onload=ROfunction;





// Easingの追加
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

/*-------------------------------------
 ページ読み込み中
-------------------------------------*/
// UTF-8
/**
 * scrollsmoothly.js
 * Copyright (c) 2008 KAZUMiX
 * http://d.hatena.ne.jp/KAZUMiX/20080418/scrollsmoothly
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * 更新履歴
 * 2009/02/12
 * スクロール先が画面左上にならない場合の挙動を修正
 * 2008/04/18
 * 公開
 *
*/

(function(){
   var easing = 0.25;
   var interval = 20;
   var d = document;
   var targetX = 0;
   var targetY = 0;
   var targetHash = '';
   var scrolling = false;
   var splitHref = location.href.split('#');
   var currentHref_WOHash = splitHref[0];
   var incomingHash = splitHref[1];
   var prevX = null;
   var prevY = null;

   // ドキュメント読み込み完了時にinit()を実行する
   addEvent(window, 'load', init);

   // ドキュメント読み込み完了時の処理
   function init(){
     // ページ内リンクにイベントを設定する
     setOnClickHandler();
     // 外部からページ内リンク付きで呼び出された場合
     if(incomingHash){
       if(window.attachEvent && !window.opera){
         // IEの場合はちょっと待ってからスクロール
         setTimeout(function(){scrollTo(0,0);setScroll('#'+incomingHash);},50);
       }else{
         // IE以外はそのままGO
         scrollTo(0, 0);
         setScroll('#'+incomingHash);
       }
     }
   }

   // イベントを追加する関数
   function addEvent(eventTarget, eventName, func){
     if(eventTarget.addEventListener){
       // モダンブラウザ
       eventTarget.addEventListener(eventName, func, false);
     }else if(window.attachEvent){
       // IE
       eventTarget.attachEvent('on'+eventName, function(){func.apply(eventTarget);});
     }
   }
   
   function setOnClickHandler(){
     var links = d.links;
     for(var i=0; i<links.length; i++){
       // ページ内リンクならスクロールさせる
       var link = links[i];
       var splitLinkHref = link.href.split('#');
       if(currentHref_WOHash == splitLinkHref[0] && d.getElementById(splitLinkHref[1])){
         addEvent(link, 'click', startScroll);
       }
     }
   }

   function startScroll(event){
     // リンクのデフォルト動作を殺す
     if(event){ // モダンブラウザ
       event.preventDefault();
       //alert('modern');
     }else if(window.event){ // IE
       window.event.returnValue = false;
       //alert('ie');
     }
     // thisは呼び出し元になってる
     setScroll(this.hash);
   }

   function setScroll(hash){
     // ハッシュからターゲット要素の座標をゲットする
     var targetEle = d.getElementById(hash.substr(1));
     if(!targetEle)return;
     //alert(scrollSize.height);
     // スクロール先座標をセットする
     var ele = targetEle;
     var x = 0;
     var y = 0;
     while(ele){
       x += ele.offsetLeft;
       y += ele.offsetTop;
       ele = ele.offsetParent;
     }
     var maxScroll = getScrollMaxXY();
     targetX = Math.min(x, maxScroll.x);
     targetY = Math.min(y, maxScroll.y);
     targetHash = hash;
     // スクロール停止中ならスクロール開始
     if(!scrolling){
       scrolling = true;
       scroll();
     }
   }

   function scroll(){
     var currentX = d.documentElement.scrollLeft||d.body.scrollLeft;
     var currentY = d.documentElement.scrollTop||d.body.scrollTop;
     var vx = (targetX - currentX) * easing;
     var vy = (targetY - currentY) * easing;
     var nextX = currentX + vx;
     var nextY = currentY + vy;
     if((Math.abs(vx) < 1 && Math.abs(vy) < 1)
       || (prevX === currentX && prevY === currentY)){
       // 目標座標付近に到達していたら終了
       scrollTo(targetX, targetY);
       scrolling = false;
       location.hash = targetHash;
       prevX = prevY = null;
       return;
     }else{
       // 繰り返し
       scrollTo(parseInt(nextX), parseInt(nextY));
       prevX = currentX;
       prevY = currentY;
       setTimeout(function(){scroll()},interval);
     }
   }
   
   function getDocumentSize(){
     return {width:Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), height:Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)};
   }

   function getWindowSize(){
     var result = {};
     if(window.innerWidth){
       var box = d.createElement('div');
       with(box.style){
         position = 'absolute';
         top = '0px';
         left = '0px';
         width = '100%';
         height = '100%';
         margin = '0px';
         padding = '0px';
         border = 'none';
         visibility = 'hidden';
       }
       d.body.appendChild(box);
       var width = box.offsetWidth;
       var height = box.offsetHeight;
       d.body.removeChild(box);
       result = {width:width, height:height};
     }else{
       result = {width:d.documentElement.clientWidth || d.body.clientWidth, height:d.documentElement.clientHeight || d.body.clientHeight};
     }
     return result;
   }
   
   function getScrollMaxXY() {
     if(window.scrollMaxX && window.scrollMaxY){
       return {x:window.scrollMaxX, y:window.scrollMaxY};
     }
     var documentSize = getDocumentSize();
     var windowSize = getWindowSize();
     return {x:documentSize.width - windowSize.width, y:documentSize.height - windowSize.height};
   }
   
 }());


/*-------------------------------------
 ロールオーバー
-------------------------------------*/
/*=====================================================
meta: {
  title: "jquery-opacity-rollover.js",
  version: "2.1",
  copy: "copyright 2009 h2ham (h2ham.mail@gmail.com)",
  license: "MIT License(http://www.opensource.org/licenses/mit-license.php)",
  author: "THE HAM MEDIA - http://h2ham.seesaa.net/",
  date: "2009-07-21"
  modify: "2009-07-23"
}
=====================================================*/
(function($) {
	
	$.fn.opOver = function(op,oa,durationp,durationa,flag){
		if(!flag){
			var c = {
				op:op? op:1.0,
				oa:oa? oa:0.7,
				durationp:durationp? durationp:'fast',
				durationa:durationa? durationa:'fast'
			};
			

			$(this).each(function(){
				$(this).css({
						opacity: c.op,
						filter: "alpha(opacity="+c.op*100+")"
					}).hover(function(){
						$(this).fadeTo(c.durationp,c.oa);
					},function(){
						$(this).fadeTo(c.durationa,c.op);
					})
			});
		};
	},
	
	$.fn.wink = function(durationp,op,oa){

		var c = {
			durationp:durationp? durationp:'slow',
			op:op? op:1.0,
			oa:oa? oa:0.2
		};
		
		$(this).each(function(){
			$(this)	.css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				}).hover(function(){
				$(this).css({
					opacity: c.oa,
					filter: "alpha(opacity="+c.oa*100+")"
				});
				$(this).fadeTo(c.durationp,c.op);
			},function(){
				$(this).css({
					opacity: c.op,
					filter: "alpha(opacity="+c.op*100+")"
				});
			})
		});
	}
	
})(jQuery);

/*-------------------------------------
 ロールオーバー
-------------------------------------*/
(function($) {
$(function() {

  $('a img').not('.mainPhotoInner .thum a img').opOver();
  $('#SIDE h2 a').opOver();
});
})(jQuery);




/*-------------------------------------
 角丸対応
-------------------------------------*/
$(document).ready(function(){
	$("#MENU .noneMenu .noneMenuInner").corner("5px keep");
	$("table tr td:first-child").addClass("bdrLnone");
	$("table tr th:first-child").addClass("bdrLnone");
});

/*-------------------------------------
 サイド
-------------------------------------*/
$(function() {
	$("#SIDE .sidelist").treeview({
	//	animated: "medium",
		collapsed: true,
		persist: "cookie",
		persist: "location"
	});
})

function sideMenuFn(pageID1,pageID2){
	var nowNum = "";
	if($('li').hasClass(pageID1)){
		if(pageID1 != "") nowNum = "."+pageID1;
	}else{
		if($('li').hasClass(pageID2)){
			if(pageID2 != "") nowNum = "."+pageID2;
		}
	}
	if(nowNum != "" && nowNum != ".") $(nowNum).addClass("current");

	//小要素を展開
	$(nowNum).children('ul').css("cssText","display : block important;");

	//親要素を展開
	if($(nowNum).parent().parent().parent().attr("class") == "sidelist treeview"){
		$(nowNum).parent().css("cssText","display : block important;");
	}
	if($(nowNum).parent().parent().parent().parent().parent().attr("class") == "sidelist treeview"){
		$(nowNum).parent().css("cssText","display : block important;");
		$(nowNum).parent().parent().parent().css("cssText","display : block important;");
	}
	if($(nowNum).parent().parent().parent().parent().parent().parent().parent().attr("class") == "sidelist treeview"){
		$(nowNum).parent().css("cssText","display : block important;");
		$(nowNum).parent().parent().parent().css("cssText","display : block important;");
		$(nowNum).parent().parent().parent().parent().parent().css("cssText","display : block important;");
	}
}
function sideMenuFndetailLink(Num){
	$(Num).addClass("ov");
}

/*-------------------------------------
 TOP
-------------------------------------*/

/*---------タブ切り替え部分*/
$(function() {
	$(".newsArea a[href=#tab1]").addClass("on");
	$(".newsArea a[href=#tab1]").click(function(){$(".tab2").hide(); $(".tab1").show(); $(".newsArea a[href=#tab1]").addClass("on"); $(".newsArea a[href=#tab2]").removeClass("on"); })
	$(".newsArea a[href=#tab2]").click(function(){$(".tab1").hide(); $(".tab2").show(); $(".newsArea a[href=#tab1]").removeClass("on"); $(".newsArea a[href=#tab2]").addClass("on");  })

	var nowMouseNumber = "0";
	var zIndexNumber = 1000;

	function allHide(nowNum){
		setTimeout(function(){
			$("#MENU .noneMenu").each(function(i){
				if(nowNum != (i+1)) $("#MENU .noneMenu.cate"+(i+1)).hide();
			});
		},200);
	}

	function menuShow(nowNum){
		setTimeout(function(){
			if(nowMouseNumber == nowNum){
				$("#MENU .noneMenu.cate"+nowNum).css('zIndex', zIndexNumber++);
				$("#MENU .noneMenu.cate"+nowNum).slideDown("fast");
			}
		},200);
		$("#MENU li.cate"+nowNum+" a").addClass("on"); return false;
	}

	$("#MENU .cate1").hover(function(){
		nowMouseNumber="1";
		allHide("1");
		menuShow("1");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate1 a").removeClass("on"); return false;
	});

	$("#MENU .cate2").hover(function(){
		nowMouseNumber="2";
		allHide("2");
		menuShow("2");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate2 a").removeClass("on"); return false;
	});

	$("#MENU .cate3").hover(function(){
		nowMouseNumber="3";
		allHide("3");
		menuShow("3");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate3 a").removeClass("on"); return false;
	});

	$("#MENU .cate4").hover(function(){
		nowMouseNumber="4";
		allHide("4");
		menuShow("4");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate4 a").removeClass("on"); return false;
	});

	$("#MENU .cate5").hover(function(){
		nowMouseNumber="5";
		allHide("5");
		menuShow("5");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate5 a").removeClass("on"); return false;
	});

	$("#MENU .cate6").hover(function(){
		nowMouseNumber="6";
		allHide("6");
		menuShow("6");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate6 a").removeClass("on"); return false;
	});

	$("#MENU .cate7").hover(function(){
		nowMouseNumber="7";
		allHide("7");
		menuShow("7");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate7 a").removeClass("on"); return false;
	});

	$("#MENU .cate8").hover(function(){
		nowMouseNumber="8";
		allHide("8");
		menuShow("8");
	}, function () {
		nowMouseNumber="0";
		allHide();
		$("#MENU li.cate8 a").removeClass("on"); return false;
	});


	//サイド
	$(".newsArea a[href=#tab1]").click(function(){$(".tab2").hide(); $(".tab1").show(); $(".newsArea a[href=#tab1]").addClass("on"); $(".newsArea a[href=#tab2]").removeClass("on"); })



})






/*画像ローテーション*/
function topjs(){
	$(document).ready(function() {
	    $('.mainPhotoInner .thum').cycle({
			pager:  '.numList',
			fx:	   'fade', 
			speed:	2000, 
			timeout: 6000, 
			delay:  -4000, 
			clip:   'l2r',
			pagerAnchorBuilder: function(idx,slide){
				return '.numList li:eq(' + idx + ') a';
			}

		});
	});
}


/*ピックアップエリアスクロールバー*/

			$(function()
			{
				// this initialises the demo scollpanes on the page.
				$('#pane3').jScrollPane();
				$('.pickUpArea .Inner').jScrollPane();
				
				var isResizing;
				
				// and the body scrollpane
				var setContainerHeight = function()
				{
					// IE triggers the onResize event internally when you do the stuff in this function
					// so make sure we don't enter an infinite loop and crash the browser
					if (!isResizing) { 
						isResizing = true;
						$w = $(window);
						$c = $('#container');
						var p = (parseInt($c.css('paddingLeft')) || 0) + (parseInt($c.css('paddingRight')) || 0);
						$('body>.jScrollPaneContainer').css({'height': $w.height() + 'px', 'width': $w.width() + 'px'});
						$c.css({'height': ($w.height()-p) + 'px', 'width': ($w.width() - p) + 'px', 'overflow':'auto'});
						$c.jScrollPane();
						isResizing = false;	
					}
				}
				$(window).bind('resize', setContainerHeight);
				setContainerHeight();
				
				// it seems like you need to call this twice to get consistantly correct results cross browser...
				setContainerHeight();
				
			});


/*上へ戻る*/
			setTimeout(function(){
				$(window).scroll(function() {
					scrollFn();
				});
				$(window).resize(function(){
					scrollFn();
				});
				$(document).ready(function(){
					scrollFn();
				});
			},300);

			function scrollFn(){
				if (typeof document.body.style.maxHeight != "undefined") {
					$(".sidePageTop").css("top",$(window).height()-100);
				}else{
					$(".sidePageTop").css("top",$(window).scrollTop()+$(window).height()-300);
				}
				if($(document).height() - ($(window).scrollTop()+$(window).height()) < $("#FOOTER").height()+150 || $(window).scrollTop() < 50){
					$(".sidePageTop").fadeOut("fast");
				}else{
					$(".sidePageTop").fadeIn("fast");
				}
			}
















/*-------------------------------------
新着情報スクロール切り替え
-------------------------------------*/

jQuery( function() {
    jQuery( '.WhatsNew .Inner' ) .cycle( {
        fx: 'scrollVert',
        speed: 1000,
        timeout: 5000,
        sync: 1
    } );
} );

/*
$(function () {


    function newsTicker(selector) {

        if ($(selector).length <= 1) return false;

        $(selector).each(function (i) {
            $(this).attr("id", "news-" + i);
            if (i != 0) $(this).hide();
        });

        var count = 0,
            end = $(selector).length - 1;
        var interval = 5000; //ミリ秒
        var fadeTimer = setInterval(function () {
            $("dl#news-" + count).hide();
            if (count <= end - 1) {
                $("dl#news-" + (++count)).slideDown("slow");
            } else {
                count = 0;
                $("dl#news-" + count).slideDown("slow");
            }
        }, interval);
    }

    newsTicker('.WhatsNew dl');
})
*/
