// when the DOM is ready:
$(document).ready(function () {
  var hover1 = $('div.hover1');
  var hover2 = $('div.hover2');
  var hover3 = $('div.hover3');
  var hover4 = $('div.hover4');
  var hover5 = $('div.hover5');
  
  $('div.hover1').click( function(){
	window.location.href='/about/';
	}
  )

  $('div.hover2').click( function(){
	window.location.href='/work/';
	}
  )
  
  $('div.hover3').click( function(){
	window.location.href='/investors/';
	}
  )

  $('div.hover4').click( function(){
	window.location.href='/tenders/';
	}
  )

  $('div.hover5').click( function(){
	window.location.href='/press/';
	}
  )  
  
  // find the div.fade elements and hook the hover event
  $('div.hover1').hover(
    function()
    {
	// on hovering over, find the element we want to fade *up*
	$('div.hover1').addClass("cursor");	
	var fade1 = $('div.fade1');	
	fade1.fadeIn(1000);
	hover2.fadeOut(500);
    hover3.fadeOut(500);
	hover4.fadeOut(500);
	hover5.fadeOut(500);
	},
    function ()
    {
	// on hovering out, fade the element out
	$('div.hover1').removeClass("cursor");
	var fade1 = $('div.fade1');	
	fade1.fadeOut(1000);
	hover2.fadeIn(500);
    hover3.fadeIn(500);
	hover4.fadeIn(500);
	hover5.fadeIn(500);	
    });
  $('div.hover2').hover(
    function()
    {
	// on hovering over, find the element we want to fade *up*
	$('div.hover2').addClass("cursor");	
    var fade2 = $('div.fade2');
	
	// if the element is currently being animated (to a fadeOut)...
	fade2.fadeIn(1000);
	hover1.fadeOut(500);
    hover3.fadeOut(500);
	hover4.fadeOut(500);
	hover5.fadeOut(500);	
    },
    function ()
    {
	// on hovering out, fade the element out
	$('div.hover2').removeClass("cursor");
	var fade2 = $('div.fade2');
	
	fade2.fadeOut(1000);
	hover1.fadeIn(500);
    hover3.fadeIn(500);
	hover4.fadeIn(500);
	hover5.fadeIn(500);	
    });
  $('div.hover3').hover(
    function()
    {
	// on hovering over, find the element we want to fade *up*
	$('div.hover3').addClass("cursor");	
    var fade3 = $('div.fade3');
	
	// if the element is currently being animated (to a fadeOut)...
	fade3.fadeIn(1000);
	hover1.fadeOut(500);
    hover2.fadeOut(500);
	hover4.fadeOut(500);
	hover5.fadeOut(500);
    },
    function ()
    {
	// on hovering out, fade the element out
	$('div.hover3').removeClass("cursor");
	var fade3 = $('div.fade3');
	
	fade3.fadeOut(1000);
	hover1.fadeIn(500);
    hover2.fadeIn(500);
	hover4.fadeIn(500);
	hover5.fadeIn(500);
    });
  $('div.hover4').hover(
    function()
    {
	// on hovering over, find the element we want to fade *up*
	$('div.hover4').addClass("cursor");	
    var fade4 = $('div.fade4');
	
	// if the element is currently being animated (to a fadeOut)...
	fade4.fadeIn(1000);
	hover1.fadeOut(500);
    hover2.fadeOut(500);
	hover3.fadeOut(500);
	hover5.fadeOut(500);	
    },
    function ()
    {
	// on hovering out, fade the element out
	$('div.hover4').removeClass("cursor");
	var fade4 = $('div.fade4');
	
	fade4.fadeOut(1000);
	hover1.fadeIn(500);
    hover2.fadeIn(500);
	hover3.fadeIn(500);
	hover5.fadeIn(500);	
    });
  $('div.hover5').hover(
    function()
    {
	// on hovering over, find the element we want to fade *up*
	$('div.hover5').addClass("cursor");	
    var fade5 = $('div.fade5');
	
	// if the element is currently being animated (to a fadeOut)...
	fade5.fadeIn(1000);
	hover1.fadeOut(500);
    hover2.fadeOut(500);
	hover3.fadeOut(500);
	hover4.fadeOut(500);	
    },
    function ()
    {
	// on hovering out, fade the element out
	$('div.hover5').removeClass("cursor");
	var fade5 = $('div.fade5');
	
	fade5.fadeOut(1000);
	hover1.fadeIn(500);
    hover2.fadeIn(500);
	hover3.fadeIn(500);
	hover4.fadeIn(500);	
    });
});
