$(document).ready(function() {

	Cufon.replace('h1 ,h2, h3', { fontFamily: 'HelveticaNeueLTPro' });
	Cufon.replace('.langSelector a, .newsBox a.more, #flowtabs a, #menu3 a, .navBar .infoBox, .navBar .webBox, .firstMenu. .newsList .perex', { fontFamily: 'HelveticaNeueLTPro', hover: true });

	$('.items div.narrow').css("display", "none");


	// select #flowplanes and make it scrollable. use circular and navigator plugins
	var randomNumber = Math.floor(Math.random()*5)
	var api = $("#flowpanes").scrollable({
		onSeek: function () {
			n=this.getIndex();
			//alert("dddd "+n);
			$('.items div.narrow').not('.items div.narrow:eq('+n+')').fadeOut();
			$('.items div.narrow:eq('+n+')').fadeIn();

			$("#flowtabs li").removeClass("selected");
			$('#flowtabs li:eq('+n+')').addClass("selected");

		}

	}).navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",

		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',

		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current',

		// make browser's back button work
		history: true

	});

	var api = $("#flowpanes").data("scrollable");
	api.move(randomNumber);
});



