function rotate(src) { 
    jQuery( '#Rotator div.img img' ).
        animate( 
                {opacity: 0},
                500, 
                'swing', 
                function(){ jQuery(this).attr('src', src); } ).
        animate(
                {opacity: 1}, 
                500, 
                'swing'); 
}  

function initiateRotation( config ) {
    /* addres of items to be rotated used in jQueryuery() */ 
    var items_selector = '#' + config.rotator_id + ' .' + config.container_class + ' a'; 
    var items = jQuery('#Rotator div.cache img');  
    /*  address of box where curent item is displayed */ 
    var box_selector = ' #' + config.rotator_id + ' #' + config.rotator_box;
    var imageInterval = config.time * items.length;
    config['items'] = items;
    
    for( var i = 0; i < items.length; i++) { 
		/* send first vawe of rotator_idations */ 
        setTimeout("rotate( '" + jQuery(items[i]).attr('src') + "');",i*config.time ); 
        /* send the rest in setInterval */
        setTimeout('setInterval(\'rotate( \"' + jQuery(items[i]).attr('src')  + '\" );\', '+imageInterval+');', i*config.time);
    }
}

