$(document).ready(function(){

	// スムーズスクロール
$('.pagetop').find('img').click(function(){
  $.scrollTo($("#Header"), {speed:500});
});

$('.returns').find('img').click(function(){
  $.scrollTo($("#MenuTop"), {speed:500});
});
	// スムーズスクロール ETHNOVISON ページ内リンク

$('.btApproach').find('img').click(function(){
  $.scrollTo($("#Approach"), {speed:360});
});

$('.btThreeStep').find('img').click(function(){
  $.scrollTo($("#ThreeStep"), {speed:380});
});

$('.btSolution').find('img').click(function(){
  $.scrollTo($("#Solution"), {speed:400});
});

$('.btIH').find('img').click(function(){
  $.scrollTo($("#IH"), {speed:420});
});

$('.btPako').find('img').click(function(){
  $.scrollTo($("#Pako"), {speed:440});
});

$('.btInnovation').find('img').click(function(){
  $.scrollTo($("#Innovation"), {speed:460});
});

$('.btAsia').find('img').click(function(){
  $.scrollTo($("#Asia"), {speed:480});
});

$('.btQuickethno').find('img').click(function(){
  $.scrollTo($("#Quickethno"), {speed:500});
});


	// ロールオーバー
	
	ROfunction('rover', '');
});

function ROfunction(classname, prefix){

	var imgNum = document.getElementsByTagName("img");
	var inputNum = document.getElementsByTagName("input");

	overNum = new Array;

	if(prefix == ''){
		prefix = '_o';
	}

	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(classname) != -1 && overNum[i].src.indexOf(prefix + ".") == -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) + prefix + 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");');
		}
	}
}

