//------------------------------------------------------------------------------- // global variables. var gCurrPage; var gFirstPage; var gLastPage; var gsFName; var gsExtName; var gbContents; var gsTitle = ""; var gsLink = ""; var gsTarget = ""; var gNextImg = new Array; var gFfwdImg = new Array; var gRewImg = new Array; var gPrevImg = new Array; var gHstFwdImg = new Array; var gHstBwdImg = new Array; var gSepImg = new Image; gNextImg[0] = new Image; gNextImg[1] = new Image; gFfwdImg[0] = new Image; gFfwdImg[1] = new Image; gRewImg[0] = new Image; gRewImg[1] = new Image; gPrevImg[0] = new Image; gPrevImg[1] = new Image; gHstFwdImg[0] = new Image; gHstFwdImg[1] = new Image; gHstBwdImg[0] = new Image; gHstBwdImg[1] = new Image; var gnHstList = new Array; var gnCurrHstPos; //------------------------------------------------------------------------------- function updateBar(pageNum) { var rewPrevIcon = 0; var ffwdNextIcon = 0; var hstFwdIcon = 0; var hstBwdIcon = 0; if(gFirstPage != gLastPage) { if(pageNum == gFirstPage) ffwdNextIcon = 1; else if(pageNum == gLastPage) rewPrevIcon = 1; else if(pageNum > gFirstPage || pageNum < gLastPage) { rewPrevIcon = 1; ffwdNextIcon = 1; } } document.next.src = gNextImg[ffwdNextIcon].src; document.ffwd.src = gFfwdImg[ffwdNextIcon].src; document.rew.src = gRewImg[rewPrevIcon].src; document.prev.src = gPrevImg[rewPrevIcon].src; if(gnCurrHstPos > 0) hstBwdIcon = 1; if(gnHstList[gnCurrHstPos + 1] > 0) hstFwdIcon = 1; document.hstfwd.src = gHstFwdImg[hstFwdIcon].src; document.hstbwd.src = gHstBwdImg[hstBwdIcon].src; } //------------------------------------------------------------------------------- function goHstBwd() { var pageNum; if(gnCurrHstPos > 0) { gnCurrHstPos = gnCurrHstPos - 1; pageNum = gnHstList[gnCurrHstPos]; updatePage(pageNum); updateContents(pageNum); updateBar(pageNum); gCurrPage = pageNum; } } //------------------------------------------------------------------------------- function goHstFwd() { var pageNum; if(gnHstList[gnCurrHstPos + 1] > 0) { gnCurrHstPos = gnCurrHstPos + 1; pageNum = gnHstList[gnCurrHstPos]; updatePage(pageNum); updateContents(pageNum); updateBar(pageNum); gCurrPage = pageNum; } } //------------------------------------------------------------------------------- function goFirstPage() { openPage(gFirstPage); } //------------------------------------------------------------------------------- function goLastPage() { openPage(gLastPage); } //------------------------------------------------------------------------------- function goPrevPage() { var pageNum = gCurrPage - 1; if(pageNum < gFirstPage) return; openPage(pageNum); } //------------------------------------------------------------------------------- function goNextPage() { var pageNum = gCurrPage + 1; if(pageNum > gLastPage) return; openPage(pageNum); } //------------------------------------------------------------------------------- function openPage(pageNum) { if(pageNum >= gFirstPage && pageNum <= gLastPage) { gnCurrHstPos = gnCurrHstPos + 1; gnHstList[gnCurrHstPos] = pageNum; gnHstList[gnCurrHstPos + 1] = 0; updatePage(pageNum); updateContents(pageNum); updateBar(pageNum); gCurrPage = pageNum; } } //------------------------------------------------------------------------------- function openPage2(pageNum) { if(pageNum >= gFirstPage && pageNum <= gLastPage) { gnCurrHstPos = gnCurrHstPos + 1; gnHstList[gnCurrHstPos] = pageNum; gnHstList[gnCurrHstPos + 1] = 0; updatePage(pageNum); updateBar(pageNum); gCurrPage = pageNum; } } //------------------------------------------------------------------------------- function updatePage(pageNum) { parent.main.location = gsFName + "_" + pageNum + gsExtName; } //------------------------------------------------------------------------------- function updateContents(pageNum) { if(gbContents == true) { if(parent.contents.gsName == "bookmark") parent.contents.updateTree(pageNum); else if(parent.contents.gsName == "index") { parent.contents.setIcon(gCurrPage, 0); parent.contents.setIcon(pageNum, 1); } } } //------------------------------------------------------------------------------- function initialize() { var nIconNum; if(gFirstPage == gLastPage) nIconNum = 0; else nIconNum = 1; // initialize history. gnCurrHstPos = 0; gnHstList[gnCurrHstPos] = gFirstPage; gnHstList[gnCurrHstPos + 1] = 0; document.writeln('
'); document.write(' | '); } else document.write(' | '); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.writeln(' | '); if(gsTitle.length > 0) { document.writeln(''); if(gsLink.length > 0) { document.write(' 0) document.write(' target="' + gsTarget + '">'); else document.write(' target="_blank">'); } document.write('' + gsTitle + ''); if(gsLink.length > 0) document.write(''); document.writeln(' | '); } document.writeln(' |