var Ajax=new CAjax();
function CAjax(){this.currentLocation="section:page_0";
}CAjax.prototype.initHistory=function(){dhtmlHistory.initialize();
dhtmlHistory.addListener(handleHistoryChange);
var initialLocation=dhtmlHistory.getCurrentLocation();
if(initialLocation==null||initialLocation.length==0){dhtmlHistory.add(this.currentLocation,Common.getValue("bookView"));
}else{handleHistoryChange(initialLocation,null);
}};
function handleHistoryChange(newLocation,historyData){if(newLocation==null||newLocation.length==0||newLocation==Ajax.currentLocation){return;
}var pageNo=newLocation.substring(newLocation.lastIndexOf("_")+1);
Book.changePage("surah_"+pageNo,Book.pages[pageNo],pageNo);
}CAjax.prototype.addPageToHistory=function(){var location="section:page_"+Book.pageIndex;
dhtmlHistory.add(location,Common.getValue("bookView"));
this.currentLocation=location;
};

