var imoveis = 
{
    init: function()
    {
        imoveis.more();
    },

    more: function()
    {
        $('#real-states-list a.rep').css({width: 33});
        $('#real-states-list a.rep').hover(function(){
            $(this).animate({width: 370},{queue:false,duration:300,easing:'easeInOutQuad'});
        },function(){
            $(this).animate({width: 33},{queue:false,duration:300,easing:'easeInOutQuad'});
        });
        
        
        
        
        $('aside a').hover(function(){
            $(this).animate({paddingLeft: 15, letterSpacing: 1.5},{queue:false,duration:200,easing:'easeInOutQuad'});
        },function(){
            $(this).animate({paddingLeft: 8 , letterSpacing: .5},{queue:false,duration:200,easing:'easeInOutQuad'});
        });
        
        
        
        $(window).scroll(function(){ 
              var height = $(document).height();
              var top = $(this).scrollTop();
              
              var headerHeight = 240;
              var footerHeight = 720;
              
              var duration = 600;

              if(top > headerHeight && (top<(height-footerHeight)))
              {
                  $('#aside').animate({top:top},{queue:false, duration: duration, easing: 'easeOutQuad'});
              }else if(top<headerHeight) {
                  $('#aside').animate({top:headerHeight},{queue:false, duration: duration, easing: 'easeOutQuad'});
              }

				//console.log("top - " + top);
				//console.log("headerHeight - " + headerHeight);

              
              
        });
        
    }
};



$(document).ready(function() {
    imoveis.init();
});
