$(document).ready( function() {

$('.band:first').css({borderTop : 0});
	
// Social Animation
	
$('#header a').mouseover( function() {
	if ( $.browser.msie ) {
		$(this).stop().animate({marginTop : '0px'}, 200).next().stop().animate({marginTop : '10px'}, 200);
	} else {
		$(this).stop().animate({marginTop : '0px'}, 200).next().stop().animate({marginTop : '10px', opacity : .5}, 200); 
	}
}).mouseout( function() {
	if ( $.browser.msie ) {
		 $(this).stop().animate({marginTop : '5px'}, 600, 'easeOutBounce').next().stop().animate({marginTop : '0px'}, 600, 'easeOutBounce');
	} else {
		 $(this).stop().animate({marginTop : '5px'}, 600, 'easeOutBounce').next().stop().animate({marginTop : '0px', opacity : 1}, 600, 'easeOutBounce');
	}
});

// YouTube

$('#videos').youTubeChannel({ 
	userName: 'RedAngelaStudio',
	channel: 'uploads',
	linksInNewWindow: true
});

//  Menu Active

var myMenu=new Array("home","recording","mastering","postproduction","equipment","foto","bands","staff","links", "contatti");
$('.'+myMenu[pageNum]).addClass('active');

// Scroller

	$(".scrollable").scrollable({size: 5, easing: 'easeInOutBack', speed: 1000, keyboard: false});
	$(".scrollable_sub").scrollable({vertical: true, size: 3, easing: 'easeInOutBack', speed: 1000, keyboard: false});
	$(".news .scroll, #sub_news .scroll").cycle({fx:'scrollUp', speed:1000, timeout:5000, next:'.scroll'});

// Slideshow

	$('.slideshow').cycle({fx:'fade', speed:2000, timeout:7000, next:'.slideshow'});


	$('#slide_box').after('<ul id="nav">');
	$('.gallery').cycle({ 
	    fx:     'fade', 
    	speed:  2000, 
    	timeout: 7000, 
    	pager:  '#nav',
		next: '.gallery',
     
    	pagerAnchorBuilder: function(idx, slide) { 
       		return '<li><a href="#"><img src="' + slide.src + '" width="110" /></a></li>'; 
    	}
	});

// Parse RSS e Facebook

$("#cd_news").PaRSS( "http://it-it.facebook.com/feeds/page.php?id=60494894487&format=atom10", 3, "j M Y", "image" );

(function(d, s, id) {
	var js, fjs = d.getElementsByTagName(s)[0];
	if (d.getElementById(id)) {return;}
	js = d.createElement(s); js.id = id;
	js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
	fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

// TOOL TIP
$('.note').tipsy({gravity: 's', offset: 4, live: true});


// GOOGLE Link

$('#accordion li').click( function() {
	var htmlStr = $(this).html();
	window.open("http://www.google.com/search?btnI=I'm+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=" + htmlStr);
	return false;
});

// Accordion

// $('#accordion ul').hide();
// $('#accordion ul:first').show();
$('#accordion .tipologia').click( function() {
	if($(this).next().is(':visible')) $(this).next().slideUp('slow'); else $(this).next().slideDown('slow');
	return false;
});

// Links

$('a.link').mouseover( function() { $(this).children('span').css({color : '#000'}) }).mouseout( function() { $(this).children('span').css({color : '#666'}) });

// MP3 Single Player

$(".mp3player").jmp3();


});
