﻿// for the colorbox (lightbox) effect on images
$(document).ready(function () {
    //Examples of how to assign the ColorBox event to elements
    $("a[rel='lightbox']").colorbox({scalePhotos: true, maxWidth: '90%', maxHeight: '90%', escKey: true, opacity: ".6" }); //all links with rel='lightbox' and image as child apply to this, background gets .6 opacity for body
});

// the following is used for expanding all arrows for open parents in dynamic menu if cookie is set
function showExpandedArrowsDown() {
    var node = ob_getFirstNodeOfTree();
    while (node != null) {
        if (ob_hasChildren(node)) {
            var dropDownElement = $(node.firstChild.firstChild);
            dropDownElement.removeClass('menuBulletDown');
            dropDownElement.addClass('menuBullet');
        }
        node = ob_getNodeDown(node, false);
    }

    var allExpandedNodesList = ob_getExpanded(null, false); // gets all expanded id's from menu
    var arrayIds = allExpandedNodesList.split(",");
    for (i = 0; i < arrayIds.length; i++) {
        if (arrayIds[i] != "") {
            var dropDownElement = $(document.getElementById(arrayIds[i]).firstChild.firstChild);
            dropDownElement.removeClass('menuBullet').addClass('menuBulletDown');
        }
    }
}

