		$(window).load(function() {
		
			var hanClicado = 0;
			
			$('#slider').galleria({
        		width:900,
        		height:480,
        		thumbnails: 'empty',
        		showImagenav: false,
        		showCounter: false,
        		showInfo: true,
        		imageMargin:0,
        		autoplay: 4000,
        		transition: 'fade',
        		extend: function(option) {
        			var gallery = this;
        			$(".navsections").click (function() {
        				var index = $("#navegacion ul li").index($(this));
        				
        				switch (index){
        					case 0:
        						gallery.show(0).pause().play(4000);
        						break;
        					case 1:
        						gallery.show(2).pause().play(4000);
        						break;
        					case 2:
        						gallery.show(4).pause().play(4000);
        						break;
        					case 3:
        						gallery.show(6).pause().play(4000);
        						break;
        					case 4:
        						gallery.show(8).pause().play(4000);
        						break;
        					default:
        						break;
        				}
        				
        				hanClicado = 1;
        				
        			});
        			
        			this.bind('loadfinish', function(e) {
						Cufon.replace('.galleria-info-description');
												
						var indexFoto = gallery.getIndex();
						
						var elementosMenu = $("#navegacion ul li");
						elementosMenu.css("background-position", "top");
						var indexMenu = Math.floor(indexFoto/2);
						elementosMenu.eq(indexMenu).css("background-position", "bottom");
						
        			});
        			
        			
        			this.bind('loadstart', function(e) {
						
						var indexFoto = gallery.getIndex();
						
						if ( (hanClicado == 1) && ((indexFoto % 2) == 0)){
							window.location = "http://www.wortmann-architects.com/Projects/";
						}
						
						
        			});
        			
        		}
    		});
		});
