window.addEvent('domready', init);
var IE = Browser.Engine.trident;
var U = new URI(location.pathname, path);
function init() {
    $$('.delete').addEvent('click', function(e) {
        if (!window.confirm('Potwierdzenie spowoduje usunięcie. Kontynuować?')) {
            e.preventDefault();
        }
    });
    $$('#subscribe', '#unsubscribe').addEvent('click', function(event){
        event.preventDefault();
        form = this.getParent('form');
        form.set('send', {
            'url': basedir + 'infusions/newsletter_panel/data.php?' + this.get('name') + '=true',
            'onSuccess': function(response) {
                Growl.Smoke({text:response});
            }
        }).send();
    });
    if ($('header').getElement('input[type=text]')) {
        $('header').getElement('input[type=text]').addEvent('click', function() {
            this.set('value', '');
        });
    }
    if ($('table-clinics')) $('table-clinics').getElements('td').each(function(item) {
        item.addEvent('click', function() {
            document.location.href = item.getFirst('a').get('href');
        })
    });
    if ($('table-promo')) new Swiff(path + 'themes/default/flash/promo.swf', {
        width: 605,
        height: 180,
        params: {
            'wmode': 'transparent',
            'bgcolor': 'ffffff',
            'quality': 'high'
        }
    }).inject($('table-promo'));
    new Swiff(path + 'themes/default/flash/logosy.swf', {
        width: 910,
        height: 90,
        params: {
            'wmode': 'transparent',
            'bgcolor': 'ffffff',
            'quality': 'high'
        }
    }).inject($('flash'));
}
