//    Copyright (c) 2010 Cityswift Internet Limited

window.addEvent('domready',function() {
    $$('.dropdown li').each(function(li) {
        li.addEvents({
            mouseover: function() {
                li.addClass('hover');
            },
            mouseout: function() {
                li.removeClass('hover');
            }
        });
    });
    $$("a").filter(function(el) {
        return el.href && !el.href.indexOf("http://www.flickr.com/photos/") && el.firstChild && el.firstChild.src;
    }).slimbox({
        loop: true,
        initialWidth: 1024,
        initialHeight: 768,
        overlayOpacity: 0.6,
        overlayFadeDuration: 200,
        resizeDuration: 1000,
        resizeTransition: Fx.Transitions.Elastic.easeOut,
        counterText: "This is image <strong>{x}</strong> on a total of <strong>{y}</strong> in this fabulous Flickr image gallery",
        previousKeys: [37, 80, 16],
        nextKeys: [39, 78, 17],
    }, function(el) {
        return [el.firstChild.src.replace(/_[mts]\.(\w+)$/, ".$1"),
            (el.title || el.firstChild.alt) + '<br />Visit the <a href="' + el.href + '">Flickr page</a> for this picture.'];
    });
});
