// JavaScript Document


// Для открытия картинок в галереии MooFlow
function openImage(way){
    flashLightbox(way[0],way[1]);

}

function openRoadmap() {
    flashLightbox("images/contacts/roadmap.big.jpg", "Схема проезда к коттеджному поселку Суходольское");

    return false;
}

function showDescription(data){

    var number = jQuery(data.currentTarget).attr("name");

    jQuery('.map-description[name='+number+']').show();

}

function hideDescription(data){

    var number = jQuery(data.currentTarget).attr("name");

    jQuery('.map-description[name='+number+']').hide();

}





jQuery(document).ready(function () {



    jQuery.noConflict(); // jQuery  MooTools (MooFlow)


    jQuery('.map-marker').bind('mouseover', showDescription );
    jQuery('.map-marker').bind('mouseout',  hideDescription );

    jQuery('#slides').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });




    jQuery('#section_slider').loopedSlider();

    jQuery('a.fancybox').fancybox({

        nextEffect:'fade',
        prevEffect:'fade',
        closeClick: true,
        helpers: {
            title: {
                type: 'inside'
            }
        }
    });


    var mf = new MooFlow($('MooFlow'));

    $$('.loadjson').addEvent('click', function(){
        mf.loadJSON(this.get('href'));
        return false;
    });


    jQuery('#main_paragraph').jTruncate();

    jQuery('#yandex_map_paragraph').jTruncate({
        length: 1400
    });
    jQuery('.truncable_paragraph').jTruncate({
        length: 1000
    });
    jQuery('.cottage_project p').jTruncate({
        length: 600
    });



});
