
$(document).ready(function(){ 
        
        
$(document).pngFix();


$('#main_screen_closer, #contact_screen_closer').hover(function () {
      $('#bg_screen').animate( { width: '0px' }, { queue: false, duration: 500, easing: 'easeInBack' } );
      $('.text').delay(500).fadeIn(500);
      $('.standfirst, .contact_text, #main_screen_closer, #contact_screen_closer').fadeOut(50);
    });



$('.close').click(function () {
      $('#bg_screen').animate( { width: '0px' }, { queue: false, duration: 500, easing: 'easeInBack' } );
      $('.text').delay(500).fadeIn(500);
      $('.standfirst, .contact_text, #main_screen_closer, #contact_screen_closer').fadeOut(50);
    });

// welcome menu
$('.welcome_trigger').click(function () {
      $('#bg_screen').animate( { width: '400px', backgroundColor: '#cccccc', opacity: '0.9' }, { queue: false, duration: 1000, easing: 'easeOutBack' } );
      $('#text_holder_welcome, #main_screen_closer').delay(500).fadeIn(500);
      $('#text_holder_clients, #text_holder_work, #contact_screen_closer, .contact_text, .text').fadeOut(50);
    });

// contacts menu
$('.contact_trigger').click(function () {
      $('#bg_screen').animate( { width: '230px', backgroundColor: '#cccccc', opacity: '0.9' }, { queue: false, duration: 1000, easing: 'easeOutBack' } );
      $('#text_holder_contact, #contact_screen_closer').delay(500).fadeIn(500);
      $('.standfirst, .text').fadeOut(50);
    });

// client menu
$('.clients_trigger').click(function () {
	$('#text_holder_clients, #main_screen_closer').delay(500).fadeIn(500);
      $('#text_holder_welcome').fadeOut(50);
    });

// what we do
$('.whatwedo_trigger').click(function () {
	$('#text_holder_work').delay(500).fadeIn(500);
      $('#text_holder_clients').fadeOut(50);
    });

// new page
$('.new_page_trigger').click(function(){
              // Get the url of the link
		var toLoad = $(this).attr('href');
		$('#bg_screen').fadeTo(1000, 1).animate( { width: '100%', backgroundColor: '#ffffff' }, { queue: false, duration: 500, easing: 'easeOutExpo' } );
      $('.standfirst').fadeOut(1000);
              // Delay before loading the url
		$('#bg_screen').delay(0, function(){
			window.location = toLoad;
		});
		return false;
		});
		
// menu thumbnails
$('#menu_div_1').hover(function () {$('#hidden_menu_div_1').fadeIn(200);});
$('#menu_div_2').hover(function () {$('#hidden_menu_div_2').fadeIn(200);});
$('#menu_div_3').hover(function () {$('#hidden_menu_div_3').fadeIn(200);});
$('#menu_div_4').hover(function () {$('#hidden_menu_div_4').fadeIn(200);});
$('#menu_div_5').hover(function () {$('#hidden_menu_div_5').fadeIn(200);});
$('#menu_div_6').hover(function () {$('#hidden_menu_div_6').fadeIn(200);});
$('#menu_div_7').hover(function () {$('#hidden_menu_div_7').fadeIn(200);});
$('#menu_div_8').hover(function () {$('#hidden_menu_div_8').fadeIn(200);});
$('#menu_div_9').hover(function () {$('#hidden_menu_div_9').fadeIn(200);});
$('#menu_div_10').hover(function () {$('#hidden_menu_div_10').fadeIn(200);});
$('#menu_div_11').hover(function () {$('#hidden_menu_div_11').fadeIn(200);});
$('#menu_div_12').hover(function () {$('#hidden_menu_div_12').fadeIn(200);});
$('#menu_div_13').hover(function () {$('#hidden_menu_div_13').fadeIn(200);});
$('#menu_div_14').hover(function () {$('#hidden_menu_div_14').fadeIn(200);});
$('#menu_div_15').hover(function () {$('#hidden_menu_div_15').fadeIn(200);});
$('#menu_div_16').hover(function () {$('#hidden_menu_div_16').fadeIn(200);});
$('#menu_div_17').hover(function () {$('#hidden_menu_div_17').fadeIn(200);});
$('#menu_div_18').hover(function () {$('#hidden_menu_div_18').fadeIn(200);});
$('#menu_div_19').hover(function () {$('#hidden_menu_div_19').fadeIn(200);});
$('#menu_div_20').hover(function () {$('#hidden_menu_div_20').fadeIn(200);});
$('.thumb').mouseleave(function () {$('.caption_text').fadeOut(200);});

// slideshow
	$(document).ready(function() {
    $('#display_column').cycle({ 
    fx: 'fade',
    timeout: 0,
    speed: 500,
    before: onBefore,
    next:   '.next2, #display_column',
    prev:   '.prev2'
	});
	function onBefore() { 
    $('.slidenumber, .caption') 
        .html(this.alt); 
	};
	});
	



// closes
    }); 

