﻿// JavaScript Document

/*画像切り換え*/
$(function(){

	$("#catch > img:not(.active)").hide();
	$("#hide").hide();

	$("#gnavi a").mouseover(function(){

	  var h = $(this).parent("li").index("#gnavi li");
	  var n = $("img.active").index("#catch img");
	  
	  if(h==n){
	    return false;
	  }else{
		  
		if(h==1){
			
	      $("img.active").fadeOut("slow").removeClass("active");
	      $("#catch > img").eq(h).addClass("active").css("z-index",100).fadeIn("slow");
	      $("#hide").show();


		}else{
	      
		  $("#hide").hide();
	      $("img.active").fadeOut("slow").removeClass("active");
	      $("#catch > img").eq(h).addClass("active").css("z-index",100).fadeIn("slow");
		  
		};
	  
	  };

	});

});


/*画像クリック*/
$(function() {
	
	$("#catch img").mouseover(function(){
									   
		var n = $(this).index("#catch img");
		var ind = $("#gnavi a").eq(n);
		
		if(n==1) {
			$("img.active").css("cursor","default");
		}
									   
	}).click(function(){
		

		var n = $(this).index("#catch img");
		var ind = $("#gnavi a").eq(n);
		
		if(n==1){
			return false;
		}else{
		
			if(n==5){
				window.open('schedule.html','','scrollbars=yes,width=600,height=600');
			}else{
				window.location = $(ind).attr("href");
			};
		
		}

	});
});


