﻿function openFinancement() {
    $.fancybox({
        'type': 'inline',
        'href': 'financement.htm'
    });
    return false;
}

function openPhone() {
    $.fancybox({
        'type': 'inline',
        'href': 'telephone.htm'
    });
    return false;
}

function openDpe(reference, nature) {
    $.ajax({
        type: "GET",
        cache: false,
        url: "dpe.aspx",
        data: "reference=" + reference + "&nature=" + nature,
        success: function (msg) {
            var img = $(msg).find("img").length;
            if (img > 0) {
                $.fancybox({
                    'content': msg
                });
            }
        }
    });
    return false;
}

function openMentions() {
    $.fancybox({
        'type': 'inline',
        'href': 'mentions-legales.htm',
        'autoDimensions': false,
        'height': '300'
    });
    return false;
}

$(document).ready(function () {
    $("a.lightbox").fancybox();

    $("a.swap").mouseenter(function () {
        $("#photo").attr("src", $(this).attr("href"));
    });

    $("li.link_hover").hover(
    function () {
        $(this).children("ul").show();
    }, function () {
        $(this).children("ul").hide();
    });
});
