var EKMA_SlideShow = function(ContainerID, IMGSelector){
    this.containerID = ContainerID;
    this.$imgFiles = $(IMGSelector);
    this.$file_cont = $('#' + this.containerID + ' ._img_cont');
    this.$file_cont_next = $('#' + this.containerID + ' ._img_cont_next');
    this.$title_cont = $('#' + this.containerID + ' ._title_cont');
    
    this.file_count = this.$imgFiles.size();
    
    this.previous_file = 0;
    
    this.start = function(ObjRef, NextFile){
        if(NextFile == undefined) NextFile=0;
        
        
        if(this.previous_file == 0 && NextFile == 0){
            var $_file = this.$imgFiles.eq(NextFile);
            
            this.$file_cont.html($_file);
            var _height = this.$file_cont.outerHeight();
            //alert(this.$file_cont.outerHeight());
            //$('#'+this.containerID).css({'height':parseInt(_height) + 'px'});
            $('#'+this.containerID).css({'height':parseInt(this.$file_cont.outerHeight()) + 'px'});
            
            
        }
        
        this.previous_file = NextFile;
        NextFile++;
        
        if(NextFile > this.file_count-1){
            NextFile = 0;
        }
        
        
        ///sıradaki dosyayı _img_cont_next'ın içine at
        var $_file = this.$imgFiles.eq(NextFile);
        
        
        this.$file_cont_next.css({opacity:0.0}).html($_file);
        
        $('#'+this.containerID).css({'height':parseInt(this.$file_cont_next.outerHeight()) + 'px'});
        
        //görünen resmi kaybet
        this.$file_cont.animate({opacity:0.0},1000);
        
        //sıradaki resmi göster
        this.$file_cont_next.animate({opacity:1.0},1000,function(){
            
            $('#' + ContainerID + ' ._img_cont').html($('#' + ContainerID + ' ._img_cont_next').html()).css({opacity:1.0});
            
            eval("ekma_ss_cntr_" + ContainerID + "=0; ekma_interval_" + ContainerID + " = setInterval('if(ekma_ss_cntr_" + ContainerID + " != 0){clearInterval(ekma_interval_" + ContainerID + "); "+ObjRef+".start(\""+ObjRef+"\", \""+NextFile+"\");} ekma_ss_cntr_" + ContainerID + "++;',3000);");
            
            //eval(ObjRef + ".start('"+ObjRef+"', '"+NextFile+"');");
            
        });
    }//end method start
}//end class EKMA_SlideShow()
