﻿var tourmax = 0;
var idx = 1;
function tourprev(max) {
    tourmax = max;
    idx--;
    tour();
}
function tournext(max) {
    if (idx == 0) idx = 1;
    tourmax = max;
    idx++;
    tour();
}
function tour() {
    if (idx <= 1) jQuery("#tourprev").attr("disabled", "disabled");
    else jQuery("#tourprev").removeAttr("disabled");
    if (idx >=tourmax) jQuery("#tournext").attr("disabled", "disabled");
    else jQuery("#tournext").removeAttr("disabled");
    
    if (idx < 1) idx = 1;
    else if(idx>tourmax) idx = tourmax;

    jQuery(".tour_msg").hide();
    jQuery("#firstDiv").hide();
    jQuery("#tour_msg" + idx).show();
    jQuery("#tour_page").text(idx);
}

function tourCleanup() {
    idx = 1;
}
