$(document).ready(function(){

	$("#mp3_player").jPlayer({
	    ready: function () {
			$("#mp3_player").change("mp3/sound1.mp3");
			/* $("#mp3_player").play(); */

			$("#logo").hover(function(){
				$("#mp3_player").play();
			});
		}
	});

$('#stats  .container').serialScroll({
	items:'img.stats',
	prev:'#stats .control .previous',
	next:'#stats .control .next',
	duration:600,
	force:true,
	stop:true,
	lock:false,
	step: 1,
	cycle: true, //don't pull back once you reach the end
	jump: false //click on the images to scroll to them
});

$('#stats').hover(function(){
	$('#stats .control').show();
},function(){
	$('#stats .control').hide();
});

//$('#operations .container div').shuffle();
$('#stats .container div').shuffle();

$('#operations .container').serialScroll({
	items:'img.opes',
	prev:'#operations .control .previous',
	next:'#operations .control .next',
	duration:600,
	force:true,
	stop:true,
	lock:false,
	step: 1,
	cycle: true, //don't pull back once you reach the end
	jump: false //click on the images to scroll to them
});

$('#operations').hover(function(){
	$('#operations .control').show();
},function(){
	$('#operations .control').hide();
});
	
$('#blog img').removeAttr("style");
$('#blog img').removeAttr("height");
$('#blog img').removeAttr("width");


$('#blog object').each(function(ob){
	var new_height = $(this).attr("height") / $(this).attr("width");
	new_height = new_height * $('#blog .content').width();
	$(this).attr("height", new_height);
});

$('.video_youtube').each(function(ob){
	$(this).attr("height", $(this).attr('height') + 25);
});

$('#anges_slideshow ul li').hover(function(){
	$('#'+$(this).attr('rel')).toggle();
}, function(){
	$('#'+$(this).attr('rel')).toggle();
});

$('#anges_slideshow').serialScroll({
	items:'li',
	prev:'#anges_trombi .control .prev',
	next:'#anges_trombi .control .next',
	duration:600,
	force:true,
	stop:true,
	lock:false,
	step: 3,
	exclude: 2,
	cycle:false, //don't pull back once you reach the end
	jump: false //click on the images to scroll to them
});

$('#anges_trombi .control .close').click(function(){
	$('#anges_trombi').hide();
	$('#anges').removeClass('on');
});

$('#anges').click(function(){
	$('#anges').addClass('on');
	$('#anges_trombi').show();
	$('#photos').hide();
	$('#flickr').removeClass('on');
});


$('#photos_slideshow').serialScroll({
	items:'li',
	prev:'#photos .control .prev',
	next:'#photos .control .next',
	duration:600,
	force:true,
	stop:true,
	lock:false,
	step: 3,
	exclude: 10,
	cycle:false, //don't pull back once you reach the end
	jump: false //click on the images to scroll to them
});

$('#photos .control .close').click(function(){
	$('#photos').hide();
	$('#flickr').removeClass('on');
});

$('#flickr').click(function(){
	$('#flickr').addClass('on');
	$('#photos').show();
	$('#anges_trombi').hide();
	$('#anges').removeClass('on');
});

});
