function slideBlock(selector,act,opt,ping){

    //get current action
    if(!act)
        act='next';

    if(act=='slide'){
        ping='done';
        act='next';
    }
    
    //get def settings
    if(!opt.slideTime && typeof(opt.slideTime)!='undefined')
        opt.slideTime=2000;
        
    if(!opt.effectTime)
        opt.effectTime=1000;
        
    if(!opt.effect)
        opt.effect='opacity';

    if(ping){
        
        if(ping=='done'){
            if(opt.slideTime){
                //set next slide
                setTimeout(function(){ slideBlock(selector,act,opt); },opt.slideTime);
                return true;
            }
        }
        
    }
    
    //get slide items
    var items=jQuery(selector);
    if(items.length<2)
        return false;
    
    var cur_i=-1;
    //get current item
    items.each(function(i,item){
        cur_i++;
        if(jQuery(item).css('display')!='none'){
            return false;//break
        }
    });
    
    if(opt.effect=='opacity'){
        slideBlock_opacity(selector,act,opt,cur_i);
    }
    
}

function slideBlock_opacity(selector, act, opt, cur_i) {
    
    var items=jQuery(selector);
    
    jQuery(items[cur_i]).animate({opacity:0},opt.effectTime,false,function(){
                        
        jQuery(items[cur_i]).css('display','none');
                      
        if(act=='next') {
            cur_i++;
        } else {
            cur_i--;
		}
    
        if( !items[ cur_i ] ) {
            if( act == 'next' ) {
                cur_i = 0;
            } else {
                cur_i = (items.length * 1) - 1;
			}
        }
        
        jQuery(items[cur_i]).css('opacity',0).css('display','block').animate({opacity:1},opt.effectTime,false,function(){
            slideBlock(selector,act,opt,'done');
        });
                    
    });
    
}
