jQuery(function(){
	jQuery('#pane').jScrollPane({scrollbarWidth:18, showArrows:true});
});
var zIndex = [];
$(document).ready(function() {
	$('#slideshow').cycle({ 
		fx:      'fade', 
		speed:    2000, 
		timeout:  1000,
		random: 1
	});
	
	$('#wallpaper').cycle({ 
		fx:      'fade',
		timeout:  0,
		pager: '.paper_page'
	});	
	
	
	// lister start
	
	var alboms_num = $('#album .album_wrp').length;//17;
		
	function renderTitle() {
		var alt = $('.pager_st:visible img:visible').attr('alt');
		$('.pager_st:visible').next().next().html(alt);	
	}		

	$('.navigation_st').bind('whenVisible', function() {
		$('.navigation_st:visible').children().first().trigger('click');
	});

	$('.prev,.next').click(function(){
		$('.navigation_st:visible').trigger('whenVisible');
	});	
	
	$('#album').cycle({ 
		fx:      'fade',
		timeout:  0,
		next: '.next',
		prev: '.prev',
		before: renderTitle, 
		after: 	renderTitle
	});

	for(var i = 0; i < alboms_num; i++) {
		$('.pager_st:eq('+i+')').cycle({ 
			fx:      'fade',
			timeout:  0,
			pager: '.navigation_st:eq('+i+')',
			before: renderTitle,  
			after: renderTitle 
		});	
	}
	
	// lister end

	$(".pers").hover(function(){
		$(this).next(".person_info").fadeIn(0);
		$(".person_info").css('zIndex', '50');	
	},
	function(){
		$(this).next(".person_info").fadeOut(0);
	});
	$(".person_info").hover(function(){
		$(this).fadeIn(0);
		$(this).css('zIndex', '50');	
	},
	function(){
		$(this).fadeOut(0);
	});
	
});


function initialize() {
	 if (GBrowserIsCompatible()) {
	 var map = new GMap2(document.getElementById("map_canvas")); 
	 var marker = new GMarker(new GLatLng(46.524858, 6.653202));
	 map.addControl(new GSmallMapControl()); // масштаб и перемещение карты
	 map.addControl(new GMapTypeControl()); // переключение типов карты
	 map.setCenter(new GLatLng(46.524858, 6.653422), 16);
	 map.addControl(new GSmallMapControl());
     map.addOverlay(marker);
	 } 
}
