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;
};

/*-------------------------------------
 ページ読み込み中
-------------------------------------*/

jQuery(document).ready(function(){

	//
	// <a href="#***">の場合、スクロール処理を追加
	//
	jQuery('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				//jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});

	//
	// <a href="#head***">の場合、スクロール処理を追加
	//
	jQuery('a[href*=#head]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});


});


/*-------------------------------------
 ロールオーバー
-------------------------------------*/
/*=====================================================
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){
		
		var c = {
			op:op? op:1.0,
			oa:oa? oa:0.6,
			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() {

  $('#CONTENTS a img').opOver();
  /*$('#over1').wink();
  $('#over3').opOver(0.6,1.0);
  $('#over4').opOver(1.0,0.6,200,500);
  $('#over5').wink(200);
  $('#over6').wink('slow',0.2,1.0);
  $('#test1 .over ').opOver();*/

});
})(jQuery);

	$(document).ready(function () {
		$("html").mousemove(function(e){
		mouseX = e.pageX;
		mouseY = e.pageY;
		})
	});
	var nowList="";
	function pop(Num){
		//ウィンドウ幅を取得
		windowLeft = Math.floor($(window).width()/2);
		windowHeight = Math.floor($(window).scrollTop()+($(window).height()/2));
		//開いているウィンドウがある場合は閉じる
		if(nowList!="" && nowList!=Num) $("#"+nowList).css("display","none");
		nowList = Num;
		//ウィンドウを開く
		($("#"+Num).css("display") == "none") ? $("#"+Num).css("display","block") : $("#"+Num).css("display","none");
		(windowLeft>mouseX) ? $("#"+Num).css("left",mouseX+10) : $("#"+Num).css("left",mouseX-300-10);
		(windowHeight>mouseY) ? $("#"+Num).css("top",mouseY+10) : $("#"+Num).css("top",mouseY-$("#"+Num).height());
		return false;
	}
