function startDetailJS() {
    $('.body').css('margin-left', '310px');
    $('#corporateMenu').fadeIn(1500);
    $('.col:not(#home .col)').css('position', 'absolute').css('top', $(this).scrollTop() + "px");
    $(window).scroll(function() {
        $('.news').css('bottom', 10 - $(this).scrollTop() + "px");
        $('#corporateMenu').css('bottom', 0 - $(this).scrollTop() + "px");
        $('#sidemenu').css('bottom', 0 - $(this).scrollTop() + "px");
        /*$('.body').css('margin-left', '310px');*/
        /*$('.col:not(#home .col)').css('position', 'absolute').css('top', $(this).scrollTop() + "px");*/
    });
    $('.news img').hoverIntent({interval: 20, timeout: 1000, over: function() { buttonIn(); }, out: function() { buttonOut(); }});
    $('#sectionMenu').hoverIntent({interval: 20, timeout: 1000, over: function() { logosIn(); }, out: function() { logosOut(); }});
    $('#newslink').fancybox({'frameWidth': 600, 'hideOnContentClick': false});
    $('.ReceiveNewsletter .FormFieldSubscribe input').click(function(event) {
        var elm = $(this).parents('.ReceiveNewsletter');
        var count = 0;
        var interval = window.setInterval(function() {
            if ($('.FormFieldSubscribe', elm).length == 0) {
                window.clearInterval(interval);
                window.setTimeout(function() {
                    cancelNewsletter();
                    $('#newsletterButton').slideUp();
                }, 2000);
            }
            count++;
            if (count > 30) window.clearInterval(interval);
        }, 500);
    });
    $('.ContentItemMilestone .ContentImagesGalleryThumbLink').click(function() {
        var item = this;
        window.setTimeout(function() {
            $(item).closest('.ContentItem').find('.ContentImage').fadeIn(1000);
        }, 500);
    });
}

var isInButton = false;
var isInMenu = false;
var isInLogos = false;

function buttonIn() {
}
function menuIn() { isInMenu = true; }
function logosIn() { isInLogos = true; }

function buttonOut() { isInButton = false; mouseOut(); }
function menuOut() { isInMenu = false; mouseOut(); }
function logosOut() { isInLogos = false; mouseOut(); }
function mouseOut() {
}

function showNews(html) {
    $('#newsdata').html('<div class="fancynews">' + html + '</div>');
    $('#newslink').click();
}

function startNewsletter() {
    $('.col .stock').slideUp();
    $('.ReceiveNewsletter').slideDown();
}

function cancelNewsletter() {
    $('.col .stock').slideDown();
    $('.ReceiveNewsletter').slideUp();
}
