﻿// JScript File

$(document).ready( function () 
{
   $('.imageThumb').mouseover( function ()
    {
        mouse_roll( $( this ).parent().parent() );
        $(this).parent().find('.details img').fadeIn('fast');
    });
    
    $('.imageThumb').mouseout( function ()
    {
        mouse_roll( $(this).parent().parent() );
        $(this).parent().find('.details img').fadeOut('fast');
    });
    
    $('.buildings_description p').mouseover( function () 
    {
        mouse_roll( $(this).parent().parent().parent() );
    });
    
    $('.buildings_description p').mouseout( function () 
    {
        mouse_roll( $(this).parent().parent().parent() );
    });
    
    // image click correction
    
    $('.buildings_description').click( function ()
    {
        window.open( $(this).find('a')[0].href, '_self');
    });
    
    correctionMoreDetails();
});

function correctionMoreDetails ()
{
    // image position correction when title breaks line...
    var len = $('.blue_title').length;
    var element = '';
    
    for ( i=0; i < len; i++ )
    {
        element = $( '.blue_title:eq(' + i + ')' );
        
        if ( element.height() > 13 ) 
        {
            element.parent().parent().find('.details img').css('top', '-131px');
            
            if( $.browser['msie'] ) 
            {
                element.parent().parent().find('.details img').css('margin-top','-141px');
            }
        }
    }
}