
var curBookPage = 1;
var bookPage;

function clacPage() {
		if (booksCount <= 3) {
			bookPage = 1;
		} else if (booksCount <= 6) {
			bookPage = 2;
		} else {
			bookPage = 3;
		}
}


function firstPage() {
	document.getElementById('baodianContent1').style.display='block';
}

function prevBooks() {
		curBookPage = curBookPage - 1;
		
		if (curBookPage < 1) {
			curBookPage = bookPage - curBookPage;
		}
		colseBookDiv('baodianContent');
		document.getElementById('baodianContent' + curBookPage).style.display='block';
} 

function nextBooks() {
	curBookPage = curBookPage + 1;
	
	if (curBookPage > bookPage) {
		curBookPage = curBookPage - bookPage;
	}
	colseBookDiv('baodianContent');
	document.getElementById('baodianContent' + curBookPage).style.display='block';
}

function colseBookDiv(prefix) {
	var tmp = null;
	
	for (var i = 1; i <= bookPage; i++) {
		tmp = document.getElementById(prefix + i);
		if (tmp) {
			tmp.style.display = 'none';
		}
	}
}

var curShowPage = 1;
var showPage;
function clacShowPage(){
		if (showsCount <= 4) {
			showPage = 1;
		} else if (showsCount <= 8) {
			showPage = 2;
		} else {
			showsCount = 12;
		}
}
function prevShows() {
		curShowPage = curShowPage - 1;
		
		if (curShowPage < 1) {
			curShowPage = showPage - curShowPage;
		}
		colseShowDiv('showContent');
		document.getElementById('showContent' + curShowPage).style.display='block';
} 

function nextShows() {
	curShowPage = curShowPage + 1;
	
	if (curShowPage > showPage) {
		curShowPage = curShowPage - showPage;
	}
	colseShowDiv('showContent');
	document.getElementById('showContent' + curShowPage).style.display='block';
}

function colseShowDiv(prefix) {
	var tmp = null;
	
	for (var i = 1; i <= showPage; i++) {
		tmp = document.getElementById(prefix + i);
		if (tmp) {
			tmp.style.display = 'none';
		}
	}
}