

    $(document).ready(function(){

    if ( $("#slideshow a").length > 0 ) {
        $('#slideshow').cycle({
            prev:   '.slideshow_prev',
            next:   '.slideshow_next',
            timeout: 5000
        });
        /*$('#apartmant_images').cycle({
            prev:   '#prev',
            next:   '#next',
            timeout: 5000
        });*/
        $('#images_gallery a').lightBox({fixedNavigation:true});
    }



    $('body').hide(); $('body').fadeIn('slow');

    $("#apartmant_images_bubbles").hide();
    $("#apartmant_images_slide").hide();
    $("#apartmant_images_floor").hide();
    $("#apartmant_images_zoom").hide();

    if ( $("#apartmant_images_bubbles").length > 0 ) {
        $("#apartmant_images_bubbles").show();
        $("#is_bubbles").addClass('active');
        $("p#stan_img_status").text($("#is_bubbles a").html());
    } else {
        $("#apartmant_images_zoom").show();
        $("#is_zoom").addClass('active');
        $("p#stan_img_status").text($("#is_zoom a").html());
    }

    if ( $("#apartmant_images_floor").length == 0) {
        // alert($("#apartmant_images_floor").length);
        $("#is_floor").hide();
    }
    if ( $("#apartmant_images_zoom").length == 0) {
        // alert($("#apartmant_images_floor").length);
        $("#is_zoom").hide();
    }


    $("#stan_img_switch li a").click(function() {
       $("p#stan_img_status").text($(this).html());
       $("#stan_img_switch li").removeClass('active');
       $(this).parent().addClass('active');

    });

    $("#is_bubbles a").click(function() {
        $("#apartmant_images_bubbles").show();
        $("#apartmant_images_slide").hide();
        $("#apartmant_images_floor").hide();
        $("#apartmant_images_zoom").hide();

    });
    $("#is_floor a").click(function() {
        $("#apartmant_images_bubbles").hide();
        $("#apartmant_images_slide").hide();
        $("#apartmant_images_floor").show();
        $("#apartmant_images_zoom").hide();
    });
    $("#is_rotate a").click(function() {
        $("#apartmant_images_bubbles").hide();
        $("#apartmant_images_slide").show();
        $("#apartmant_images_floor").hide();
        $("#apartmant_images_zoom").hide();
        $('#apartmant_images_slide_1 .slide_holder1').cycle({
            timeout: 5000
        });
        $('#apartmant_images_slide_2 .slide_holder2').cycle({
            timeout: 5000
        });
        $('.slideshow_prev').show();
        // $('#apartmant_images_slide .slide_holder').cycle('pause');
/*            prev:   '#apartmant_images_slide_1 .slideshow_prev',
            next:   '#apartmant_images_slide_1 .slideshow_next',
            prev:   '#apartmant_images_slide_2 .slideshow_prev',
            next:   '#apartmant_images_slide_2 .slideshow_next',
*/

    });
    $("#is_zoom a").click(function() {
        $("#apartmant_images_bubbles").hide();
        $("#apartmant_images_slide").hide();
        $("#apartmant_images_floor").hide();
        $("#apartmant_images_zoom").show();

    });


    $("#apartment_by_floor").hide();

    $("#floor_toggle a").click(function() {
        $("#search_results").toggle();
        $("#apartment_by_floor").toggle();
        $(this).toggleClass("active");

    });

    $(".bubble_holder .bubble.grp").mouseover(function() {
        $(this).children().show();
        $(".bubble_holder .bubble.grp").addClass('active');
    });
    $(".bubble_holder .bubble.grp").mouseout(function() {
        $(this).children().hide();
        $(".bubble_holder .bubble.grp").removeClass('active');
    });


/*
    $(".bubble_holder .bubble").mouseover(function() {
            $(this).children().fadeIn('fast');
    });
    $(".bubble_holder .bubble").mouseout(function() {
            //$(this).children().show('slide');
            $(this).children().hide();
    });*/
/*    $(".bubble_holder .bubble_text").mouseout(function() {
            //$(this).children().show('slide');
            $(this).hide();
    });
*/

    // clearInput();
    // clearTextarea();
    // $(".lh").hide();


});
