var files = [];
var dir;

//jQuery.noConflict();

function slideSwitchMain() {
    var $active = jQuery('#slideshow img.active');

    if ( $active.length == 0 ) $active = jQuery('#slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : jQuery('#slideshow img:first');

    $active.addClass('last-active');
	
	//$active.animate({opacity: 0.0}, 1000, function() {});
	
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

/*function slideshowAjax(dir)
{
	//$.getJSON('./getfiles.php',{dir: dir},function(fileslist){
	jQuery.getJSON('./templates/its12_artro/ajax/getfiles.php',{dir: dir},function(fileslist){
		files = fileslist;
		//alert([files]);
		createImgs();
		setInterval( "slideSwitch()", 3000 );
	});
}*/

 jQuery(document).ready(function(){
	if (document.getElementById("slideshow")) {
		//var dir = "../../../images/stories/slide-main";
		//createImgs();
		setInterval( "slideSwitchMain()", 4000 );
		//slideshowAjax(dir);
	}
});
