


$(function () {

    if ($('.featuredpropertyslider > div').length > 1) {
        $('.featuredpropertyslider').bxSlider({
            auto: true,
            pause: 5000
        });
    }

    $('.AvailableHomesToolsUIB').block({
        message: '<a href="' + $('.AvailableHomesToolsUIBLink').attr("href") + '">Click here<br>to view</a>',
        css: { padding: '20px', border: '0px', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'border-radius': '10px'
        }
    });

    $('.rotation').click(function () {
        $('.rotation').css("background", "#000");
        $('.rotation').html('<iframe width="612" height="344" src="http://www.youtube.com/embed/NJ1wLLfLWkg?hl=en&fs=1&autoplay=1&modestbranding=1&rel=0" frameborder="0" allowfullscreen></iframe>');
    });

    if ($('.AvailableHomesRotation > div').length > 100000) {

        var slider = $('.AvailableHomesRotation').bxSlider({
            auto: false,
            controls: false,
            pager: true
        });

        $('.AvailablePrev').click(function () {
            slider.goToPreviousSlide();
            return false;
        });

        $('.AvailableNext').click(function () {
            slider.goToNextSlide();
            return false;
        });


    }

    $('.content').equalHeights();

    $('input.prefill[type=text]').each(function () {
        $(this).val($(this).attr('defaultValue'));
    });

    $(".numberDollar").blur(function () {
        $(this).parseNumber({ format: "#,##0", locale: "us" });
        $(this).formatNumber({ format: "#,##0", locale: "us" });
    });

    $(".numberPerc0").blur(function () {
        $(this).parseNumber({ format: "0", locale: "us" });
        $(this).formatNumber({ format: "0", locale: "us" });
    });

    $(".numberPerc1").blur(function () {
        $(this).parseNumber({ format: "0.0", locale: "us" });
        $(this).formatNumber({ format: "0.0", locale: "us" });
    });

    $(".numberPerc2").blur(function () {
        $(this).parseNumber({ format: "0.00", locale: "us" });
        $(this).formatNumber({ format: "0.00", locale: "us" });
    });



    $('.shortform input[type=text]').focus(function () {
        if ($(this).val() == $(this).attr('defaultValue')) {
            $(this).val('');
            $(this).addClass('darkerinputtext');
        }
    });

    $('.shortform input[type=text]').blur(function () {
        if ($(this).val() == '') {
            $(this).val($(this).attr('defaultValue'));
            $(this).removeClass('darkerinputtext');
        }
    });
});























