	App = {
		execute: function() {	
			
			if ($('#small_movies')) {
				$('#small_movies img').each(function(index){
					$(this).bind('click', function() {
						$('#big_movie').html(movies[index]);
						return false;
					});
				});
			}
					
			App.hideContactBoxes();
			$('#contact_box_1').show();
			
			$('#logos li img').each(function(index){
				$(this).hover(
					function() {
						$('#logos li img').each(function(index){
							var src = $(this).attr('src');
							if (src.indexOf('_off') == -1) {
								src = src.replace('.png', '_off.png');
								$(this).attr('src', src);
							}
						});
						var src = $(this).attr('src');
						src = src.replace('_off.png', '.png');
						$(this).attr('src', src);
					},
					function () {
						var src = $(this).attr('src');
						src = src.replace('.png', '_off.png');
						$(this).attr('src', src);						
					}
				);
				$(this).bind('click', function(){
					App.hideContactBoxes();
					$('#contact_box_' + index).show();
					var src = $(this).attr('src');
					src = src.replace('_off.png', '.png');
					$(this).attr('src', src);
				});
			});
			
			$('a[href*=#]').click(function() {
				if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
					var $target = $(this.hash);
					return App.scrollTo($target);
				}
			});
			
			$('#accordion .head').click(function() {
				$('#accordion div.lead').hide();
				$('#accordion a.head').show();
				$(this).hide();
				$(this).next().toggle('slow');
					return false;
			}).next().hide();
			
			$('#accordion_news .head').click(function() {
				$('#accordion_news div.lead').hide();
				$('#accordion_news a.head').show();
				$(this).hide();
				$(this).next().toggle('slow');
					return false;
			}).next().hide();
			
			$('#accordion_careers .head').click(function() {
				$('#accordion_career div.lead').hide();
				$('#accordion_career a.head').show();
				$(this).hide();
				$(this).next().toggle('slow');
					return false;
			}).next().hide();
			
			$('.additional').hide();
			$('.show_additional').click(function(){
					$(this).next('p').slideToggle(600);
					$(this).hide();
					return false;
			});
			
			if ($('#swf_1')) {
				$('#swf_1').flash({
					swf: '/swf/EskadraRotationMenu.swf',
					width: 600,
					height: 600,
					wmode: 'transparent',
					menu: false,
					flashvars: {
						eskadra: '/eskadra,143',
						advertising: '/oferta,55',
						competence: '/oferta,57',
						opcom: '/oferta,52',
						events: '/oferta,59',
						market_place: '/oferta,61',
						pr: '/oferta,63'
					}
				});
			}
			
			if ($('#swf_2')) {
				$('#swf_2').flash({
					swf: '/swf/EskadraRotationMenu.swf',
					width: 600,
					height: 600,
					wmode: 'transparent',
					menu: false,
					flashvars: {
						eskadra: '/eskadra,143',
						advertising: '/oferta,55',
						competence: '/oferta,57',
						opcom: '/oferta,52',
						events: '/oferta,59',
						market_place: '/oferta,61',
						pr: '/oferta,63'
					}
				});
			}
			
			$('.details').each(function(){
				$(this).hover(
					function() {
						$(this).removeClass('details');
						$(this).addClass('details_hovered');
					},
					function() {
						$(this).removeClass('details_hovered');
						$(this).addClass('details');						
					}
				);
				$(this).click(function(){
					var url = $(this).attr('rel');
					window.top.location = url;
				});
			});
			
			

			
var galleries = $('.ad-gallery').adGallery({
  loader_image: 'loader.gif',
  width: 500,
  height: 400,
  thumb_opacity: 1,
                     
                     
  start_at_index: 0, 
  description_wrapper: false,
                             
  animate_first_image: false, 
  animation_speed: 400, 
  display_next_and_prev: false,
  display_back_and_forward: true,
  scroll_jump: 0,
  slideshow: {
    enable: true,
    autostart: false,
    speed: 2500,
    start_label: 'Start',
    stop_label: 'Stop',
    stop_on_scroll: true,
    countdown_prefix: '(',
    countdown_sufix: ')',
    onStart: function() {
      
    },
    onStop: function() {
      
    }
  },
  effect: 'slide-hori', 
  enable_keyboard_move: false,
  cycle: true, 
  callbacks: {
    init: function() {
    },
    afterImageVisible: function() {
      var context = this;
      this.loading(true);
      this.preloadImage(this.current_index + 1,
        function() {
          context.loading(false);
        }
      );

    },

    beforeImageVisible: function(new_image, old_image) {
      
    }
  }
});


	  			
		},
		
		scrollTo: function($target) {
			if ($target) {
				var adjust = $target.attr('id') == 'home_anchor' ? 200 : 0;
				var adjust = 0;
				
				//$target = $target.length && $target || $('[name=' + handle.hash.slice(1) + ']');
				$target = $target.length && $target;
				if ($target.length) {
					var targetOffset = $target.offset().top;
					$('html,body').animate({
						scrollTop: targetOffset + adjust
					}, 1000);
				}
				
				
			}
			return false;
		},
		
		hideContactBoxes: function() {
			$('#logos li img').each(function(index){
				var src = $(this).attr('src');
				if (src.indexOf('_off') == -1) {
					src = src.replace('.png', '_off.png');
					$(this).attr('src', src);
				}
			});
			
			$('.contact_box').each(function(){
				$(this).hide();
			});
		},
		
		showAdditional: function(handle) {
			$('#additional').show();
			handle.style.display = 'none';
		}
	}
