window.addEvent('domready', function(){
    
    if ($('banner')) {
        
        var b = new Cycle('banner', {
            interval: 5000,
            active: '#banner-nav li',
            toggler: '#banner-nav li a'
        });        
        
        (function(){b.fadeIn();}).delay(1000);
        
    }
    
    if ($('prod-img')) {
        
        new Cycle('prod-img', {
            interval: 0,
            active: '#prod-img-thumb',
            toggler: '#prod-img-thumb a'
        }).start();
        
    }
    
    if (document.location.protocol == 'http:' && $('gmap')) {
        new GoogleMap($('gmap'), {
            lat: 51.4917345582506,
            lng: -0.192141815995148,
            zoom: 13,
            mapType: google.maps.MapTypeId.ROADMAP,
            markers: [
                /*{
                    label: 'Kensington',
                    lat: 51.4989210092752,
                    lng: -0.200258820075613,
                    info: 'Cyclopedia Kensington'
                },*/
                {
                    label: 'Chelsea',
                    lat: 51.484548107226,
                    lng: -0.184024811914683,
                    info: 'Cyclopedia Chelsea'
                }
            ],
            directions: false
        });
    }
    
    new DatePicker('.pickdate', {
        allowEmpty: true,
        format: 'd F Y',
        inputOutputFormat: 'd F Y H:i',
        positionOffset: {x:1, y:0}
    });
    
});

