	var curr=1;
	var ajax_divName='transitionPic';
	var stopAnimation=false;
	function animate(){
		var divElem = document.getElementById(ajax_divName);
		if(divElem&&!stopAnimation){
			if(frozenToImg>-1){
			}else{
				$(divElem).fadeOut("slow", function(){
					divElem.src='../images/'+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");});
			}
		} 
	}
	var frozenToImg=-1;
	function freeze(imgNum){
	
		/*
		var imelem = document.getElementById('thumb'+(curr-1));
		if(imelem){imelem.style.borderColor='red';}
		*/
		
		// converting all the borders to white
		$('.hoverImg').each(function(){
			$(this).css("border-color","white");
		});
		
		// setting this border to red
		var imgid= '#thumb'+imgNum;
		$(imgid).css("border-color","#EFA4B5");
		
		// now changing image
		var divElem = document.getElementById(ajax_divName);
		frozenToImg=imgNum;
		curr=imgNum+1;
		if(curr==images.length) curr=0;
		divElem.src='../images/'+images[frozenToImg];
		stopAnimation=true;

	}
	function unfreeze(){
		frozenToImg=-1;
		stopAnimation=false;
	}