function slideSwitch() {
    
}
$(document).ready(function() {
	var contentHeight = $(window).height()-80;
	$("#content").height(contentHeight);
	if(contentHeight > 525){
		$('body').css('overflow', 'hidden');
	}
	$(window).resize(function(){
		var contentHeight = $(window).height()-80;
		$("#content").height(contentHeight);
		if(contentHeight < 525){
			$('body').css('overflow', '');
		} else{
			$('body').css('overflow', 'hidden');
		}
	});
	var paper = Raphael("homepageSlideshowMask", 500, 350);
	var mask = paper.path("M346.338,5.228c23.564,0,46.874,1.62,69.658,6.183c122.214,23.829,93.534,259.625-3.592,298.143c-43.648,17.312-99.806,24.915-155.504,24.915c-49.291,0-98.215-5.949-137.851-16.391c-37.377-9.846-77.968-29.695-86.889-69.174C18.023,186.346,82.618,127.436,52.181,66.042c-22.583-45.557,10.422-53.937,51.18-53.937c23.716,0,50.056,2.837,69.599,2.837C229.446,14.944,288.64,5.228,346.338,5.228 M346.338-68c-32.183,0-63.586,2.624-93.958,5.16c-28.031,2.342-54.509,4.555-79.421,4.555c-7.04,0-16.728-0.575-26.984-1.182c-13.088-0.776-27.922-1.655-42.612-1.655c-20.688,0-37.253,1.716-52.134,5.399C14.288-46.578-5.234-26.237-15.107-10.784c-11.304,17.696-16.283,38.591-14.4,60.426c1.35,15.654,6.082,31.486,14.467,48.396c3.021,6.094-4.277,26.598-10.14,43.073c-5.38,15.116-11.477,32.249-15.37,51.029c-5.362,25.878-5.446,49.622-0.254,72.595c8.064,35.692,29.63,66.643,62.365,89.503c21.344,14.904,47.616,26.532,78.088,34.559C145.916,400.985,201.763,407.7,256.9,407.7c48.919,0,120.472-5.251,183.543-30.266c25.291-10.028,48.001-26.671,67.498-49.463c15.852-18.531,29.199-40.72,39.678-65.955c9.538-22.975,16.364-47.615,20.289-73.235c3.97-25.921,4.773-51.612,2.39-76.355c-3.823-39.702-16.054-75.637-35.369-103.924c-24.982-36.584-60.973-60.392-104.103-68.864C405.113-65.501,377.471-68,346.338-68L346.338-68z");
	mask.attr("fill", "white");
	mask.attr('stroke-width', 0);
	
	function mask1(){
		mask.animate({path: "M362.5,5c26.042,1.864,84.086,6.991,111.271,27.106c51.707,38.26,22.855,231.876-74.271,270.394c-43.648,17.312-88.302,6-144,6c-49.291,0-96.815,20.02-136.451,9.578C81.672,308.232,64.421,278.979,55.5,239.5c-14.137-62.558-31.681-119.542-6-174c15-25,34.242-42,75-42c23.716,0,83.458,22,103,22C283.986,45.502,277.801,3,335.5,3C335.5,3,355.749,4.517,362.5,5z M361.249-160.813c-37.975,0-75.031,3.096-110.869,6.089c-33.076,2.764-78.26,11.866-112.947,11.866c-9.803,0-23.292-0.801-37.573-1.646c-18.225-1.081-38.879-2.305-59.333-2.305c-28.807,0-51.872,2.389-72.592,7.519c-51.438,12.733-78.62,41.056-92.366,62.573c-15.74,24.64-22.673,53.733-20.051,84.137c1.881,21.797,8.469,43.841,20.144,67.387c4.205,8.486-5.955,37.035-14.119,59.977c-7.49,21.047-15.98,44.903-21.401,71.052c-7.466,36.033-7.582,69.095-0.354,101.082c11.229,49.698,41.257,92.794,86.837,124.624c29.719,20.751,107.575,47.197,143.531,56.668c54.596,14.381,120.495,22.305,185.558,22.305c57.724,0,142.156-6.197,216.58-35.713c29.844-11.834,104.42-48.1,131.568-79.835c22.07-25.804,40.656-56.698,55.246-91.836c13.281-31.991,22.786-66.3,28.251-101.973c5.527-36.093,6.647-71.865,3.327-106.316c-5.324-55.281-22.354-105.317-49.248-144.703c-34.785-50.941-84.898-84.091-144.952-95.887C460.683-152.905,397.986-160.813,361.249-160.813L361.249-160.813z"}, 1000);
	}
	function mask2(){
		mask.animate({path: "M394.5,3.5c56,7.999,93.403-6.732,98,40c6,61,4,160-65,227c-44,39-115.608,49.169-171,55c-57,6-88.916,5.692-137.451-7.422C81.735,307.996,33.421,288.979,24.5,249.5c-14.137-62.558-29.681-154.542-4-209c15-25,20.242-34,61-34c23.716,0,124.458-6.5,144-6.5c56.486,0.002,52.302,3.252,110,3C350.25,2.936,387.799,2.543,394.5,3.5z M361.249-160.813c-37.975,0-75.031,3.096-110.869,6.089c-33.076,2.764-78.26,11.866-112.947,11.866c-9.803,0-23.292-0.801-37.573-1.646c-18.225-1.081-38.879-2.305-59.333-2.305c-28.807,0-51.872,2.389-72.592,7.519c-51.438,12.733-78.62,41.056-92.366,62.573c-15.74,24.64-22.673,53.733-20.051,84.137c1.881,21.797,8.469,43.841,20.144,67.387c4.205,8.486-5.955,37.035-14.119,59.977c-7.49,21.047-15.98,44.903-21.401,71.052c-7.466,36.033-7.582,69.095-0.354,101.082c11.229,49.698,41.257,92.794,86.837,124.624c29.719,20.751,107.575,47.197,143.531,56.668c54.596,14.381,120.495,22.305,185.558,22.305c57.724,0,142.156-6.197,216.58-35.713c29.844-11.834,104.42-48.1,131.568-79.835c22.07-25.804,40.656-56.698,55.246-91.836c13.281-31.991,22.786-66.3,28.251-101.973c5.527-36.093,6.647-71.865,3.327-106.316c-5.324-55.281-22.354-105.317-49.248-144.703c-34.785-50.941-84.898-84.091-144.952-95.887C460.683-152.905,397.986-160.813,361.249-160.813L361.249-160.813z"}, 1000);
	}
	function mask3(){
		mask.animate({path: "M346.338,5.228c23.564,0,46.874,1.62,69.658,6.183c122.214,23.829,93.534,259.625-3.592,298.143c-43.648,17.312-99.806,24.915-155.504,24.915c-49.291,0-98.215-5.949-137.851-16.391c-37.377-9.846-77.968-29.695-86.889-69.174C18.023,186.346,82.618,127.436,52.181,66.042c-22.583-45.557,10.422-53.937,51.18-53.937c23.716,0,50.056,2.837,69.599,2.837C229.446,14.944,288.64,5.228,346.338,5.228 M346.338-68c-32.183,0-63.586,2.624-93.958,5.16c-28.031,2.342-54.509,4.555-79.421,4.555c-7.04,0-16.728-0.575-26.984-1.182c-13.088-0.776-27.922-1.655-42.612-1.655c-20.688,0-37.253,1.716-52.134,5.399C14.288-46.578-5.234-26.237-15.107-10.784c-11.304,17.696-16.283,38.591-14.4,60.426c1.35,15.654,6.082,31.486,14.467,48.396c3.021,6.094-4.277,26.598-10.14,43.073c-5.38,15.116-11.477,32.249-15.37,51.029c-5.362,25.878-5.446,49.622-0.254,72.595c8.064,35.692,29.63,66.643,62.365,89.503c21.344,14.904,47.616,26.532,78.088,34.559C145.916,400.985,201.763,407.7,256.9,407.7c48.919,0,120.472-5.251,183.543-30.266c25.291-10.028,48.001-26.671,67.498-49.463c15.852-18.531,29.199-40.72,39.678-65.955c9.538-22.975,16.364-47.615,20.289-73.235c3.97-25.921,4.773-51.612,2.39-76.355c-3.823-39.702-16.054-75.637-35.369-103.924c-24.982-36.584-60.973-60.392-104.103-68.864C405.113-65.501,377.471-68,346.338-68L346.338-68z"}, 1000);
	}
	
	
	
	setInterval(function(){
		var $active = $('#slideshow img.active');

	    if ( $active.length == 0 ) $active = $('#slideshow img:last');

	    var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');

	    $active.addClass('last-active');
		var index = $("#slideshow img").index($active);
		switch(index){
			case 2:
				mask1();
			break;
			case 0:
				mask2();
			break;
			case 1:
				mask3();
			break;
		}
		
	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            $active.removeClass('active last-active');
	        });
	}, 5000 );

});