var tabs = new Array();
var loadedList = new Array();
var currentTab = '';
var currentPage = 0;
var pageLimit = 5;					//-- 1ページの表示数

$(function(){
	$.historyInit(chgView);
	
	$('#tabDetail a').click(function(){
		var hash = "list" + this.href;
		hash = hash.replace(/\?mode=print/, '');
		hash = hash.replace(/^.*#/, '');
		//alert(hash);
		$.historyLoad(hash);
		this.blur();
		return false;
	});
	
});

//-- 表示切り替え
function chgView(hash){
	var page = 1;
	if (!hash){
		viewReset();
		return false;
	}
	if (hash.indexOf("-") != -1){
		var ary = hash.split('-');
		hash = ary[0];
		page = parseInt(ary[1]);
	}
	if (hash != currentTab){
		chgTab(hash);
		currentTab = hash;
	}
	currentPage = page;
	//$("#view").append('<div id="loading">Loading...</div>');
	//$.get("./"+hash+".csv", viewCsv);
}
//-- タブ表示切り替え
function chgTab(hash){
	$("#tabDetail a").removeClass();
	$("#tabDetail #tab_" + hash + " a").addClass("select");			
	$("#list-view ul").removeClass();
	$("#list-view #list_" + hash).addClass("show");
	$("#list-view p#next-words").remove();
	$("#list-view p#prev-words").remove();
	$("#list-view ul").css("margin-top","0");
	$("#list-view #slider_" + hash).css("top","0");
	$("#list-view #slider_" + hash).easySlider({
			prevId: 'prev-words',
			prevText: '前へ',
			nextId: 'next-words',	
			nextText: '次へ',		
			firstShow: false,
			lastShow: false,
			vertical: true, 
			continuous: false,
			itemNum: 2,
			btnHeight: 11
		});		
}
//-- 表示リセット
function viewReset(){
	chgTab('wordsA');
}

