/////////////////////////////////////////////////////////rollover
function initRollOverImages() {
  var image_cache = new Object();
  $("img.rollover").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);

//////////////////////////////////////////////////////////pngfix

$(document).ready(function(){
$(document).pngFix();
});



//////////////////////////////////////////////////////////fade

$(document).ready(function(){
						   
//graph1_a
$(".over").hover(
	function(){ $(this).animate({ 
    opacity: 0.5,
  }, 500 );
	},
	function(){ $(this).animate({ 
    opacity: 1,
  }, 500 );
	});
	
	$("#graph1_a").click(
	function(){ $("#bar1")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph1_02_a.gif"})
	.animate({ opacity:1 });
	});


//graph1_c
$("#graph1_c").hover(
	function(){ $("#pie1").attr({ 
      src: "img/graph1_01_c.gif"});
	},
	function(){ 
	$("#pie1").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph1_c").click(
	function(){ $("#bar1")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph1_02_c.gif"})
	.animate({ opacity:1 });
	});

//graph1_d
$("#graph1_d").hover(
	function(){ $("#pie1").attr({ 
      src: "img/graph1_01_d.gif"});
	},
	function(){ 
	$("#pie1").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph1_d").click(
	function(){ $("#bar1")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph1_02_d.gif"})
	.animate({ opacity:1 });
	});
	
//graph1_e
$("#graph1_e").hover(
	function(){ $("#pie1").attr({ 
      src: "img/graph1_01_e.gif"});
	},
	function(){ 
	$("#pie1").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph1_e").click(
	function(){ $("#bar1")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph1_02_e.gif"})
	.animate({ opacity:1 });
	});
	
//graph2_a
$("#graph2_a").hover(
	function(){ $("#pie2").attr({ 
      src: "img/graph1_01_a.gif"});
	},
	function(){ 
	$("#pie2").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph2_a").click(
	function(){ $("#bar2")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph2_02_a.gif"})
	.animate({ opacity:1 });
	});

//graph2_b
$("#graph2_b").hover(
	function(){ $("#pie2").attr({ 
      src: "img/graph1_01_b.gif"});
	},
	function(){ 
	$("#pie2").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph2_b").click(
	function(){ $("#bar2")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph2_02_b.gif"})
	.animate({ opacity:1 });
	});

//graph2_c
$("#graph2_c").hover(
	function(){ $("#pie2").attr({ 
      src: "img/graph1_01_c.gif"});
	},
	function(){ 
	$("#pie2").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph2_c").click(
	function(){ $("#bar2")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph2_02_c.gif"})
	.animate({ opacity:1 });
	});

//graph2_d
$("#graph2_d").hover(
	function(){ $("#pie2").attr({ 
      src: "img/graph1_01_d.gif"});
	},
	function(){ 
	$("#pie2").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph2_d").click(
	function(){ $("#bar2")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph2_02_d.gif"})
	.animate({ opacity:1 });
	});
	
//graph2_e
$("#graph2_e").hover(
	function(){ $("#pie2").attr({ 
      src: "img/graph1_01_e.gif"});
	},
	function(){ 
	$("#pie2").attr({ 
	src: "img/graph1_01.gif"});
	});
	
	$("#graph2_e").click(
	function(){ $("#bar2")
	.css({ opacity:0 })
	.attr({ 
      src: "img/graph2_02_e.gif"})
	.animate({ opacity:1 });
	});

	
$("#thisenquete").toggle(
function () {$("#enquete").fadeIn("slow");
},
function () {$("#enquete").fadeOut("slow");
});


});

w = screen.width;
h = screen.height;

if (h > 750){
h = 750;
}
moveTo(0,0);
resizeTo(w,h);

function windowCore(){
		var resizeY=750;
		/* ウィンドウを絶対位置に移動 */
		window.moveTo(0,0);
		/* ウィンドウサイズを絶対サイズに変更 */
		window.resizeTo(resizeX,resizeY);
	}
	/* ウィンドウの読み込みが完了した時（ウィンドウがリロードされた時も） */
	window.onload=windowCore;
	/* ウィンドウサイズが変更された時 */
	window.onresize=windowCore;
	//-->

function openWin1(){
window.open("profile.html","","width=400,scrollbars=1,menubar=0,toolbar=0,location=0,resizable=0,directories=0,status=0");
}

function openWin2(){
window.open("tmresmail/index.cgi","","width=400,scrollbars=1,menubar=0,toolbar=0,location=0,resizable=0,directories=0,status=0");
}

function openWin3(){
window.open("repertory.html","","width=400,scrollbars=1,menubar=0,toolbar=0,location=0,resizable=0,directories=0,status=0");
}


