// JavaScript Document

$(document).ready(function(){




var browserName=navigator.appName; 
if (browserName=="Microsoft Internet Explorer")
{ 

//whatsOn

function removeBlue(){
$('#roof').attr('src', '/ftproot/images/roof_norm.png');
$('#four').attr('src', '/ftproot/images/four_norm.png');
$('#three').attr('src', '/ftproot/images/three_norm.png');
$('#fbi').attr('src', '/ftproot/images/fbi_norm.png');
$('#one').attr('src', '/ftproot/images/one_norm.png');
$('#ground').attr('src', '/ftproot/images/ground_norm.png');
$('#dive').attr('src', '/ftproot/images/dive_norm.png');
};



$('.whatsOn').toggle(function() {
  $(".whatsOnInfo").slideUp('3000');
  $(this).next(".whatsOnInfo").fadeIn('3000');
}, function() {
  $(".whatsOnInfo").slideUp('3000');
});

$('#woRoof').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-391px"}, 500);
$('#roof').attr('src', '/ftproot/images/roof_over.png');
});

$('#woFour').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-335px"}, 500);
$('#four').attr('src', '/ftproot/images/four_over.png');
});

$('#woThree').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-287px"}, 500);
$('#three').attr('src', '/ftproot/images/three_over.png');
});

$('#woFbi').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-220px"}, 500);
$('#fbi').attr('src', '/ftproot/images/fbi_over.png');
});

$('#woOne').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-150px"}, 500);
$('#one').attr('src', '/ftproot/images/one_over.png');
});

$('#woGround').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-97px"}, 500);
$('#ground').attr('src', '/ftproot/images/ground_over.png');
});

$('#woDive').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-55px"}, 500);
$('#dive').attr('src', '/ftproot/images/dive_over.png');
});

//Left navigation hover state
$("#left_nav img.nav").hover( function() {

        this.src = this.src.replace("norm","over"); },

        function() {

               this.src = this.src.replace("over","norm");

        });

//Gallery Help Btn

$('.helpbtn').click(function(){
    $('.info, .closebtn').fadeIn('fast') 
});
$('.closebtn').click(function(){
    $('.info, .closebtn').fadeOut('fast') 
});
		
//footer hover state
$('#footer img').hover( function() {

        this.src = this.src.replace('norm','over'); },

        function() {

               this.src = this.src.replace('over','norm');

        });


//Left nav onclick move indicator and text box to clicked level

$('#vip') 
   .click(function(){ 


            $(".lvl").animate({marginTop: "-50px"}, 500 );
			$('#indicator').animate({marginTop: "-460px"}, 500,
			function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxVip/680/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});
   		
		
		

$('#roof') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "-10px"}, 500 );
		$('#indicator').animate({marginTop: "-391px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxRoof/681/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});
		
		
		
		

$('#four') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "10px"}, 500 );
		$('#indicator').animate({marginTop: "-335px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () {  window.location.href = '/KxFour/679/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});



$('#three') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "50px"}, 500 );
		$('#indicator').animate({marginTop: "-287px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxThree/678/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});

		

$('#fbi') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "130px"}, 500 );
		$('#indicator').animate({marginTop: "-220px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxFbi/670/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#one') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "150px"}, 500 );
		$('#indicator').animate({marginTop: "-150px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxOne/677/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#ground') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "200px"}, 500 );
		$('#indicator').animate({marginTop: "-97px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/Ground/704/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#dive') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "250px"}, 500 );

		$('#indicator').animate({marginTop: "-55px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxDive/668/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;

   		});
   		});

		



}


// If not IE, use this script

else 
{ 
//whatsOn

function removeBlue(){
$('#roof').attr('src', '/ftproot/images/roof_norm.png');
$('#four').attr('src', '/ftproot/images/four_norm.png');
$('#three').attr('src', '/ftproot/images/three_norm.png');
$('#one').attr('src', '/ftproot/images/one_norm.png');
$('#fbi').attr('src', '/ftproot/images/fbi_norm.png');
$('#ground').attr('src', '/ftproot/images/ground_norm.png');
$('#dive').attr('src', '/ftproot/images/dive_norm.png');
};




$('.whatsOn').toggle(function() {
  $(".whatsOnInfo").slideUp('3000');
  $(this).next(".whatsOnInfo").fadeIn('3000');
}, function() {
  $(".whatsOnInfo").slideUp('3000');
});


$('#woRoof').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-370px"}, 500);
$('#roof').attr('src', '/ftproot/images/roof_over.png');
});

$('#woFour').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-320px"}, 500);
$('#four').attr('src', '/ftproot/images/four_over.png');
});

$('#woThree').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-280px"}, 500);
$('#three').attr('src', '/ftproot/images/three_over.png');
});

$('#woFbi').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-220px"}, 500);
$('#fbi').attr('src', '/ftproot/images/fbi_over.png');
});

$('#woOne').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-150px"}, 500);
$('#one').attr('src', '/ftproot/images/one_over.png');
});

$('#woGround').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-90px"}, 500);
$('#ground').attr('src', '/ftproot/images/ground_over.png');
});

$('#woDive').click(function(){
removeBlue();
$('#indicator').animate({marginTop: "-55px"}, 500);
$('#dive').attr('src', '/ftproot/images/dive_over.png');
});

//Left navigation hover state
$("#left_nav img.nav").hover( function() {

        this.src = this.src.replace("norm","over"); },

        function() {

               this.src = this.src.replace("over","norm");

        });

//Gallery info btn
$('.helpbtn').click(function(){
    $('.info, .closebtn').fadeIn('fast') 
});
$('.closebtn').click(function(){
    $('.info, .closebtn').fadeOut('fast') 
});

		
//footer hover state
$('#footer img').hover( function() {

        this.src = this.src.replace('norm','over'); },

        function() {

               this.src = this.src.replace('over','norm');

        });


//Left nav onclick move indicator and text box to clicked level

$('#vip') 
   .click(function(){ 


            $(".lvl").animate({marginTop: "-50px"}, 500 );
			$('#indicator').animate({marginTop: "-430px"}, 500,
			function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxVip/680/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});
   		
		
		

$('#roof') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "-10px"}, 500 );
		$('#indicator').animate({marginTop: "-370px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxRoof/681/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});
		
		
		
		

$('#four') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "10px"}, 500 );
		$('#indicator').animate({marginTop: "-320px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () {  window.location.href = '/KxFour/679/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});

   		});



$('#three') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "50px"}, 500 );
		$('#indicator').animate({marginTop: "-280px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxThree/678/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});

		

$('#fbi') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "130px"}, 500 );
		$('#indicator').animate({marginTop: "-220px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxFbi/670/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#one') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "150px"}, 500 );
		$('#indicator').animate({marginTop: "-150px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxOne/677/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#ground') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "200px"}, 500 );
		$('#indicator').animate({marginTop: "-90px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/Ground/704/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;
   		});
		
		   		});


$('#dive') 
   .click(function(){ 
                $(".lvl").animate({marginTop: "250px"}, 500 );

		$('#indicator').animate({marginTop: "-55px"}, 500,
	    	function () {$('.lvl').children().fadeOut(100);
				$('#kbdContainer').animate({opacity: '0'}, 400, 
			function () { window.location.href = '/KxDive/668/n/3/0/0/'; }).animate({opacity: '1'}, 400);
		; 
		return false;

   		});
   		});
}


});


















