	var curr=1;
	var ajax_divName='splashbg';
	var stopAnimation=false;
	function animate(){
		var divElem = document.getElementById(ajax_divName);
		if(divElem&&!stopAnimation){
			if(frozenToImg>-1){
			}else{
				$(divElem).fadeOut("slow", function(){
					divElem.style.background="url(../images/splash/"+images[curr]+")";

					$('.hoverImg').each(function(){
						$(this).css("border-color","white");
					});
					/*
					var imelem = document.getElementById('thumb'+(curr-1));
					if(imelem){imelem.style.borderColor='white';}
					*/
					curr++;
					var imelem = document.getElementById('thumb'+(curr-1));
					if(imelem){imelem.style.borderColor='#EFA4B5';}

				if(curr==images.length) curr=0;
				$(divElem).fadeIn("slow");});
				
		selectYear(curr);

				
			}
		} 
	}
	var frozenToImg=-1;
	
	function selectYear(year){
		// resetting all year links default 
		index=0;
		$('#yearbox a div img:not('+year+')').each(
			function(){
				$(this).attr("src","../images/"+years[index]);
				$(this).css("background-color","");
				index++;
			}
		);

		// making the current fade image year background
		$('#yearbox a div img:eq('+year+')').attr("src",$('#yearbox a div img:eq('+year+')').attr("psrc"));
		$('#yearbox a div img:eq('+year+')').css("background-color","#ae818e");
		$('#viewhref').attr('href',(2009-year)+'.php');
		$('#viewhref img').attr('src','images/splash/0'+(9-year)+'.png');
		
	}
	function freeze(imgNum){
		stopAnimation=true;
		selectYear(imgNum);
		// now changing image
		var divElem = document.getElementById(ajax_divName);
		frozenToImg=imgNum;
		curr=imgNum+1;
		if(curr==images.length) curr=0;
		

		divElem.style.background="url(../images/splash/"+images[frozenToImg]+")";
		//divElem.src='../images/'+images[frozenToImg];
		

	}
	function unfreeze(){
		frozenToImg=-1;
		stopAnimation=false;
	}
