
$(document).ready(function() {

var $current = null;
var count = 0;
var $current_new = null;	
first_slide();

$.fn.ceebox.videos.base.param.allowScriptAccess = "sameDomain";//added to kill the permissions problem
$(".ceebox").ceebox();
$('#feature_list').fadeIn('slow')
						

	
function slideIn(){
$current.animate({
width: "960px",
height: "364px"
}, 0, 
									
	function () { 
		$("#slide_run").animate({
		marginLeft: "0px"
		}, 1000
		);
	}
	);
}

function first_slide(){
	$current= $("#s1");
	slideIn();
	}

	
function slideOut(){
	
		$("#slide_run").animate({
		marginLeft: "960px",
		}, 1000, 
		
				function(){ 											
					$current.animate({
					width: "0px",
					height: "0px"
					}, 0, 
				
						function (){
							$current = $current_new; 					
							$("#slide_run").animate({
							marginLeft: "-960px"
							}, 0, 
							
								function () {
								slideIn();
								}
							
						);
						
						}
						
					);

					}

		);
}
			
			$("#jazzmnbt1").click(function(){
				
				if(count == 1){
				slideIn();
				} else
				{
				$current_new = $("#s1");
				slideOut();
				}
				count = 1;
				
				
			});
			
			
				$("#jazzmnbt2").click(function(){
					

					
				if(count == 2){
				slideIn();
				} else
				{
				$current_new = $("#s2");
				slideOut();
				}
				
				count = 2;	
					
				});
					
					$("#jazzmnbt3").click(function(){
					
					
					if(count == 3){
					slideIn();
					} else
					{
					$current_new = $("#s3");
					slideOut();
					}
					
					count = 3;	
						
					});
			
						$("#jazzmnbt4").click(function(){
							
	
						
						if(count == 4){
						$current = $("#s4");
						slideIn();
						} else
						{
						$current_new = $("#s4");
						slideOut();
						}
						
						count = 4;	
							
						});
			
							$("#jazzmnbt5").click(function(){
							
							if(count == 5){
							$current = $("#s5");
							slideIn();
							} else
							{
							$current_new = $("#s5");
							slideOut();
							}
							
							count = 5;	
							
							});
							
								$("#soundOff").click(function(){
									$("#hiddenPlayer").empty();
									$("#audio").hide(500);

								});
								

				$('#slider').nivoSlider({
						effect:'random', //Specify sets like: 'fold,fade,sliceDown'
						slices:15,
						animSpeed:500, //Slide transition speed
						pauseTime:4000,
						
						directionNav:false, //Next & Prev
						directionNavHide:true, //Only show on hover
						controlNav:false, //1,2,3...
						controlNavThumbs:false, //Use thumbnails for Control Nav
						controlNavThumbsFromRel:false, //Use image rel for thumbs
						controlNavThumbsSearch: '.jpg', //Replace this with...
						controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
						keyboardNav:true, //Use left & right arrows
						pauseOnHover:true, //Stop animation while hovering
						manualAdvance:false, //Force manual transitions
						captionOpacity:0.8, //Universal caption opacity
						beforeChange: function(){},
						afterChange: function(){},
						slideshowEnd: function(){}, //Triggers after all slides have been shown
						lastSlide: function(){}, //Triggers when last slide is shown
						afterLoad: function(){} //Triggers when slider has loaded
						});

	
      
});

		


// JavaScript Document
