


	
function fadeinSlideshow(elem, slideDuration, fadeSpeed, current) {

	var ImgPath ="userfiles/image/slider-dar/"; // Klasor
	
    var ImgCount = new Number(4); // Klasordeki resim sayısı

    if (!current || current >= ImgCount) current = 0;

    if (!slideDuration) slideDuration = 5000;

    if (!fadeSpeed) fadeSpeed = 1000;

    $(elem + " img").attr("src", ImgPath + current + ".jpg");

    if (current == ImgCount-1) {
        $(elem).css("background", "transparent url(" + ImgPath + "0.jpg" + ") no-repeat");
    } else {

        $(elem).css("background", "transparent url(" + ImgPath + (current + 1) + ".jpg" + ") no-repeat");
    }

    $(elem + " img").animate(
	{ opacity: "1" }, 
	slideDuration).animate(
	{ opacity: "0.01" }, 
	fadeSpeed, function() { 
	$(this).css("opacity", "1"); 
	fadeinSlideshow(elem, slideDuration, fadeSpeed, current + 1); 
	});
}

function runSlideshow(){
    fadeinSlideshow("#slideshow", 3000, 1000);
}

$(document).ready(runSlideshow);
