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/lightbox-ico-loading.gif";
	pic005= new Image(); 
	pic005.src="images/lightbox-ico-loading.gif";
}

$(document).ready(function(){
	// ImageFlow instance declarations
	preload();
	var instanceOne = new ImageFlow();
	instanceOne.init({ ImageFlowID: 'workFlow',
							aspectRatio: 1.88,
							onClick:function(){},
							reflectionGET:'&bgc=ffffff&fade_start=20%',
							reflections:false,
							reflectionP:0,
							buttons:true,
							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:true,
							opacity: true,
							opacityArray: [10,7],
							imageCursor: 'pointer',
							imageFocusMax: 3,
							startAnimation:true,
							xStep:250,
							percentLandscape:150
							});
														
	$('a[rel*=lightbox]').lightBox();
	$('#workFlow img').lightBox();
	
	//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);
			});
		}
	);

});