function SetHomePage(my) {
    my.style.behavior = 'url(#default#homepage)';
    my.setHomePage('http://www.absoluteodds.com/');
}

function SetBookmark(my) {
    window.external.AddFavorite(location.href, document.title);
}

$(document).ready(function () {

    InitBoxSlide();

    InitNotifications();

    InitGraphs();

});

function pageLoad(sender, args) {

    InitWYSIWYG();

}

/* *********************************************************************
* WYSIWYG
* *********************************************************************/
function InitWYSIWYG() {
    $('.jwysiwyg').wysiwyg({
        controls: {
            strikeThrough: { visible: true },
            underline: { visible: true },

            separator00: { visible: true },

            justifyLeft: { visible: true },
            justifyCenter: { visible: true },
            justifyRight: { visible: true },
            justifyFull: { visible: true },

            separator01: { visible: true },

            indent: { visible: true },
            outdent: { visible: true },

            separator02: { visible: false },

            subscript: { visible: false },
            superscript: { visible: false },

            separator03: { visible: true },

            undo: { visible: true },
            redo: { visible: true },

            insertImage: { visible: false },
            insertTable: { visible: false },
            h1: { visible: false },
            h2: { visible: false },
            h3: { visible: false },

            separator06: { visible: false },

            separator04: { visible: true },

            insertOrderedList: { visible: true },
            insertUnorderedList: { visible: true },
            insertHorizontalRule: { visible: true },

            separator07: { visible: true },

            cut: { visible: true },
            copy: { visible: true },
            paste: { visible: true }
        },
        css: "/images/stylesheet/editor.css"
    });
}

/* *********************************************************************
* Notifications
* *********************************************************************/
function InitNotifications() {
    $('.notification .close').click(function () {
        $(this).parent().fadeOut(1000, function () {
            $(this).find('p').fixClearType();
        });
        return false;
    });
}

/* *********************************************************************
* Slide Box
* *********************************************************************/
function InitBoxSlide() {
    $('.box-slide-head').click(function (event) {

        tgt = $(event.target);
        if (tgt.hasClass('clickable')) {
            return;
        }

        body = $(this).next();

        if (!body.hasClass('box-slide-body')) {
            body = body.find('.box-slide-body');
        }
        //body = $(this).next('.box-slide-body');

        if (body.is(':visible')) {
            body.hide();
        }
        else {
            body.show();
        }

        return false;
    });
}

/* *********************************************************************
* Graphs
* *********************************************************************/
function InitGraphs() {
    $('.visualize1').visualize({
        'type': 'bar',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize2').visualize({
        'type': 'line',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize3').visualize({
        'type': 'area',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize4').visualize({
        'type': 'pie',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize-T1').visualize({
        'type': 'bar',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize-T2').visualize({
        'type': 'line',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize-T3').visualize({
        'type': 'area',
        'width': '872px',
        'height': '250px'
    });

    $('.visualize_dashboard').visualize({
        'type': 'bar',
        'width': '150px',
        'height': '100px'
    });
}
