function preload(){
	pic0= new Image(); 
	pic0.src="images/header.png";
	pic001= new Image(); 
	pic001.src="images/lightbox-btn-close.gif";
	pic002= new Image(); 
	pic002.src="images/lightbox-btn-next.gif";
	pic003= new Image(); 
	pic003.src="images/lightbox-btn-prev.gif";
	pic004= new Image(); 
	pic004.src="images/lightbox-ico-loading.gif";
	pic005= new Image(); 
	pic005.src="images/elizabeth.png";
	pic005= new Image(); 
	pic005.src="images/cunningham.png";
	pic006= new Image(); 
	pic006.src="images/headerShadow.png";
}

$(document).ready(function(){
	// ImageFlow instance declarations
	var instanceOne = new ImageFlow();
	instanceOne.init({ ImageFlowID: 'workFlow',
							aspectRatio: 1.88,
							onClick:function(){},
							reflectionGET:'&bgc=ffffff&fade_start=20%',
							reflections:false,
							reflectionP:0,
							buttons:false,
							captions:false,
							opacity: true,
							opacityArray: [10,7],
							imageCursor: 'pointer',
							imageFocusMax: 3,
							startAnimation:true,
							xStep:250,
							percentLandscape:150
							});
	
	var instanceTwo = new ImageFlow();
	instanceTwo.init({ ImageFlowID: 'workMenuFlow',
							aspectRatio: 1.88,
							reflectionGET:'&bgc=ffffff&fade_start=20%',
							reflections:false,
							reflectionP:0,
							buttons:false,
							opacity: true,
							opacityArray: [10,7],
							imageCursor: 'pointer',
							imageFocusMax: 3,
							startAnimation:true,
							xStep:250,
							percentLandscape:150
							});
														
	$('a[rel*=lightbox]').lightBox();
	$('#workFlow img').lightBox();
	$('#aboutProject a').lightBox();
	
	$('#subButtons').hide();
	
	function runAnimation(){
	      $('.pulsate').animate({opacity:'0.2'}, 1000,function(){
	            $(this).animate({opacity:'1'}, 800,runAnimation());
	      });
	}

	jQuery.each(jQuery.browser, function(i, val) {
		//IE7
	   	if(i=="msie" && jQuery.browser.version.substr(0,2)=="7.") {
			$("#logoShadow").css("background", "transparent");
			$("#logo").hover(function(){
		        $("#logoShadow").css("background", "url(images/headerShadow.png)");
		    },function(){
			    $("#logoShadow").css("background", "transparent");
		    });
		}
		//IE6
		else if(i=="msie" && jQuery.browser.version.substr(0,2)=="6.") {}
		//Normal
		else { 
			$('#logoShadow').css("opacity", "0");
			$("#logo").hover(function(){
		        $("#logoShadow").animate({opacity:'1'}, 500);
		    },function(){
			    $("#logoShadow").animate({opacity:'0'}, 500);
		    });
		
			//Pulsate
			runAnimation();

			$("#aboutProject a").click(function () {
			    $(".pulsate").stop();
				$(".pulsate").show();
				$(".pulsate").removeClass();
			});
		}
	 });
	
	
	//Background animtion for sidebar buttons	
	$('.sideButton').each( 
		function(){
			$(this).hover(function(){
				if ($.browser.safari) $(this).css({'background-color':"#ccc"}).animate( { marginLeft:'6px' }, 200);
				else $(this).animate( { backgroundColor: '#ccc', marginLeft:'6px' }, 200);
			},function(){
				if ($.browser.safari) $(this).css({'background-color':"#ddd"}).animate( { marginLeft:'0px' }, 200);
				else $(this).animate( { backgroundColor: '#ddd', marginLeft:'0px' }, 200);
			});
		}
	);
	
	$('.sideSubButton').each( 
		function(){
			$(this).hover(function(){
				if ($.browser.safari) $(this).css({'background-color':"#d2d2d2"}).animate( { marginLeft:'14px' }, 200);
				else $(this).animate( { backgroundColor: '#d2d2d2', marginLeft:'14px' }, 200);
			},function(){
				if ($.browser.safari) $(this).css({'background-color':"#ddd"}).animate( { marginLeft:'10px' }, 200);
				else $(this).animate( { backgroundColor: '#ddd', marginLeft:'10px' }, 200);
			});
		}
	);
	
	
	
	$("#workSideButton").hover(function(){
        $("#subButtons").show(200);
    },function(){
	    $("#subButtons").hide(200);
    });

});
