/*
    SiteComponents version:
    6.8.0.1, tag SC_6_8_0_1, created Fri Aug 20 11:18:33 +0200 2010

    Disclaimer
    
    While we make every effort to ensure that this code is fit for its intended
    purpose, we make no guarantees as to its functionality. CoreTrek AS will
    accept no responsibility for the loss of data or any other damage or
    financial loss caused by use of this code.


    Copyright
    
    This programming code is copyright of CoreTrek AS. Permission to run this
    code is given to approved users of CoreTrek's publishing system CorePublish.
    
    This source code may not be copied, modified or otherwise repurposed for use
    by a third party without the written permission of CoreTrek AS.
    
    Contact webmaster@coretrek.com for information.
    
*/

/**
 * Configuration for site components javascript
 *
 * Configuration array structure:
 * {<component>: {<parameter>: value, <parameter>: value, ... }, ...}
 */
var siteComponentsConfig = {
    
    // Configuration for the keyword module.
    
    keywords: {
        elements: ['placeholder-content'],
        skiptags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
        usetooltip: true
    }
    // Remember to add a comma above when enabling more options
    
    /*
    // Valid keys:
    //    disable: true/false (default enabled)
    //    collapsedPageInfoPosition: Use this to move the collapsed debug
    //                               position to the left, instead of the
    //                               default right.
    debug: {
        disable: true,
        collapsedPageInfoPosition: 'right'
    }
    */
    
    /*
    // Configuration for tooltop.
    // 
    // Valid keys:
    //    disable: true/false (default enabled)
    //    positionby: Use this to override the default position for tooltip.
    //                Valid values is:
    //                  mouse (default), tooltip follows mouse
    //                  element, tooltip is attached to the title element
    tooltip: {
        disable: false,
        positionby: 'mouse'
    }
    */
    
    /*
    // Use this to override the default fontsizes in the fontsize selector
    // (html/lib/fontsize.js)
    
    fontsize: {
        sizes: ["10pt", "15pt", "24pt"]
    }
    */
    
};

/**
*   Function that adds a wrapper div to all images that has a given classname
*
*   This wrapper div is added to be able to style these images the correct
*   way (see more comments in stylesheet), and is initially intended for images added
*   to WYSIWYG-editor in articles that are given a specific css class.
*/
function addImageWrapper(imgClassName) {
    // Get all img-divs in article displays with that class-name for left image
    var images = $$('img.'+imgClassName); 
    
    images.each(function(img) {
        img.wrap('div', { 'class': 'lefimage-wrapper' });
    });
}




// Add some general js functionality to content
document.observe('dom:loaded', function(event) { 
    // Add wrapper div to leftimages set in wysiwyg
    addImageWrapper('leftimage');
});















