/*
 * MovingBoxes demo script
 */

$(function(){

	$('#slider').movingBoxes({
		startPanel   : 5,      // start with this panel
		width        : 850,    // overall width of movingBoxes (not including navigation arrows)
		panelWidth   : .3,     // current panel width adjusted to 70% of overall width
		buildNav     : false,   // if true, navigation links will be added
		fixedHeight  : false,
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } // function which gets nav text from span inside the panel header
	});

	// Add a slide
	var imageNumber = 1,
	panel = '<li><img src="images/*.jpg" alt="picture" /><h2>News Heading #*</h2><p>A very short exerpt goes here... <a href="#">more</a></p></li>',
	// to test adding/removing panels to the second slider, comment out the line above and uncomment out the line below - slider-two uses divs instead of UL & LIs
	// panel = '<div><img src="images/*.jpg" alt="picture" /><h2>News Heading #<span>*</span></h2><p>A very short exerpt goes here... <a href="#">more</a></p></div>',
	slider =  $('#slider'); // second slider

	// Set up demo external navigation links
	

	// Report events to firebug console
	$('.mb-slider').bind('initialized.movingBoxes initChange.movingBoxes beforeAnimation.movingBoxes completed.movingBoxes',function(e, slider, tar){
		// show object ID + event in the firebug console
		// namespaced events: e.g. e.type = "completed", e.namespace = "movingBoxes"
		if (window.console && window.console.firebug){
			var txt = slider.$el[0].id + ': ' + e.type + ', now on panel #' + slider.curPanel + ', targeted panel is ' + tar;
			console.debug( txt );
		}
	});

});
