carousel={
	init_flash:function(){
		$$('#carousel div.flash').each(
			function(e){
				if(typeof(e.down('.url'))!="undefined"){
					var so = new SWFObject(e.down('.url').readAttribute('href'), e.identify()+"-swf", "605", "200", "8", "#ffffff");
					so.addParam('allowScriptAccess','always');
					so.addParam('allowFullScreen','true');
					so.addParam('wmode','transparent');
					so.write(e.identify());
				}
			}
		);
	}
}

// JavaScript Document
jQuery(document).ready(function(){
	var item_height = jQuery('#slides li').outerHeight();
    jQuery('#up').click(function() {
    	var top_indent = parseInt(jQuery('#slides ul').css('top')) + item_height;
		jQuery('#slides ul').animate({'top' : top_indent}, 380, 'easeInOutBack', function(){
			jQuery('#slides li:first').before(jQuery('#slides li:last'));
			jQuery('#slides ul').css({'top' : 0});
		});
		return false;
	});
	jQuery('#down').click(function() {
		var top_indent = parseInt(jQuery('#slides ul').css('top')) - item_height;
		jQuery('#slides ul').animate({'top' : top_indent}, 380, 'easeInOutBack', function () {
			jQuery('#slides li:last').after(jQuery('#slides li:first'));
			jQuery('#slides ul').css({'top' : 0});
		});
		return false;
	});

	var par;
    function arrowAdd(par){
    	jQuery(par).addClass('active').siblings().removeClass('active');
    }

    jQuery('#slides ul li:nth-child(1)').addClass('active');

    // animate the position of the pane item on click
    jQuery('#slides ul li').click(function(){
    	var index = jQuery(this).attr('value');
    	var pane_height = jQuery('#pane div').outerHeight();
    	jQuery('#pane').animate({'top' : -(pane_height*index)}, 800, 'easeOutQuart');
        arrowAdd(this);
        return false;
    });

});
