(function(jq){

    jq(document).ready(function() {

        var options = {
            close: true,
            animate: false
        }
        
        jq('a.lb').box(options);
        
        jq.fn.box.getFlashSize = function(elem) {
            return [640, 400];
        }; 
        
        
        jq('.hasToggle div').filter(function() {
            return this.className.search(/hr|toggle|blueBox/g) === -1; 
        }).hide();
        
        jq('.hasToggle h4').click(function() {
            var div = jq(this).next();
            if (div.hasClass('active')) {
                div.removeClass('active').slideUp();
                jq('span', this).css({backgroundPosition: 'left top'});
            } else {
                div.addClass('active').slideDown();
                jq('span', this).css({backgroundPosition: 'left bottom'});
            };
            return false;
        });
        
        
        // CMS hack layout hack;
        jq('.doubleColumn').each(function() {
            if (jq(this).children('img').length === 0) {
                jq(this).children().css("width", "100%");
            };
        });
        
    });
})(jQuery);

