// JavaScript Document
var $j = jQuery.noConflict();
$j(document).ready(function(){
	  //	   jQuery('a.to-top').click(function(){
		//										jQuery().scrollTo("#page" ,500);
		//										});
	
	  var gallery_api = $j("div.scrollable").scrollable({
		size: 3,
		items: '.thumbs',
		next: '.snext',
		prev: '.sprev',
		speed: 800,
		loop: 'true',
		autoplay: 'true',
		globalNav: 'false',
		onBeforeSeek: function() { 
            this.getItems().fadeTo(500, 0.2);         
        }, 
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(500, 1); 
        }
		});
		gallery_api
			.autoscroll({
										step: 3,
										autoplay: true,
										interval: 5000});
	
	// ********************************
	
	  $j("div#main-slideshow").scrollable({
		size: 1,
		items: '.thumbs',
		speed: 800,
		loop: true,
		globalNav: 'false',
		onBeforeSeek: function() { 
            this.getItems().fadeTo(500, 0.2);         
        }, 
         
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(500, 1); 
        }
		}).autoscroll({
			             autoplay: true,
									 interval: 5000});

   // ************************ 
		
		$j("div#afisha").scrollable({
		size: 1,
		items: '.afishascroll',
		speed: 500,
		loop: true,
		vertical: true,
		globalNav: 'false',
		onBeforeSeek: function() { 
            this.getItems().fadeTo(500, 0);         
        }, 
         
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(500, 1); 
        }
		}).autoscroll({
			             autoplay: true,
									 interval: 8000});



// очищення тексту в пунктах меню
$j("ul.menu li a").each(function(){
																 $j(this).attr({"title":$j(this).html(),"alt":$j(this).html()})
																 .html("");
																 });
// робота з альбомами
	$j("ul#album1 li .mp3").css({"display":"none"});
	$j("ul#album1 li .mp3").click(function(){return false;});
	
	
																								
																							
	$j("ul#album1 li").click(function () {
																		 if($j(this).attr("class")=="current-mp3"){
																			 $j(this).removeClass().children("div.mp3").hide(500);
																			 return false;
																			 }
																		 else{
																		 $j("ul.album li").removeClass();
																		 $j("ul.album li .mp3").hide(500);
																		 $j(this).addClass("current-mp3").children("div.mp3").toggle(500);
																		 }
																		 });


// add numbers to programm list ( revers )
	var programms = $j("ul.programs li").length;
	$j("ul.programs li").each(function(){
																		 $j(this).prepend("<span class='numbers'>"+ (programms--)+". </span>");
																		 });
	
// show made tooltip


/*var tooltip_api = $j("#made").tooltip({
										api: true,
										tip: '.tooltip',
										offset: [10, 0],
										cancelDefault: false,
										position: 'top center',
										delay: 30,
										effect:'slide',
										direction: 'up',
										});
	tooltip_api.onBeforeShow = function(){
																		$j(" #made").expose({
																												 api: true,
																												 color: '#000000',
																												 opacity: '0.8'
																												 }).load();
																		}
													 
	tooltip_api.onHide = function(){
																			$j(" #made").expose({
																												 api: true,
																												 color: '#000000',
																												 opacity: '0.8'
																												 }).close();
														 
															}
															*/
//

});


