

$(document).ready(function() {
    
                $('#adSmall').cycle({ 
                    fx: 'fade',
                    speed:    2500, 
                    timeout:  9000, 
                    easing: 'backinout', // use Penner calculations if desired
                    //delay:  2000, //use this compensate for the timing if multiple slideshows exist
                    //random: true,
                    pause: true 
                });
    

                // #adLarge Animation 08 2009 -------------------------------------------------------------------------------------------------
                var gdCfg = { // Set properties this animation's functions here, so we can access/change them in more than just the call to the cycle plugin
                    shown: 0,
                    canvas: '.canvas',
                    tray: '.slides',
                    speed: 2100,
                    delay: 800,
                    speedIn: 2000,
                    speedOut: 2000,
                    endCurtain: 150,
                    timeout: 1800,
                    autostop: 1,
                    easing: 'backinout',
                    fx: 'fade'                   
                }
                
                var resetTray = function() { // Resets tray display to none
                    if($(gdCfg.tray).css('display') == 'block') {
                        $(gdCfg.tray).css({'display':'none'});
                    };
                }
                
                var fadeInTray = function() { // Fades tray in
                    $(gdCfg.tray).fadeIn(gdCfg.delay);
                }
                
                var begin = function() { // Begins animation, increments counter of how many times animation has been shown
                    
                    resetTray();
                    fadeInTray();
                    cycling.go();
                    gdCfg.shown++;                    
                }

                var recycle = function() {                  
                    $(gdCfg.canvas).fadeIn(gdCfg.endCurtain,function(){
                        $(gdCfg.tray).fadeOut(1)})
                    .fadeOut(gdCfg.endCurtain,function(){
                        begin();
                        });                    
                    }

                var cycling =  {                    
                    go: function() {
                        $(gdCfg.tray).cycle({                   
                            fx: gdCfg.fx,
                            speed: gdCfg.speed,
                            timeout: gdCfg.timeout,
                            delay: gdCfg.delay,
                            autostop: gdCfg.autostop,
                            easing: gdCfg.easing,                       
                            sync: 1,
                            end: recycle
                        });                        
                    }
                }                

      
      var adLarge = begin();

    
    
    
    
    
    
    
    
    
    
    
    
});
