$(document).ready(function() {

    //check if there is an image, by testing the length of the returned jQuery object:
    if ($(".header img").length > 0) {
        $(".pageHome").addClass("smalldiv");
    } 


    //Suckerfish DropdownMenu
    sfHover = function() {
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function() {
                this.className += " sfhover";
            }
            sfEls[i].onmouseout = function() {
                this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
    }
    if (window.attachEvent) window.attachEvent("onload", sfHover);



    //REPLACE HR TAG
    $(".fckContent hr").wrap("<div class='replaceHr'></div>");
    $("hr.top").wrap("<div class='replaceHrtop'></div>");
    $("hr.bottom").wrap("<div class='replaceHrbottom'></div>");


    //OVERLAY
    $('#basicModal a.reacties').click(function(e) {
        e.preventDefault();
        $('#reactiesModalContent').show();
    });
    $('#basicModal a.nieuwsbrief').click(function(e) {
        e.preventDefault();
        $('#nieuwsbriefModalContent').modal();
    });

    //HOME PRODUCT NAVIGATIE UITKLAP CONTROL
    $('.productlist ul li div').hide();
    $('.productlist ul li').hover(function() {
        var i = $('.productlist ul li').index(this);
        $('.productlist ul li div').eq(i).show();
        $('.productlist ul li div').click(function() {
            var i = $('.productlist ul li div').index(this);
            var currentHref = $('.productlist ul li a').eq(i).attr('href');
            document.location = currentHref;
        });
    }, function() {
        var i = $('.productlist ul li').index(this);
        $('.productlist ul li div').eq(i).hide();
    });

    //SHOW PRINT
    $('.print').prepend('<a href="#Print"><img src="../Themes/default/images/ico-print.gif" /></a>');
    $('.print a').click(function() {
        window.print();
        return false;
    });

});

NewsComments = {
    add: function(newsId) {
        $('#reactiesModalContent').modal();
        return false;
    }
}

