$( function (){
	
	$('.top-links>li').hover(function () {
	 	$(this).addClass('hover');
	},
	function () {
		$(this).removeClass('hover'); 
	});

	$('.hovered').hover(function () {
		 	$(this).addClass('hover');
		},
		function () {
			$(this).removeClass('hover'); 
		});
	
//	$('.tabs').click(function () {
//		 
//		 $('.act').removeClass('act');
//		 $(this).addClass('act');
//		 
//		});
	
	$('.tabs-2>li').click( function () {
		$('.fst_act').removeClass('fst_act');
		$(this).addClass('fst_act');
		var _index=$('.tabs-2>li').index(this);
		$('#ciq_content>div').hide();
		$($('#ciq_content>div').get(_index)).show();
	});
	
	$('.fr>.fl').lightBox({fixedNavigation:true});
	$('.fr>.fr').lightBox({fixedNavigation:true});
	
	var length = $('.image img').length;		
	
	for(var i=0; i < length; i++) {
		$('#ico').append('<div><!-- --></div>');				
	}

	$('#ico div:first').addClass('ico_active');	

		setInterval(function () {	
			
			var activeImg = $('.image img:visible');	
				activeImg.fadeOut(2000);

			var next = activeImg.next();

			if (!next.is('img')) {
				next =  $('.image img:first');
			}											

		next.fadeIn(2000, function () {
			
			
			$('#ico div.ico_active').removeClass('ico_active');
			var current_index = $('.image img').index(this);
			$($('#ico div').get(current_index)).addClass('ico_active');
			
		});
		
	}, 5000);
	
})

function reloadCaptcha()
{
	$.get("/reload-captcha/", { parameters: '1' },
	   function(data){
			var imgSourche = document.getElementById('imageCaptcha');
			imgSourche.setAttribute("src", '/captcha/' + data);
	   });
}

