
/*
	Slideshow for JChung theme
	Author: BDQWorks/BDQThemes/Jason Saeho Lee
	Version: 1.0.1
	Updated: May 20th, 2011
	Description: This is a very simple jQuery slideshow that acts like the circular carousel slideshow, created for the JChung WordPress theme.
*/

$(document).ready(function() {
	  
	$(".youtube-thumbnail").colorbox({iframe:true, innerWidth:640, innerHeight:390});
	
    $('.frontpage-youtube').click(function(e) {
	  e.preventDefault();
	  $('#video-box').attr('src', $(this).attr('href'));
	  $('#video-title').html('Now Playing: '+$(this).attr('title'));
	  $('#video-description').html($(this).attr('alt'));
	  
    });
  
	new jPlayerPlaylist({
		jPlayer: "#jquery_jplayer_1",
		cssSelectorAncestor: "#jp_container_1"
	}, [
		{
			title:"Common, Simple, Beautiful",
			mp3:"music/1.mp3",
			oga:"music/1.ogg",
		},
		{
			title:"I Made It",
			mp3:"music/2.mp3",
			oga:"music/2.ogg",
		},
		{
			title:"Mystery",
			mp3:"music/3.mp3",
			oga:"music/3.ogg",
		},
		{
			title:"One Day",
			mp3:"music/4.mp3",
			oga:"music/4.ogg",
		},
		{
			title:"Lost Boy",
			mp3:"music/5.mp3",
			oga:"music/5.ogg",
		},
		{
			title:"Can We?",
			mp3:"music/6.mp3",
			oga:"music/6.ogg",
		},
		{
			title:"You Won",
			mp3:"music/7.mp3",
			oga:"music/7.ogg",
		},
		{
			title:"This Is It",
			mp3:"music/8.mp3",
			oga:"music/8.ogg",
		},
		{
			title:"Very Last Time",
			mp3:"music/9.mp3",
			oga:"music/9.ogg",
		},
		{
			title:"White Lies",
			mp3:"music/10.mp3",
			oga:"music/10.ogg",
		},
		{
			title:"Running",
			mp3:"music/11.mp3",
			oga:"music/11.ogg",
		},
		{
			title:"The Way You Do",
			mp3:"music/12.mp3",
			oga:"music/12.ogg",
		}
	], {
		swfPath: "jplayer",
		supplied: "oga, mp3"
	});
	
	$("#jplayer_inspector_1").jPlayerInspector({jPlayer:$("#jquery_jplayer_1")});
	
  // Start BDQThemes.com Sociable Theme Functions
  
  
  
  
  $('a.disable').click(function(e) {
	  e.preventDefault();
  });
	
  $('.s-up').click(function() {
    if (!$(this).parent().children().is(':animated')) {
	  var top = parseInt($('#slideshow-scroll').css('margin-top').replace("px", ""));
	  var target = parseInt($('#slideshow-scroll').attr('name'));
	  
	  if(top>target) {
	  	$('#slideshow-scroll').stop().animate({
          marginTop: '-=320px'
        }, 480);
	  } else {
		$('#last-slide').html('');
		$('.first-slide').clone().prependTo('#last-slide');  
		$('#slideshow-scroll').stop().animate({
    	  marginTop: '-=320px'
          }, 480, function() {
			$('#slideshow-scroll').css('marginTop', '-320px');
		  });
	  }
	}
			
  });	
		
		
		
		
		
  $('.s-down').click(function() {
    if (!$(this).parent().children().is(':animated')) {
	  var top = parseInt($('#slideshow-scroll').css('margin-top').replace("px", ""));
	  var target = parseInt($('#slideshow-scroll').attr('name'));
	  
	  if (top<-320) {
		$('#slideshow-scroll').stop().animate({
    	  marginTop: '+=320px'
          }, 480);
	  } else {
		$('#first-slide').html('');  
		$('.last-slide').clone().prependTo('#first-slide');  
		$('#slideshow-scroll').stop().animate({
    	  marginTop: '+=320px'
          }, 480, function() {
			$('#slideshow-scroll').css('marginTop', target+'px');
		  });
	  }
	}
  });
});
