/* READY
------------------------------------------------*/
$(document).ready(function() {
	/* トップ用タブコンテンツ */
	$(".xtab").each(function(){
		$(this).addClass("hidetab") ;
		targetID = $(this).attr("title").split("/") ;
		$(targetID[0]).hide() ;
		if( targetID[1]=='show' ){
			$(targetID[0]).show() ;
			$(this).removeClass("hidetab").addClass("showtab") ;

			var strImage = $(this).children('img').attr('src') ;
			var ftype = strImage.substring(strImage.lastIndexOf('.'), strImage.length);
			var hsrc = strImage.replace('_off'+ftype, '_on'+ftype);
			$(this).children('img').attr('src',hsrc) ;
		}
	})

	var max_height = 0 ;
	$(".height_inbox").each(function(){
		if( $(this).height()>max_height ){
			max_height = $(this).height() ;
		}
	}) ;
	$(".height_inbox").height(max_height) ;

;}) ;


/* UTIL
------------------------------------------------*/
$(function() {
	/* トップ用タブコンテンツ */
	$(".xtab").click(function(){
		$(".xtab").each(function(){
			targetID = $(this).attr("title").split("/") ;
			$(targetID[0]).hide() ;
			$(this).removeClass("showtab").addClass("hidetab") ;

			var strImage = $(this).children('img').attr('src') ;
			var ftype = strImage.substring(strImage.lastIndexOf('.'), strImage.length);
			var hsrc = strImage.replace('_on'+ftype, '_off'+ftype);
			$(this).children('img').attr('src',hsrc) ;
		}) ;
		targetID = $(this).attr("title").split("/") ;
		$(targetID[0]).show() ;
		$(this).removeClass("hidetab").addClass("showtab") ;

		var strImage = $(this).children('img').attr('src') ;
		var ftype = strImage.substring(strImage.lastIndexOf('.'), strImage.length);
		var hsrc = strImage.replace('_off'+ftype, '_on'+ftype);
		$(this).children('img').attr('src',hsrc) ;

	}) ;

	$(".xtab").hover(
		function(){ $(this).css('cursor','pointer'); },
		function(){ $(this).css('cursor','default'); }
	) ;

});
