$(document).ready(function () {
    //  Bind All Main Menu Links - MouseOver:
    $('div.block_content ul.menu_main .p_trigger').each(function () {
        $(this).bind('mouseover', function () {
            return popupMainMenuFoldOut(this, 'show');
        });
    });
    //  Bind All Main Menu Links - MouseOut:
    $('div.block_content ul.menu_main .p_trigger').each(function () {
        $(this).bind('mouseout', function () {
            return popupMainMenuFoldOut(this, 'hide');
        });
    });

    //  Bind Situations Menu Link (Homepage):
    $('div.block_situations_home .a_trigger').each(function () {
        $(this).bind('click', function () {
            return popupSituationsFoldOut(this);
        });
    });
    //  Bind Vacancies Menu Link (Portal Werken):
    $('div.block_vacancies_portal .a_trigger').each(function () {
        $(this).bind('click', function () {
            return popupVacanciesFoldOut(this);
        });
    });

    //  Bind Related Faq Links:
    $('p.faq_item .f_trigger').each(function () {
        $(this).bind('click', function () {
            return toggleFaqDescription(this);
        });
    });

    //  Input Fields:
    $('input.input_requestcall_name').bind('click', function () {
        if ($(this).val() == 'Uw naam' && !$(this).data('placeholder')) {
            $(this).val('')
            $(this).data('placeholder', true);
        }; return false;
    }).val('Uw naam').attr("title", "");
    $('input.input_requestcall_phonenumber').bind('click', function () {
        if ($(this).val() == 'Telefoonnummer' && !$(this).data('placeholder')) {
            $(this).val('')
            $(this).data('placeholder', true);
        }; return false;
    }).val('Telefoonnummer').attr("title", "");
    $('input.input_omringlocal_zipcode').bind('click', function () {
//        if ($(this).val() == 'Postcode' && !$(this).data('placeholder')) {
        if ($(this).val() != '' && !$(this).data('placeholder')) {
            $(this).val('')
            $(this).data('placeholder', true);
        }; return false;
    //}).val('Postcode').attr("title", "");
    }).attr("title", "");
    $('.fldset_search .box input.input_search').bind('click', function () {
        if ($(this).val() == 'Zoeken' && !$(this).data('placeholder')) {
            $(this).val('')
            $(this).data('placeholder', true);
        }; return false;
    }).val('Zoeken').attr("title", "");


    // Tell a friend:
    $('li.tellafriend a').bind('click', function () {
        return popupTellAFriend(this.href);
    });

    // 'Wat kan Omring doen?' List Items:
    $('ul.omringhelp li').each(function () {
        $(this).bind('mouseover', function () {
            return $(this).attr('class', 'active');
        });
        $(this).bind('mouseout', function () {
            return $(this).removeAttr('class');
        });
    });
    // 'Wat kunt u regelen?' List Items:
    $('ul.selfhelp li').each(function () {
        $(this).bind('mouseover', function () {
            return $(this).attr('class', 'active');
        });
        $(this).bind('mouseout', function () {
            return $(this).removeAttr('class');
        });
    });

    //  Init. PhotoViewer Buttons:
    $('div.photoBookContainer div.photoBookImage img.btnPrev').each(function () {
        $(this).bind('click', function () {
            swapPhotoBookImage(this, 'prev');
        });
    });
    $('div.photoBookContainer div.photoBookImage img.btnNext').each(function () {
        $(this).bind('click', function () {
            swapPhotoBookImage(this, 'next');
        });
    });

    //  Mark External Links:
    add_external_links();
});
