var i = -1;
var clicked = false;

function previousPage() {
 // tf Top button was clicked, go back i pages in history list
 // otherwise, go back one page in history list.
 if (clicked) history.go(i); else history.back();
}

function changeI() {
 // Top button was clicked, so decrement i
 // so that click won't be considered part of the history list
 i--;
 clicked = true;
}
