function getPage(tip){
	var  filename=location.href;
	filename=filename.substr(filename.lastIndexOf('/')+1); 
	prefname=filename.substr(0,filename.lastIndexOf('.'));
	attrv = prefname.split('_');
	if (typeof(attrv[tip]) == 'undefined')
	{
		return 1;
	} else {
		return attrv[tip];
	}
}
function gprev(){
	if(nowPage==2){
		window.location.href = location.href.substring(0,location.href.lastIndexOf("/"))+'/'+getPage(0)+ '.shtml';
	}
	if(nowPage>2){
		window.location.href = location.href.substring(0,location.href.lastIndexOf("/"))+'/'+getPage(0)+'_'+ (parseInt(getPage(1))-1)+ '.shtml';
	}
}

function gnext(){
	var nexturl = document.getElementById("center").lastChild.lastChild.href;
	if (window.location.href != nexturl) {
		window.location.href = location.href.substring(0,location.href.lastIndexOf("/"))+'/'+getPage(0)+'_'+ (parseInt(getPage(1))+1)+ '.shtml';
	}
} 

function jumpPage(e){
	//if (( e ? e.which :event.keyCode)==13) window.location.href = location.href.substring(0,location.href.lastIndexOf("/"))+getPage(0)+'_'+getPage(1)+ '.shtml';
	if (( e ? e.which :event.keyCode)==37) { 
		gprev();
	}
	if (( e ? e.which :event.keyCode)==39) { 
		gnext();
	}
}

var nowPage = getPage(1);
document.onkeydown=jumpPage; 