var tabContent = {};
tabContent.hoge = 'hage';
/******************************************************************//*
 * タブコンテナにclass tabContent　を指定
 * タブコンテナ内には各コンテンツのDIVがID付きで格納されている
 */
tabContent.init = function(){
	var tmp = $("div[class*='tabContent']");
	if (tmp.length == 0) { return; };
	var args = tmp.attr('class').match(/tabContent\[?([^\]]+)\]?/);
	var arg = (args) ? args[1].split(',') : [];
	tabContent.target = $('#'+tmp.attr('id'));
	tabContent.current = (arg[2]) ? arg[2] : 1;
	var hash = '';
	if(String(location.hash).search('#tab_') != -1){
		hash = '#' + String(location.hash).replace('#tab_', '');
	}
	
	tabContent.target.children().hide();
	if(tabContent.target.find(hash).length != 0){
		tabContent.target.find(hash).show();
		updateToggleByKey('tabContent', hash.replace('#',''));
		var pos = tabContent.target.position();
		$('html,body').scrollTop(pos.top);
	}
	else{
		var first = tabContent.target.children('div:first');
		first.show();
		updateToggleByKey('tabContent', first.attr('id'));
	}
}

/**
 * コンテンツIDを指定して切り替え
 * @param {Object} id
 */
tabContent.changeTo = function(id){
	tabContent.target.children().hide();
	tabContent.target.find('#'+id).show();
}

/**
 * コンテンツIDを指定して切り替え
 * @param {Object} id
 */
tabContent.fadeIn = function(id,speed){
	if(!speed) speed = 400;
	tabContent.target.children().hide();
	tabContent.target.find('#'+id).fadeIn(speed);
}