		/*----  change speed of animation here*/
		var speedFreeTools=9500;
		var speedTutorials=10500;
				
		var tutorialActive="";
		var lastTutorial="";
		var freeItemActive="";
		var lastFreeItem="";
		
		var itemNumber=0
		var lastItemNumber=0;
		
		var btPauseEnabled=false;
		var myAnimation=""
		
		$(document).ready(function(){	
			$("#aboutVZPC").click(function()
			{
				openNewWindow('../home/about.php', 550, 640, 25, 25);
				return false;
			});	
				
			/*---- initiate animations*/	
			animateTutorials("#tutorial1")
			animateFreeTools("#parentalControl")
			
			$("#btNext").click(function(){
			clearTimeout(myAnimation);
				switch(freeItemActive)
						{
						case "#parentalControl":
						  itemNumber+=1;
						  animateFreeTools("#contentFilters")  
						  break;    
						case "#contentFilters":
						   itemNumber+=1;
						  animateFreeTools("#parentalControlTV")	  
						  break;
						case "#parentalControlTV":
						  itemNumber=0;
						  animateFreeTools("#parentalControl")
						  break;
						default:
						  itemNumber+=1;
						  animateFreeTools("#contentFilters")  
						}
			});
			$("#btPrev").click(function(){
			clearTimeout(myAnimation);
				switch(freeItemActive)
						{
						case "#parentalControl":
						itemNumber=2;
						  animateFreeTools("#contentFilters")  
						  break;    
						case "#contentFilters":
						  itemNumber-=1;
						  animateFreeTools("#parentalControlTV")	  
						  break;
						case "#parentalControlTV":
						  itemNumber-=1;
						  animateFreeTools("#parentalControl")
						  break;
						default:
						  itemNumber=2;
						  animateFreeTools("#contentFilters")  
						}
			});
			$("#btPausen").click(function(){
				btPauseEnabled=!btPauseEnabled;
				if(btPauseEnabled==true){
					$("#btPausen").attr("title", "Enable the autoplay feature");
					clearTimeout(myAnimation);
					$("#btPausen").css({ backgroundPosition:'0px -75px'});
					
				 }
				 else{
				 	$("#btPausen").attr("title", "Disable the autoplay feature");
				 	$("#btPausen").css({ backgroundPosition:'0px -25px'});
					
					/*---- restart animation*/
					myAnimation=setTimeout(function(){
						switch(freeItemActive)
						{
						case "#parentalControl":
						  itemNumber+=1;
						  animateFreeTools("#contentFilters")  
						  break;    
						case "#contentFilters":
						   itemNumber+=1;
						  animateFreeTools("#parentalControlTV")	  
						  break;
						case "#parentalControlTV":
						  itemNumber=0;
						  animateFreeTools("#parentalControl")
						  break;
						default:
						  itemNumber+=1;
						  animateFreeTools("#contentFilters")  
						}
					}, speedFreeTools);
				 }	
			});
		
		});
		

	function openNewWindow(url, width, height, left, top)
	{				
		NewWindow=window.open(url, 'newWin','width='+ width +',height=' + height + ',left=' + left + ',top=' + top + ', toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');  NewWindow.focus(); void(0);
	};
	
	function resetTutorial(){
		$(lastTutorial).css({ left:300, opacity:'0' });
	}
	function animateTutorials(myDiv) {
		/*---- animate last tutorial*/
		if (tutorialActive!=""){
			lastTutorial=tutorialActive
			$(lastTutorial).animate( { left:-400, opacity:'0'}, 1025, "easeout", resetTutorial);
		}
		
		/*---- animate new tutorial*/
		$(myDiv).animate( { left:10, opacity:'1'}, 1100, "bounceout", function() {if ($.browser.msie)this.style.removeAttribute('filter');});
		tutorialActive=myDiv
		
		/*---- call new animation: loop*/
		window.setTimeout(function(){
			switch(myDiv)
			{
			case "#tutorial1":
			  animateTutorials("#tutorial2")
			  break;    
			case "#tutorial2":
			  animateTutorials("#tutorial3")
			  break;
			case "#tutorial3":
			  animateTutorials("#tutorial1")
			  break;
			
			default:
			  animateTutorials("#tutorial1")
			}
		}, speedTutorials);
	};	
	function animateFreeTools(myDiv) {
		/*---- animate last item*/
		if (freeItemActive!=""){
			$(lastFreeItem).animate( { opacity:'0'}, 100, "easeout");
			$(lastFreeItem).css({ zIndex:10 });
			/*animate red dot*/			
			$("#itemRed img:eq(" + lastItemNumber +")").animate( { opacity:'0' } , 400, "easeout");
		}
		
		/*---- animate new item*/
		setTimeout(function(){
			$(myDiv).animate( { opacity:'1' } , 300, "easeout", function() {if ($.browser.msie)this.style.removeAttribute('filter');});
		}, 100);
		$(myDiv).css({ zIndex:100 });
		/*animate red dot*/
		$("#itemRed img:eq(" + itemNumber +")").animate( { opacity:'1' } , 400, "easeout");
		freeItemActive=myDiv;
		
		/*---- call new item: loop*/
		if (btPauseEnabled==false){
			myAnimation=setTimeout(function(){
				switch(myDiv)
				{
				case "#parentalControl":
				  itemNumber+=1;
				  animateFreeTools("#contentFilters")
				  
			
				  break;    
				case "#contentFilters":
				   itemNumber+=1;
				  animateFreeTools("#parentalControlTV")
	
				  break;
				case "#parentalControlTV":
				  itemNumber=0;
				  animateFreeTools("#parentalControl")
				  break;
				default:
				  itemNumber+=1;
				  animateFreeTools("#contentFilters")		  
				}
			}, speedFreeTools);
		}
		lastItemNumber=itemNumber;
		lastFreeItem=freeItemActive;
	};	