$.fx.speeds.verySlow = 2200;
$.fx.speeds.quiteSlow = 1200;
$.fx.speeds.medium = 600;
$.fx.speeds.quiteFast = 300;
$.fx.speeds.superSlow = 100000;

$(function(){  // $(document).ready shorthand
 $('body').hide().fadeIn('slow');
});

/// Animation fadeIn /// 

$(document).ready(function(){
$(".playLarge").click(function(){
$('.moviePanel').fadeOut('quiteFast');
$("#topPanel").append('<div id="animation"></div>')
	.children("#animation").hide()
	.load("animation.php #animation", 
		  function(){
$("#loadData").remove();
$("#animation").fadeIn("verySlow");
$('.animationClose').fadeIn('verySlow');
}); return false;
});
});

/// Logo glow ///

$(document).ready(function(){
		$("#logo").everyTime(10, function(){	
		$("#logo").animate({opacity:0.5}, 2000)
				  .animate({opacity:1}, 2000)
				  .animate({opacity:1}, 2000);
	});
	});

/// Colourbar movement ///

$(document).ready(function(){
	$(".bar").everyTime(10, function(){						 
		$(".bar").animate({right:"-1481px"}, "superSlow", "linear")
				 .animate({right:"0px"}, "superSlow", "linear");	
	});
});

/// Youtube fadeIns ///

$(document).ready(function(){
$(".video1 a").click(function(){
$('.moviePanel').css("background-image","none");
$('.playLarge').hide();
$(".moviePanel").append('<div id="videoOne"></div>')
	.children("#videoOne").hide()
	.load("video1.php #videoOne", 
		  function(){
$("#loadData").remove();
$("#videoOne").fadeIn("slow");
$(".youTubeVideoClose").fadeIn("slow");
$('#videoTwo').remove();
$('#videoThree').remove();
$('#videoFour').remove();
}); return false;
});
});

$(document).ready(function(){
$(".video2 a").click(function(){
$('.moviePanel').css("background-image","none");
$('.playLarge').hide();
$(".moviePanel").append('<div id="videoTwo"></div>')
	.children("#videoTwo").hide()
	.load("video2.php #videoTwo", 
		  function(){
$("#loadData").remove();
$("#videoTwo").fadeIn("slow");
$(".youTubeVideoClose").fadeIn("slow");
$('#videoOne').remove();
$('#videoThree').remove();
$('#videoFour').remove();
}); return false;
});
});

$(document).ready(function(){
$(".video3 a").click(function(){
$('.moviePanel').css("background-image","none");
$('.playLarge').hide();
$(".moviePanel").append('<div id="videoThree"></div>')
	.children("#videoThree").hide()
	.load("video3.php #videoThree", 
		  function(){
$("#loadData").remove();
$("#videoThree").fadeIn("slow");
$(".youTubeVideoClose").fadeIn("slow");
$('#videoOne').remove();
$('#videoTwo').remove();
$('#videoFour').remove();
}); return false;
});
});

$(document).ready(function(){
$(".video4 a").click(function(){
$('.moviePanel').css("background-image","none");
$('.playLarge').hide();
$(".moviePanel").append('<div id="videoFour"></div>')
	.children("#videoFour").hide()
	.load("video4.php #videoFour", 
		  function(){
$("#loadData").remove();
$("#videoFour").fadeIn("slow");
$(".youTubeVideoClose").fadeIn("slow");
$('#videoOne').remove();
$('#videoThree').remove();
$('#videoTwo').remove();
}); return false;
});
});

$(function(){
$('.youTubeVideoClose a').click(function() {
$(".moviePanel").css("background-image","url(/images/holder.png)");
$('.playLarge').fadeIn('quiteSlow');
$('.youTubeVideoClose').fadeOut('fast');
$('#videoOne').remove();
$('#videoTwo').remove();
$('#videoThree').remove();
$('#videoFour').remove();
});
});

$(function(){
$('.animationClose a').click(function() {
$('.animationClose').hide();
$('#animation').remove();
$('.moviePanel').fadeIn('quiteSlow');
});
});

$(function() {
$(".hideClose img").css("opacity","0.8");
$(".hideClose img").hover(function () {
$(this).stop().animate({
opacity: 1
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 0.8
}, "fast");
});
});

