$(document).ready(function(){
var margin =$("#image1").width()/2;
var width=$("#image1").width();
var height=$("#image1").height();
$("#image2").stop().css({width:'0px',height:''+height+'px',marginLeft:''+margin+'px',opacity:'0.5'});
$("#reflection2").stop().css({width:'0px',height:''+height+'px',marginLeft:''+margin+'px'});
	var timer;
	timer = 'off';
	$("#image1").mouseover(function(){
		if(timer == 'off'){
		$(this).stop().animate({width:'0px',height:''+height+'px',marginLeft:''+margin+'px',opacity:'0.1'},{duration:200});
			window.setTimeout(function() {
				$("#image2").stop().animate({width:''+width+'px',height:''+height+'px',marginLeft:'0px',opacity:'1'},{duration:200});
				timer = 'on';
			},100);
		}
	});
	$("#image2").mouseout(function(){
		if(timer == 'on'){
		$(this).stop().animate({width:'0px',height:''+height+'px',marginLeft:''+margin+'px',opacity:'0.1'},{duration:200});
			window.setTimeout(function() {
				$("#image1").stop().animate({width:''+width+'px',height:''+height+'px',marginLeft:'0px',opacity:'1'},{duration:200});
				timer = 'off';
			},100);
		}
	});


	var time;
	time = 'off';
	$("#portfolio-header").hover(function(){
		if(time == 'off'){
		window.setTimeout(function() {
		$("div.pullme").fadeOut();
		$("a.slideshow-prev").fadeIn();
		$("a.slideshow-next").fadeIn();
		$("div#slideshow-info-container").fadeIn();
		$("div#fullscreenblok").fadeIn();
		$("div.captionblok").fadeIn();
		$("div.captionblokfullscreen").fadeIn();
		$("div#fullscreencaption").fadeIn();
		$("div.slideshow-caption-container").fadeIn();
		time = 'on';
		}, 10);
		}
	},
	function(){
		if(time == 'on'){
		window.setTimeout(function() {
		$("div.pullme").fadeIn();
		$("a.slideshow-prev").fadeOut();
		$("a.slideshow-next").fadeOut();
		$("div#slideshow-info-container").fadeOut();
		$("div#fullscreenblok").fadeOut();
		$("div.captionblok").fadeOut();
		$("div.captionblokfullscreen").fadeOut();
		$("div#fullscreencaption").fadeOut();
		$("div.slideshow-caption-container").fadeOut();	
		time = 'off';
		}, 500);	
		}
	});
	
});
