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", "636", "306", "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();
        //move the last item and put it as first item
        jQuery('#slides li:first').before(jQuery('#slides li:last'));
        //set the default item to correct position
        jQuery('#slides ul').css({'top' : -item_height});
        jQuery('#up').click(function() {
		//get the right position
		var top_indent = parseInt(jQuery('#slides ul').css('top')) + item_height;
		//slide the item
		jQuery('#slides ul').animate({'top' : top_indent}, 380, 'easeInOutBack', function(){
                        //move the last item and put it as first item
			jQuery('#slides li:first').before(jQuery('#slides li:last'));
			//set the default item to correct position
			jQuery('#slides ul').css({'top' : -66});
		});
		//cancel the link behavior
		return false;
	});
    //if user clicked on next button
	jQuery('#down').click(function() {
		//get the right position
		var top_indent = parseInt(jQuery('#slides ul').css('top')) - item_height;
		//slide the item
		jQuery('#slides ul').animate({'top' : top_indent}, 380, 'easeInOutBack', function () {
                        //move the first item and put it as last item
			jQuery('#slides li:last').after(jQuery('#slides li:first'));
                        //set the default item to correct position
			jQuery('#slides ul').css({'top' : -66});
		});
		//cancel the link behavior
		return false;
	});

        //pane slider
        var par;
        function arrowAdd(par){
            jQuery(par).addClass('arrow').siblings().removeClass('arrow');
        }
        //get the height of the pane item
        var pane_height = jQuery('#test div').outerHeight();
        //assign the selected class to the first item
        jQuery('#slides ul li:nth-child(2)').addClass('arrow');
        //on click animate the position of the pane item, assigning the selected
        //class to the clicked item and removing it for the siblings
        jQuery('#slides ul li').click(function(){
            var index = jQuery(this).attr('value');
            
            jQuery('#test').animate({'top' : -(pane_height*index)}, 800, 'easeOutQuart');
            arrowAdd(this);
            //cancel the link behavior
            return false;
        });
		
		/*jQuery('#slides ul li').hover(function(){
           jQuery(this).addClass('arrow').siblings().removeClass('arrow');
        });*/
});

