jQuery(document).ready(function(){
	// a要素(class:kinmuCal)クリック時動作
	jQuery(".kinmuCal").click(function(){
		// アンカのrel属性を取得 && スプリット
		var arr_date = jQuery(this).attr("rel").split("/");
		// 年のinput要素(id:form_year)に代入
		jQuery("#kinmuYear").val(arr_date[0], "value");
		// 月のinput要素(id:form_month)に代入
		jQuery("#kinmuMonth").val(arr_date[1], "value");
		// 日のinput要素(id:form_date)に代入
		jQuery("#kinmuDay").val(arr_date[2], "value");
	});
	tabSwapr_init();
});

var tabSwapr_init = function(){
	jQuery("#tab_swpr").children("li").children("a:first-child").click(function() {
		tabSwapr(jQuery(this));
		return false;
	});
	if(jQuery("#tab_swpr").children("li.sel") == undefined){
		tabSwapr(jQuery("#tab_swpr").children("li:first-child").children("a:first-child"));
	}else{
		tabSwapr(jQuery("#tab_swpr").children("li.sel").children("a:first-child"));
	}
}

var tabSwapr = function(CALLER){
	jQuery(CALLER).parent().addClass("sel");
	jQuery(jQuery(CALLER).attr("href")).show();
	jQuery(CALLER).parent().siblings().each(function(){
		jQuery(this).removeClass("sel");
		jQuery(jQuery(this).children("a").attr("href")).hide();
	});
}


jQuery(document).ready(function() {
	jQuery("#s_switch1 a").click(function() {
	    jQuery("div#panel2").hide();
		jQuery("div#panel1").css("display","block");
	    jQuery(this).hide();
		jQuery("#s_switch2 a").css("display","block");
		return false;
	});
});

jQuery(document).ready(function() { 
	jQuery("#s_switch2 a").click(function() {
	    jQuery("div #panel1").hide();
		jQuery("div #panel2").css("display","block");
	    jQuery(this).hide();
		jQuery("#s_switch1 a").css("display","block");
		return false;
	});
});
