
/* - ++resource++crojewe.familienkirchetheme2010.javascripts/familienkirche.js - */
jq(document).ready(function() {
    var purl = document.baseURI;
    
    jq("a:not(.colorbox)").not(".contentActions a").tooltip({ 
        showURL: false,
        extraClass: "tooltip",
        opacity: 0.65
    });
    jq(".colorbox").colorbox({close:'schliessen'});

    jq('span.magnify img, img.newsImage').each(function() {
        var href = purl+'/'+jq(this).attr('src');
        href = href.replace(/image\_.+$/, "image_large");
        jq(this).colorbox({href: href, photo:true, width: 800, title: jq(this).attr('alt'),
            close: 'schliessen'});
    })
    
    // sections color
    /* links in current section */
    jq('li.navTreeItemInPath a, li.navTreeCurrentNode a').css({'color': sectioncolordark, 'background-color': sectioncolorlight});
    /* top level link of current section */
    jq('li.navTreeItemInPath a.navTreeItemInPath, li.navTreeCurrentNode a.navTreeCurrentNode').css({'color': '#000000', 'background-color': sectioncolordark});
    /* current link */
    jq('li.navTreeItemInPath a.navTreeCurrentItem').css({'color': '#000000', 'background-color': sectioncolorlight, 'border': 'none'});

    jq('.portletHeader').css({'background-color': sectioncolordark});
    
    jq('div.newsImageContainer a')
        .prepOverlay({
             subtype:'image',
             urlmatch:'/image_view_fullscreen$',
             urlreplace:'_preview'
            });
    jq('img.image-right,img.image-left,img.image-inline')
        .prepOverlay({
            subtype:'image',
            urlmatch:'/image_.+$',
            urlreplace:''
            });
})