$(function() {
$("#rotatingPanel img").css("opacity","1");
$("#rotatingPanel img").hover(function () {
$(this).stop().animate({
opacity: 0.85
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 1
}, "fast");
});
});

$(function() {
$(".services").css("opacity","1");
$(".services").hover(function () {
$(this).stop().animate({opacity: 0.85
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 1
}, "fast");
});
});

$(function() {
$(".work").css("opacity","1");
$(".work").hover(function () {
$(this).stop().animate({opacity: 0.85
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 1
}, "fast");
});
});

$(function() {
$(".caseStudies").css("opacity","1");
$(".caseStudies").hover(function () {
$(this).stop().animate({opacity: 0.85
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 1
}, "fast");
});
});

$(function() {
$(".environment").css("opacity","1");
$(".environment").hover(function () {
$(this).stop().animate({opacity: 0.85
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 1
}, "fast");
});
});

$(function() {
$(".playLarge").css("opacity","0.8");
$(".playLarge").hover(function () {
$(this).stop().animate({
opacity: 1
}, "fast");
},
function () {
$(this).stop().animate({
opacity: 0.8
}, "fast");
});
});

$(function() {
$(".ytpb1").css("opacity","0.7");
$(".yt-overlay1").css("opacity","0.5");

$(".video1").hover(function () {
$(".ytpb1").stop().animate({
opacity: 1
}, "fast");
$(".yt-overlay1").stop().animate({
opacity: 0
}, "fast"); 
},

function () {
$(".ytpb1").stop().animate({
opacity: 0.7
}, "fast");
$(".yt-overlay1").stop().animate({
opacity: 0.5
}, "fast");
});
});


$(function() {
$(".ytpb2").css("opacity","0.7");
$(".yt-overlay2").css("opacity","0.5");

$(".video2").hover(function () {
$(".ytpb2").stop().animate({
opacity: 1
}, "fast");
$(".yt-overlay2").stop().animate({
opacity: 0
}, "fast"); 
},

function () {
$(".ytpb2").stop().animate({
opacity: 0.7
}, "fast");
$(".yt-overlay2").stop().animate({
opacity: 0.5
}, "fast");
});
});


$(function() {
$(".ytpb3").css("opacity","0.7");
$(".yt-overlay3").css("opacity","0.5");

$(".video3").hover(function () {
$(".ytpb3").stop().animate({
opacity: 1
}, "fast");
$(".yt-overlay3").stop().animate({
opacity: 0
}, "fast"); 
},

function () {
$(".ytpb3").stop().animate({
opacity: 0.7
}, "fast");
$(".yt-overlay3").stop().animate({
opacity: 0.5
}, "fast");
});
});


$(function() {
$(".ytpb4").css("opacity","0.7");
$(".yt-overlay4").css("opacity","0.5");

$(".video4").hover(function () {
$(".ytpb4").stop().animate({
opacity: 1
}, "fast");
$(".yt-overlay4").stop().animate({
opacity: 0
}, "fast"); 
},

function () {
$(".ytpb4").stop().animate({
opacity: 0.7
}, "fast");
$(".yt-overlay4").stop().animate({
opacity: 0.5
}, "fast");
});
});


///// drop down scripts //////

$(function(){
$('.show1').click(function () {
      $('.hide1').slideToggle("fast");
});
});

$(function(){
$('.show2').click(function () {
      $('.hide2').slideToggle("fast");
});
});

$(function(){
$('.show3').click(function () {
      $('.hide3').slideToggle("fast");
});
});

$(function(){
$('.show4').click(function () {
      $('.hide4').slideToggle("fast");
});
});

$(function(){
$('.show5').click(function () {
      $('.hide5').slideToggle("fast");
});
});

$(function(){
$('.show6').click(function () {
      $('.hide6').slideToggle("fast");
});
});

$(function(){
$('.show7').click(function () {
      $('.hide7').slideToggle("fast");
});
});

$(function(){
$('.show8').click(function () {
      $('.hide8').slideToggle("fast");
});
});

/* long */
$(function(){
$('.longShow').click(function() {
$('.longHide').slideDown('slow');
$('.longClose').fadeIn('slow');
$
});
});

$(function(){
$('.longClose').click(function() {
$('.longHide').slideUp('slow');
$('.longClose').fadeOut('slow');
});
});
/* long ends */
///// ends //////


/* JIM js */


