$(document).ready(function(){
		//Link Mouseover
		$("#a li,#click").hover(function(){
			$(this).css("color","#F00").css("cursor","pointer");
		}).mouseout(function(){
			$(this).css("color","#04C");
		});

		//Browser
		var browser = navigator.appName;
		var mov;
		if( browser == "Microsoft Internet Explorer" ){
			mov = "#cover";
		}else{
			mov = "body";
		}
		
		//IEなら#cover、それ以外ではbodyに対してscrollTopを取る
		$("li:eq(0)").click(function(){//1950
			$( mov ).animate({scrollLeft:0,scrollTop:0},'slow');
		});
		$("li:eq(1)").click(function(){//1950
			$( mov ).animate({scrollLeft:0,scrollTop:2000},'slow');
		});
		$("li:eq(2)").click(function(){//1960
			$( mov ).animate({scrollLeft:900,scrollTop:2000},'slow');
		});
		$("li:eq(3)").click(function(){//1970
			$( mov ).animate({scrollLeft:1750,scrollTop:2000},'slow');
		});
		$("li:eq(4)").click(function(){//1980
			$( mov ).animate({scrollLeft:2550,scrollTop:1000},'slow');
		});
		$("li:eq(5)").click(function(){//1990
			$( mov ).animate({scrollLeft:3050,scrollTop:0},'slow');
		});
		$("li:eq(6)").click(function(){//2000
			$( mov ).animate({scrollLeft:4000,scrollTop:900},'slow');
		});
	
		//button
		$("#click").click(function(){
			$(".j").toggle();
		});
		
		$("#c td").hover(function(){
			$(this).css("cursor","pointer");
			$(this).css("background","#DFF");
		}).mouseout(function(){
			$(this).css("background","none");
		});

		//td hover
		$("#c td").mouseover(function(){
			var i = $("#c td").index(this);
			
			//data set
			var c = data();
		
			//ID生成
			var id = "#c"+i;
			var idIMG = "#c"+i+" img";
			
			//年月日
			var chartT = chartType();
			if( chartT == "monthly" ){
				//月足
				var ym = c[i][0] + "年" + c[i][1] + "月";
			}else if( chartT == "yearly" ){
				//年足
				var ym = c[i][0] + "年";
			}
		
			//4本値表示
			$( id ).hover(function(){
				/*
				//Y座標
				var y = $( idIMG ).css("margin-top");
				y = parseInt(y);
				y = y - 80 ;
				$("#f").css("top",y);
				
				//Z座標
				z();
				*/
				
				$("#f dd:eq(0)").text(ym);
				/*candle();*/
				$("#f dd:eq(1)").text( c[i][3] );
				$("#f dd:eq(2)").text( c[i][4] );
				$("#f dd:eq(3)").text( c[i][5] );
				$("#f dd:eq(4)").text( c[i][6] );
				/*前月比*/
				var per = ( c[i][6] / c[i-1][6] - 1 ) * 100;
				$("#f dd:eq(5)").text( per.toFixed(2)+"％" );
				
			})/*.mouseout(function(){
				empt();
			})*/;
		
		});//td hover roop end
		
		/*
		function z(){
			$("body").mousemove(function(e){
				var x = e.pageX;
				$("#f").css("left",x+5);
			});
		}
		*/
		/*
		function candle(){
			$("#f dt:eq(0)").text("始値");
			$("#f dt:eq(1)").text("高値");
			$("#f dt:eq(2)").text("安値");
			$("#f dt:eq(3)").text("終値");
		}
		*/
		function empt(){
			$("#f dd").empty();
		}


});
