﻿var svbUtils = {
    init: function() {
        // onload functions
    svbUtils.setEqualSpotHeight($j(".list .vt-33pct"));
        svbUtils.RemoveLastSN();
        svbUtils.RemoveEmptys();
        svbUtils.editmodeOverlays();

    },
    setEqualSpotHeight: function(group) {
        var tallest = 0;
        group.each(function() {
            var thisHeight = $j(this).height();
            if (thisHeight > tallest) {
                tallest = thisHeight;
            }
        });
        group.height(tallest);
    },
    RemoveLastSN: function() {
        $j(".valtechfooter .f-divider:last").css("display", "none");
        $j(".valtechtop li:last").css("padding-right", "0");
    },
    RemoveEmptys: function() {
        jQuery("p").each(function() {
            if ($j(this).innerHeight() == 0) {
                $j(this).remove();
            }
        });
        // empty div get lineheight on ie ( damm, da da dumb )
        jQuery("div.row").each(function() {
            if ($j(this).children().length < 1) $j(this).remove()
        });
    },
    editmodeOverlays: function() {
        $j('.scPageDesignerDropZone').each(function() {
            var parent = $j(this).parent();
            $j(this).css({
                height: parent.height(),
                width: parent.width(),
                position: 'absolute',
                top: 0,
                left: 0,
                background: '#f90',
                opacity: 0.5,
                'z-index': '1000'
            });
            parent.css({
                position: 'relative'
            });

        });

    }

};


$j(document).ready(function() {
    svbUtils.init();
});

