$(document).ready(function(){

	/*============================= 首页广告 begin ===========================*/
	//顶通
	TxAD_ShowBaiduAD("Baidu_Book_TopAD1","http://x.itiexue.net/proxy.htm","41344","970","90");
	//通二
	TxAD_ShowBaiduAD("Baidu_Book_TopAD2","http://x.itiexue.net/proxy.htm","41346","970","90");
	//通三
	TxAD_ShowBaiduAD("Baidu_Book_TopAD3","http://x.itiexue.net/proxy.htm","41347","970","90");
	//底通
	TxAD_ShowBaiduAD("Baidu_Book_TopAD4","http://x.itiexue.net/proxy.htm","41349","970","90");
})

//点击排行
function ShowOrderPanel(obj,FirstPanel){
	$(obj).addClass("aHover");
	$(obj).siblings().removeClass();
	if (FirstPanel=='1'){
		$("#todaySort").show();
		$("#yerterdaySort").hide();
		$("#totalSort").hide();
	}
	if (FirstPanel=='2'){
		$("#todaySort").hide();
		$("#yerterdaySort").show();
		$("#totalSort").hide();
	}
	if (FirstPanel=='3'){
		$("#todaySort").hide();
		$("#yerterdaySort").hide();
		$("#totalSort").show();
	}
}

//新书
function ShowNewNovelPanel(obj,FirstPanel){
	$(obj).addClass("onClick");
	$(obj).siblings().removeClass();
	for(var i=1;i<5;i++){
		if(i==FirstPanel){
			$("#NewNovel_"+i).show();
		}
		else{
			$("#NewNovel_"+i).hide();
		}
	}
}


//全本书
function ShowEndNovelPanel(obj,FirstPanel){
	$(obj).addClass("onClick");
	$(obj).siblings().removeClass();
	for(var i=1;i<5;i++){
		if(i==FirstPanel){
			$("#EndNovel_"+i).show();
		}
		else{
			$("#EndNovel_"+i).hide();
		}
	}
}

var VIPIsShow=1;
function ShowAllNovelAndDiscuss(obj,panel){
	$(obj).addClass("onClick2");
	$(obj).siblings().removeClass();
	$("#allNovelPage").children().removeClass();
	$("#allNovelPage a:first").addClass("onClick");
	if(panel==1){
		VIPIsShow=1;
		$("#public").show();
		$("#vip").hide();$("#new").hide();$("#discuss").hide();
		ShowPager("public",1);
	}
	else if(panel==2){
		VIPIsShow=2;
		$("#public").hide();$("#new").hide();$("#discuss").hide();
		$("#vip").show();
		ShowPager("vip",1);
	}
	else if(panel==3){
		VIPIsShow=3;
		$("#public").hide();$("#vip").hide();$("#discuss").hide();
		$("#new").show();
		ShowPager("new",1);
	}
	else if(panel==4){
		VIPIsShow=4;
		$("#public").hide();$("#vip").hide();$("#new").hide();
		$("#discuss").show();
		ShowPager("discuss",1);
	}
	else{
	}
}
function TxNovelPagerChange(obj,PageIndex){
	$(obj).addClass("onClick");
	$(obj).siblings().removeClass();
	
	if (VIPIsShow==1){
		ShowPager("public",PageIndex);
	}
	else if (VIPIsShow==2){
		ShowPager("vip",PageIndex);
	}
	else if (VIPIsShow==3){
		ShowPager("new",PageIndex);
	}
	else if (VIPIsShow==4){
		ShowPager("discuss",PageIndex);
	}
	else{
	}
}
function ShowPager(name,pageIndex){
	for(var i=1;i<5;i++){
		if(i==pageIndex){
			$("#"+name+"_"+i).show();
		}
		else{
			$("#"+name+"_"+i).hide();
		}
	}
}

