function showFloatInformation(number) {

    var linkPosition=$('.link.n'+number).position();

    var x = linkPosition.left+5;
    var y = linkPosition.top-130; 

    hideFloatInformation();
    var qFloatInformation=$('.houseSheme .wrap_window.n'+number);



    if(!qFloatInformation.hasClass('setHeight')) {

        if(qFloatInformation.find('.window').actual('height')>610) {
            qFloatInformation.addClass('scroll');
            qFloatInformation.height(677);   
        }
        
        qFloatInformation.height(qFloatInformation.actual('height'));                    
        qFloatInformation.addClass('setHeight');
    }


    var minX=0;
    var minY=28;
    maxX=$('.houseSheme .wrapper.clearfix').width();  
    maxY=$('.houseSheme .wrapper.clearfix').height();  

    //qFloatInformation.stop();    
    // qFloatInformation.fadeIn('50');

    topY=y;

    bottomY=y+qFloatInformation.actual('height');


    leftX=x;
    rightX=x+qFloatInformation.actual('width');

    if(maxX<rightX) x=maxX-qFloatInformation.actual('width')+10;
    if(minY>topY) y=minY;

    if(maxY<bottomY) {
        y=maxY-qFloatInformation.actual('height')+10;
    }

    qFloatInformation.css({'left':x,'top':y});

    qFloatInformation.show();

}


function hideFloatInformation() {
    //$('.wrap_window').stop();
    //$('.wrap_window:not(:animated)').fadeOut('50');
    $('.wrap_window').hide();
}

jQuery(function($){


    $('.link').mouseenter(function(e){
        regexp = /\d+/g;
        var out=regexp.exec($(this).attr('class'));
        showFloatInformation(out[0]);
    }).mouseleave(function(){
        hideFloatInformation();
    });

    $('.wrap_window').mouseenter(function(e){
        regexp = /\d+/g;
        var out=regexp.exec($(this).attr('class'));           
        showFloatInformation(out[0]);
    }).mouseleave(function(){
        hideFloatInformation();
    });

});
