$(document).ready(function(){
$("#smallPictures img").click(function(){
$(this).clone().appendTo(".bigPicture").css("opacity", "0").animate({opacity: '1'}, 500);
});
$("#mainNavigation").click(function(){
$("#mainNavigation").animate({height:'215px'},800);
});
//Larger thumbnail preview 
$("ul.thumb li").hover(function() {
$(this).css({'z-index' : '10'});
$(this).find('img').addClass("hover").stop()
.animate({
marginTop: '-120px', 
marginLeft: '-160px', 
top: '50%', 
left: '50%', 
width: '300px', 
height: '197px',
padding: '0px' 
}, 200);
} , function() {
$(this).css({'z-index' : '0'});
$(this).find('img').removeClass("hover").stop()
.animate({
marginTop: '0', 
marginLeft: '0',
top: '0', 
left: '0', 
width: '128px', 
height: '84px', 
padding: '0px',
}, 400);
});
//Swap Image on Click
$("ul.thumb li a").click(function() {
var mainImage = $(this).attr("href"); //Find Image Name
$("#main_view img").attr({ src: mainImage });
return false;
});
$("a[rel=example_group]").fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
 return '<span id="fancybox-title-over">' + title + '</span>';
}
});
$("img#start").hide();
$(".preload").hide();
$(window).load( function() {
$(".preload").fadeIn('1500');
});
$(".preload_references").hide();
$(window).load( function() {
$(".preload_references").fadeIn('1500');
$("#projectPictureGallery").css("backgroundColor", "#E4E4E4");
});
$("li#products").hover(function(){
$("img.products").css("z-index", "2");
$("img.products").animate({
opacity: '1'
}, 1000);
}, function () {
$("img.products").css("z-index", "10");
$("img.products").animate({
opacity: '0'
}, 1000);
});
$("li#service").hover(function(){
$("img.service").css("z-index", "2");
$("img.service").animate({
opacity: '1'
}, 1000);
$(this).animate({backgroundColor:"#E4ECEE"}, 750)
}, function () {
$("img.service").css("z-index", "10");
$("img.service").animate({
opacity: '0'
}, 1000);
$(this).animate({backgroundColor:"#FFFFFF"}, 750)
});
$("li#projects").hover(function(){
$("img.projects").css("z-index", "2");
$("img.projects").animate({
opacity: '1'
}, 1000);
}, function () {
$("img.projects").css("z-index", "10");
$("img.projects").animate({
opacity: '0'
}, 1000);
});
$("ul.withhover li a").hover(function() {
$(this).find("img").animate({
opacity: '1',
}, 300)
}, function () {
$(this).find("img").animate({
opacity: '.4',
}, 300)
});
$("ul.withhover li a").click(function() {
$(this).find("img").delay(700).animate({
opacity: '.4',
}, 300)
});
}); 

