
var countThis = 0;
function theRotator(){

	if(countThis != 0){

		var activeThis = ".tv_screen.screen" + countThis + "";
		var inactiveThis = ".tv_screen.screen" + (countThis - 1) + "";

		$(activeThis).fadeIn(1000);
		$(inactiveThis).fadeOut(1000);

		if(countThis < $(".tv_screen").size() - 1){
			countThis++;
		}else{
			countThis = 0;
		}

	}else{
		var activeThis = ".tv_screen.screen" + countThis + "";
		var inactiveThis = ".tv_screen.screen" + ($(".tv_screen").size() - 1) + "";

		$(activeThis).fadeIn(1000);
		$(inactiveThis).fadeOut(1000);
		countThis++;
	}

	setTimeout("theRotator()",4000);

}


$(document).ready(function(){

	$("a[rel=gallery]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
	});

});






