﻿/// <reference path="~/Scripts/jquery-1.3.2-vsdoc.js"/>

var changing = true;
var setting = false;
var currentTab = 0;
var tabs = ["Simple", "SmallBusiness", "Portal", "Enterprise"];
$(function() {
    $.history.init(callback);
    $('#tabs').css("display", "").tabs({ selected: currentTab, show: function(event, ui)
    {
        var selected = $('#tabs').tabs('option', 'selected');
        if (!changing)
        {
            setting = true;
            $.history.load(tabs[selected]);
            setting = false;
        }
        else
            changing = false;
    }
    });
    $("#WYSIWYG").html("<img src='/Content/images/web/cms/surreal.png' alt='WYSIWYG' />").css("display", "");
    $("a.fancyZoom").fancyZoom({ directory: '/Content/images/fancyZoom' });
});
function callback(hash)
{
    currentTab = hash == "Simple" ? 0 : hash == "SmallBusiness" ? 1 : hash == "Portal" ? 2 : hash == "Enterprise" ? 3 : 0;
    if (setting) return;
    changing = true;
    $('#tabs').tabs('option', 'selected', currentTab);
    changing = false;
}
