var totalWidth = 0;

$(window).load(function() {
    $('#galeria #mask img').each(function() {
        totalWidth += $(this).width() + 1;
    });
    $('#galeria #mask').css("width", totalWidth -1);
    $('#galeria #mask ul li.gallery-icon:last img').css("marginRight", 0);
});


			$(window).load(function() {

			var pane = $('#galeria')
			
			pane.jScrollPane({showArrows: true,animateScroll:true, arrowRepeatFreq:150, arrowScrollOnHover: true});
				
			//var api = pane.data('jsp');
			
			//$('a.jspArrowRight').bind(
			//		'click',
			//		function()
			//		{
			//			// Note, there is also scrollByX and scrollByY methods if you only
			//			// want to scroll in one dimension
			//			api.scrollByX(0);
			//			return false;
			//		}
			//	);

			});
			
	

			$(window).load(function() {
			
				$('dl#comercial').mouseover(function() {
				  $('dl#comercial dd').stop(true, true).fadeIn('fast')  
				});
				
				$('dl.menu-proyectos').mouseleave(function() {
				  $('dl#comercial dd').stop(true, true).fadeOut('fast')
				});
				
				$('dl#vivienda').mouseover(function() {
				  $('dl#vivienda dd').stop(true, true).fadeIn('fast')  
				});
				
				$('dl#vivienda').mouseleave(function() {
				  $('dl#vivienda dd').stop(true, true).fadeOut('fast')
				});
				
				$('dl#corporativo').mouseover(function() {
				  $('dl#corporativo dd').stop(true, true).fadeIn('fast')  
				});
				
				$('dl#corporativo').mouseleave(function() {
				  $('dl#corporativo dd').stop(true, true).fadeOut('fast')
				});
				
				$('dl#concursos').mouseover(function() {
				  $('dl#concursos dd').stop(true, true).fadeIn('fast')  
				});
				
				$('dl#concursos').mouseleave(function() {
				  $('dl#concursos dd').stop(true, true).fadeOut('fast')
				});
				
			
				$('.info-trigger').mouseover(function() {
				  $('ul.post-meta').stop(true, true).fadeIn('fast', function() {
				    // Animation complete.
				  });
				});
				
				$('.info-trigger').mouseleave(function() {
				  $('ul.post-meta').stop(true, true).fadeOut('fast', function() {
				    // Animation complete.
				  });
				});
				
				
				$('p.trigger').mouseover(function() {
				    $('.hidden').stop().animate({
				        marginTop: '0'
				
				    }, 500, function() {
				        // Animation complete.
				    });
				});
			
			$('.hidden').mouseleave(function() {
			    $('.hidden').stop().animate({
			        marginTop: '480'
			
			    }, 500, function() {
			        // Animation complete.
			    });
			});
	
});

