﻿function init(openclass) {
    $('#sliding-navigation li.sliding-element a').collapsor({ openClass: openclass });
    var dockOptions = { align: 'right', size: 150 };
    $('#rmenu').jqDock(dockOptions);


    $("#up").fontscale("#centermaintext", "up", { unit: "px", increment: 1 });
    $("#down").fontscale("#centermaintext", "down", { unit: "px", increment: 1 });
    $("#reset").fontscale("#centermaintext", "reset");


    $(".address").click(function () {
        //location.href = "http://maps.google.com/maps?q=" + $(this).text();
        window.open("http://maps.google.com/maps?q=" + $(this).text());
    });

    $(".prop_type").change(function () {
        if ($("#residencialmixedradiobutton").is(":checked")) {
            $("#residentialmixeddiv").show();
        } else {
            $("#residentialmixeddiv").hide();
        }
    });


    $(".applicant").click(function () {
        if ($(this).is(":checked")) {
            $("#applicanttable").hide();
        } else {
            $("#applicanttable").show();
        }
    });

    $(".coapplicant").click(function () {
        if ($(this).is(":checked")) {
            $("#coapplicanttable").hide();
        } else {
            $("#coapplicanttable").show();
        }
    });

    $("#residentialmixed").hide();
    $("#personaltable").hide();
    $("#refinance").hide();
    $("#renovation").hide();
    $("#residentialmixeddiv").hide();

    $(".perbus").change(function () {
        if ($(this).val().toString() == "entity") {
            $("#businesstable").show();
            $("#personaltable").hide();
            $("#residentialmixed").hide();
            $("#residentialmixeddiv").hide();
            $("#retailradiobutton").attr("checked", "checked");
        } else {
            $("#personaltable").show();
            $("#businesstable").hide();
            $("#residentialmixed").show();
        }
    });

    $(".proploan").change(function () {
        switch ($(this).val().toString()) {
            case "purchase":
                $("#purchase").show();
                $("#refinance").hide();
                $("#renovation").hide();
                break;
            case "refinance":
                $("#purchase").hide();
                $("#refinance").show();
                $("#renovation").hide();
                break;
            case "renovation":
                $("#purchase").hide();
                $("#refinance").hide();
                $("#renovation").show();
                break;
            case "other":
                $("#purchase").hide();
                $("#refinance").hide();
                $("#renovation").hide();
                break;
            default:
                break;
        }
    });
}
