// By Li Xin, MadBoy Computing 1998 for Team 20704, ThinkQuest Conest
// Version 1.05 Build 1421
// (C)Copyright Li Xin, 1998 All rights reserved.
var curtopidx=0;
var curchap=0;
lnks= new Object();
lnks[ 0]="beijingiee.htm";
lnks[ 1]="CGG1.htm";
lnks[ 2]="CGGWM.htm";
lnks[ 3]="CGGTH.htm";
lnks[ 4]="CGGZH.htm";
lnks[ 5]="CGGBH.htm";
lnks[ 6]="CGGBack.htm";
lnks[ 7]="CGGgrdn.htm";
lnks[ 8]="CTiantan.htm";
lnks[ 9]="CTTYQ.htm";
lnks[ 10]="CTTHQY.htm";
lnks[ 11]="CTTQND.htm";
lnks[ 12]="CTan1.htm";
lnks[ 13]="CTanBei.htm";
lnks[ 14]="CTanHall.htm";
lnks[ 15]="CBeiHai.htm";
lnks[ 16]="gwall.htm";
lnks[ 17]="CYhy1.htm";
lnks[ 18]="CYhyHill.htm";
lnks[ 19]="CYhyGe.htm";
lnks[ 20]="CYhyLake.htm";
lnks[ 21]="CYhy17.htm";
lnks[ 22]="CYhyLine.htm";
lnks[ 23]="CYhStory.htm";
lnks[ 24]="CYhSto1.htm";
lnks[ 25]="CYhSto2.htm";
lnks[ 26]="CYhSto3.htm";
lnks[ 27]="CYhSto4.htm";
lnks[ 28]="CYhSto5.htm";
lnks[ 29]="CYhSto6.htm";
lnks[ 30]="CYhSto7.htm";
lnks[ 31]="CYhSto8.htm";
lnks[ 32]="CYhSto9.htm";
lnks[ 33]="4Article.htm";
lnks[ 34]="CLG.htm";
lnks[ 35]="Ymmain.htm";
lnks[ 36]="Other.htm";
lnks[ 37]="cixi.htm";
lnks[ 38]="xinhai.htm";
lnks[ 39]="feedbacj.htm";
var cl=new Object();
cl[ 0]=1;
cl[ 1]=7;
cl[ 2]=4;
cl[ 3]=3;
cl[ 4]=1;
cl[ 5]=1;
cl[ 6]=6;
cl[ 7]=11;
cl[ 8]=1;
cl[ 9]=1;
cl[10]=1;
cl[11]=2;
cl[12]=1;
var co=new Object();
co[ 0]=0;
co[ 1]=0;
co[ 2]=0;
co[ 3]=0;
co[ 4]=0;
co[ 5]=0;
co[ 6]=0;
co[ 7]=0;
co[ 8]=0;
co[ 9]=0;
co[10]=0;
co[11]=0;
co[12]=0;
var langu=0; // Language: 0=English 1=Simpfiled Chinese 2=Traditional Chinese
// Total Chapters: 13(maxChapters=this number-1)
maxChapters=12;
// Total Topics: 40(maxTopics=this number-1)
maxTopics=39;
var msg="Foo";
function checknow(g){
	var j=-1;
	langu=g;
	chkwnd();
	for(i in cl){
		co[i]=cl[i]+j;
		j=j+cl[i];
	}
}
function Nextopic(){
	curtopidx++;
	// Multilingal Support
	if (curtopidx>maxTopics){
		switch ( langu ) {
			case 0 :
			msg="You have reached the last topic of this site, go to the first topic?";
			break;
			case 1 :
			msg="您已经到达了最后一个网页，要回到第一个吗？";
			break;
			case 2 :
			msg="眤竒笷程蔍璶材盾"
		}
		i=window.confirm(msg);
		if (i==true){
			curtopidx=1; curchap=1;
		}
		else curtopidx--;
	}
	if (curtopidx>=co[curchap]) curchap++;
	top.main.location.href=lnks[curtopidx];
}
function NextChap(){
	curchap++;
	if (curchap>maxChapters){
		switch ( langu ) {
			case 0 :
			msg="You have reached the last chapter of this site, go to the first chapter?";
			break;
			case 1 :
			msg="您已经到达了最后一个主题，要回到第一个吗？";
			break;
			case 2 :
			msg="眤竒笷程肈璶材盾"
		}
		i=window.confirm(msg);
		if (i==true){
			curchap=1;
		}
		else curchap--;
	}
	curtopidx=co[curchap-1]+1;
	top.main.location.href=lnks[curtopidx];
}
function Prevtopic(){
	curtopidx--;
	if (curtopidx<1){
		switch ( langu ) {
			case 0 :
			msg="You have reached the first topic of this site, go to the last topic?";
			break;
			case 1 :
			msg="您已经到达了第一个网页，要回到最后一个吗？";
			break;
			case 2 :
			msg="眤竒笷材蔍璶程盾"
		}
		i=window.confirm(msg);
		if (i==true){
			curtopidx=maxTopics;
			curchap=maxChapters;
		}
		else {curchap=1;curtopidx=1;}
	}
	if (curtopidx<co[curchap]) curchap--;
	top.main.location.href=lnks[curtopidx];
}
function PrevChap(){
	curchap--;
	if (curchap<1){
		switch ( langu ) {
			case 0 :
			msg="You have reached the last chapter of this site, go to the first chapter?";
			break;
			case 1 :
			msg="您已经到达了第一个主题，要回到最后一个吗？";
			break;
			case 2 :
			msg="眤竒笷材肈璶程盾"
		}
		i=window.confirm(msg);
		if (i==true){
			curchap=maxChapters;
		}
		else{
			curchap=1;
		}
	}
	curtopidx=co[curchap-1]+1;
	top.main.location.href=lnks[curtopidx];
}
