﻿var sdviewer = null;

function showHelp(){
    alert('Choose the view of the product you wish to see by clicking the thumbnail at the bottom.\n\nYou can zoom in or out by using the mouse wheel or the buttons at the bottom right.\n\nClick and drag the image to view the part of the product you wish to have a closer look at.');
}

function initSD() {
    sdviewer = new Seadragon.Viewer("seadragon-container");

    sdviewer.addControl(makeControl(), Seadragon.ControlAnchor.TOP_RIGHT);

}

function makeControl() 
{
    var control = document.createElement("a");
    var controlText = document.createTextNode("Help");
    control.href = "#";                 // so browser shows it as link
    control.className = "help-link";
    control.appendChild(controlText);
    Seadragon.Utils.addEvent(control, "click", showHelp);
    return control;
}





function switchTo(event, dzi) {
    if (dzi) {
        sdviewer.openDzi(dzi);
    } else {
        sdviewer.close();
    }


    Seadragon.Utils.cancelEvent(event);
}

Seadragon.Config.minZoomDimension = 300;
