$.fn.cluetip.defaults = {  // default options; override as needed
    height: 'auto',   // The height of the clueTip. more info below [1]
    cluezIndex: 200,       // Sets the z-index style property of the clueTip
    positionBy: 'fixed',   // Sets the type of positioning. more info below [2]
    topOffset: 0,       // Number of px to offset clueTip from top of invoking element. more info below [3]
    leftOffset: -500,       // Number of px to offset clueTip from left of invoking element. more info below [4]
    local: false,    // Whether to use content from the same page for the clueTip's body
    // (treats the attribute used for accessing the tip as a jQuery selector,
    // but only selects the first element if the selector matches more than one). more info below [5]
    hideLocal: true,     // If local option is set to true, this determines whether local content
    //  to be shown in clueTip should be hidden at its original location
    attribute: 'rel',    // the attribute to be used for fetching the clueTip's body content
    titleAttribute: 'title',  // the attribute to be used for fetching the clueTip's title
    splitTitle: '',       // A character used to split the title attribute into the clueTip title and divs
    // within the clueTip body. more info below [6]
    showTitle: true,     // show title bar of the clueTip, even if title attribute not set
    cluetipClass: 'default', // class added to outermost clueTip div in the form of 'cluetip-' + clueTipClass. more info below [7]
    hoverClass: '',       // class applied to the invoking element onmouseover and removed onmouseout
    waitImage: true,     // whether to show a "loading" img, which is set in jquery.cluetip.css
    arrows: false,    // if true, displays arrow on appropriate side of clueTip. more info below [8]
    dropShadow: false,     // set to false if you don't want the drop-shadow effect on the clueTip
    dropShadowSteps: 6,        // adjusts the size of the drop shadow
    sticky: true,    // keep visible until manually closed
    mouseOutClose: false,    // close when clueTip is moused out
    activation: 'click',  // set to 'click' to force user to click to show clueTip
    clickThrough: false,    // if true, and activation is not 'click', then clicking on a clueTipped link will take user to
    // the link's href, even if href and tipAttribute are equal
    tracking: false,    // if true, clueTip will track mouse movement (experimental)
    delayedClose: 0,        // close clueTip on a timed delay (experimental)
    closeText: "CLOSE <img src='" + root + "images/button-close.png' />",  // text (or HTML) to to be clicked to close sticky clueTips
    closePosition: 'title',    // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
    truncate: 0,        // number of characters to truncate clueTip's contents. if 0, no truncation occurs
    // effect and speed for opening clueTips
    fx: {
        open: 'show', // can be 'show' or 'slideDown' or 'fadeIn'
        openSpeed: ''
    },
    // settings for when hoverIntent plugin is used
    hoverIntent: {
        sensitivity: 3,
        interval: 50,
        timeout: 0
    },
    // function to run just before clueTip is shown.
    onActivate: function (e) { return true; },
    // function to run just after clueTip is shown.
    onShow: function (ct, c) { },
    // whether to cache results of ajax request to avoid unnecessary hits to server
    ajaxCache: true,
    // process data retrieved via xhr before it's displayed
    ajaxProcess: function (data) {
        data = $(data).not('style, meta, link, script, title');
        return data;
    },
    // can pass in standard $.ajax() parameters, not including error, complete, success, and url
    ajaxSettings: {
        dataType: 'html'
    },
    onHide: function (ct, c) { }
};

$(document).ready(function () {
    $(".modal").colorbox({
        scalePhotos: true,
        title: false,
        onOpen: function () {
            $("#cboxBottomLeft").removeClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").removeClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").removeClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").removeClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").removeClass("cboxMiddleRightSignIn");
        }
    });
    $(".localmodal").colorbox({
        scalePhotos: true,
        title: false,
        onOpen: function () {
            $("#cboxBottomLeft").removeClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").removeClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").removeClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").removeClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").removeClass("cboxMiddleRightSignIn");
        }
    });
    $(".externalmodal").colorbox({
        scalePhotos: true,
        initialWidth: 500,
        initialHeight: 500,
        width: 500,
        height: 500,
        title: false,
        iframe: true,
        onOpen: function () {
            $("#cboxBottomLeft").removeClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").removeClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").removeClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").removeClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").removeClass("cboxMiddleRightSignIn");
        }
    });
    $(".signinmodal").colorbox({
        scalePhotos: true,
        title: false,
        iframe: true,
        width: 500,
        height: 400,
        scrolling: false,
        onOpen: function () {
            $("#cboxBottomLeft").addClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").addClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").addClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").addClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").addClass("cboxMiddleRightSignIn");
        }
    });
    $(".itemmodal").colorbox({
        scalePhotos: true,
        title: false,
        onOpen: function () {
            $("#cboxBottomLeft").removeClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").removeClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").removeClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").removeClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").removeClass("cboxMiddleRightSignIn");
        },
        onComplete: function () {
            $("#cboxPhoto").aeImageResize({ height: 400 });
        },
        width: 600,
        height: 600,
        photo: false
    });

    $(".homevideo").colorbox({
        scalePhotos: false,
        title: false,
        onOpen: function () {
            $("#cboxBottomLeft").removeClass("cboxBottomLeftSignIn");
            $("#cboxBottomCenter").removeClass("cboxBottomCenterSignIn");
            $("#cboxBottomRight").removeClass("cboxBottomRightSignIn");
            $("#cboxMiddleLeft").removeClass("cboxMiddleLeftSignIn");
            $("#cboxMiddleRight").removeClass("cboxMiddleRightSignIn");
        },
        width: 790,
        height: 370,
        photo: false,
        iframe: true
    });

    if ($("#spotlight ul").exists()) {
        $("#spotlight ul").load("/cmspages/spotlight-en.aspx", function () {
            $("#spotlight a").each(function () {
                var a = $(this);
                a.attr("href", a.attr("href").replace("~", ""));
            });
        });
    }
});
