﻿
/**
* Fancy script sets up the page and runs the code in the div.js elements
*/
$(function() {

    $('.eventhm').bt({
        padding: 10,
        spikeLength: 10,
        spikeGirth: 8,
        margin: 1,
        closeWhenOthersOpen: true,
        cornerRadius: 10,
        fill: 'rgba(100,102,102,.8)',
        strokeWidth: 3,
        offsetParent: 'body',
        strokeStyle: '#fff',
        cssStyles: { color: '#FFF' }

    });
    $(".helpAnchor").bt({
        padding: 15,
        spikeLength: 20,
        spikeGirth: 20,
        margin: 1,
        closeWhenOthersOpen: true,
        contentSelector: "$(this).next()",
        cornerRadius: 10,
        fill: 'rgba(100,102,102,.8)',
        strokeWidth: 3,
        offsetParent: 'body',
        strokeStyle: '#fff',
        trigger: ['mouseover', 'click'],
        cssStyles: { color: '#FFF' },
        showTip: function(box) {
            var toolTip = $(this).next().html();
            if (toolTip != "") {
                $(box).show();
            }
        }

    });





    var myLayout;
    $(".helpAnchor").click(function() {
        if ($(this).next().next().html() != "") {
            // alert("in");

            $("#divPaneMainContent").attr("class", "pane ui-layout-north ui-layout-pane ui-layout-pane-north");
            $("#divPaneMainContent").attr("class", "pane ui-layout-center ui-layout-pane ui-layout-pane-center");
            $("#divHelpContent").html($(this).next().next().html());
            if ($.browser.msie) {
                $("#divContent").css("width", "99%"); // Add width for IE.
            }
            myLayout = $('#panecontainer').layout({ resizable: true, hideTogglerOnSlide: false, north_maxHeight: '100px', north: { size: 100 }
            });

            myLayout.open('north');
            myLayout.show('north', true);
            // alert("out");
        }
        else {
            myLayout.hide('north');
        }
    });
    $(".target").click(function() {



        $("#divPaneMainContent").attr("class", "pane ui-layout-north ui-layout-pane ui-layout-pane-north");
        $("#divPaneMainContent").attr("class", "pane ui-layout-center ui-layout-pane ui-layout-pane-center");
        $("#divPaneTop").html($(this).next().next().html());


        myLayout = $('#panecontainer').layout({ resizable: false, north_maxHeight: '100px', north: { size: 100 }
        });
        myLayout.show('north');


    });


    $("#ancHelpPanelClose").click(function() {
        myLayout.hide('north');
    });

});

