﻿$(document).ready(function () {
    $(".submenu").slideToggle(0);
    $(".left.menu a").click(function () {
        $(this).toggleClass('active');
    });
    $("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 600,
        'speedOut': 200,
        'titlePosition': 'over',
        'overlayShow': true
    });
    $("a.tygbibliotek").fancybox({
        'width': 550,
        'height': 500,
        'type': 'iframe',
        'autoScale': 'false'
    });
    $("a.byggDinEgenSoffa").fancybox({
        'width': '95%',
        'height': '95%',
        'type': 'iframe',
        'autoScale': 'false',
        'scrolling': 'false'
    });
    $("a.komfort").fancybox({
        'width': 550,
        'height': 500,
        'type': 'iframe',
        'autoScale': 'false'
    });
    $("a.fullscreen").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 600,
        'speedOut': 200,
        'titlePosition': 'over',
        'overlayShow': true
    });
    equalCols('.productInfo', '.productIcons', -49);
});
function showMenu(divId) {
    thisPane = "#" + divId;
    $(thisPane).slideToggle("fast");
}
function clearField(theInput) {
    if (document.getElementById(theInput).defaultValue == document.getElementById(theInput).value) {
        document.getElementById(theInput).value = "";
    }
}
function equalCols(elem, offsetElem, offset) {
    var biggestHeight = 0;
    $(elem).each(function () {
        if ($(this).height() > biggestHeight) {
            biggestHeight = $(this).height();
        }
    });
    if ($.browser.msie) {
        offset += -11;
    }
    $(offsetElem).css("padding-top", biggestHeight + offset);
    $(offsetElem).css("padding-top", biggestHeight + offset);
}

