var startPage = {
	// Cycle 
	objCycle : null,

	init : function(){
		startPage.objCycle = {
			texts : $(".texts > div"),
			currIndex : 0,
			clicked : false
		};

		jQuery(".items").cycle({
			fx: 'fade',
			timeout: 8000,
			pager: '.navi',
			before : function(){
				if(!startPage.objCycle.clicked && startPage.objCycle.texts.length > 0){
					if(startPage.objCycle.currIndex > startPage.objCycle.texts.length-1){
						startPage.objCycle.currIndex = 0;
					}
					
					startPage.objCycle.texts.hide();
					$(startPage.objCycle.texts[startPage.objCycle.currIndex]).show();
					startPage.objCycle.currIndex++;
				};
			}
		});
		
		$(".navi > a").click(function(){
			startPage.objCycle.clicked = true;
			
			var arrNavs = $(".navi > a");
			
			startPage.objCycle.texts.hide();
			
			var index = 0;
			
			for(var i = 0; i < arrNavs.length; i++){
				if($(arrNavs[i]).hasClass("activeSlide")){
					$(startPage.objCycle.texts[i]).show();
					startPage.objCycle.currIndex = i+1;
					break;
				}
			}
			
			startPage.objCycle.clicked = false;
		});
	}	
};
