var jg;
var pageImageDirLocation = "page_images/";
function initGraphics(){
    jg = new jsGraphics("documentImageArea");
    jg.setStroke(1);
    jg.setColor("#ff0000");
}

function highlightRect (highlight) {
    doHighlight (highlight.x, highlight.y, highlight.width, highlight.height);
}

function doHighlight(x, y, width, height) {
    jg.drawRect(x, y-2, width, height);
    jg.paint();
}

function scrollToXY(x,y){
    scrollTo(x, y);
}

function clearHighlights(){
    jg.clear();
}

function setPageImage (imageFile){
    imageFile = pageImageDirLocation + imageFile;
    if (document.pageImage != null){
        document.pageImage.src=imageFile;
    } else {
        pageImage.src=imageFile;
    }
}

