﻿
jQuery(document).ready(function() {
    //alert('t');
    jQuery(".tanContainer_maxHeight .insideBorder").each(function() {

        var $elem = jQuery(this).closest("td");
        var paddingWidth = 30;
        var borderWidth = 18;
        var height = $elem.height() - paddingWidth - borderWidth;

        jQuery(this).find("div:first").css("height", height + "px");
    });

    //sfButton
    jQuery(".sfButton").each(function() {
        var $vThis = jQuery(this);
        $vThis.wrapInner("<span class='sfButtonInner' />");
        $vThis.wrapInner("<span class='sfButtonMiddle' />");
        $vThis.wrapInner("<span class='sfButtonOuter' />");
    });

    try {
        //fullpane2 hack
        var fullPane1 = jQuery(".fullPane1");
        var fullPane2 = jQuery(".fullPane2");
        if (fullPane1.html().length > 0) {
            fullPane2.removeClass("DNNEmptyPane");
        }
    } catch (err) {
    }

    try {
        var v = jQuery.fn.lightBox();
    } catch (err) {
        
        var html = "<link id='lightboxfix_css' rel='stylesheet' type='text/css' href='/DesktopModules/SimpleGallery/module.css' /><script id='lightboxfix_js' type='text/javascript' src='/DesktopModules/SimpleGallery/js/lightbox/jquery.lightbox-0.4.pack.js?v=020413'></script>";
        jQuery("head").append(html);
        
        //custom lightbox
        jQuery('a[rel*=custom_lightbox]').lightBox({
            imageLoading: '/DesktopModules/SimpleGallery/images/lightbox/lightbox-ico-loading.gif',
            imageBtnPrev: '/DesktopModules/SimpleGallery/images/lightbox/lightbox-btn-prev.gif',
            imageBtnNext: '/DesktopModules/SimpleGallery/images/lightbox/lightbox-btn-next.gif',
            imageBtnClose: '/DesktopModules/SimpleGallery/images/lightbox/lightbox-btn-close.gif',
            imageBlank: '/images/spacer.gif',
            txtImage: 'Image',
            hideTitle: true,
            hideDescription: true,
            hidePaging: true,
            hideTags: true,
            hideDownload: true
        });
    }
});
