function additionalInit(){



    var ds = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({
            url: '/livesearch.php?ct=booking'
        }),
        reader: new Ext.data.XmlReader({
            totalRecords: 'results',
            record: 'row'
        }, [
            {name: 'name'},
            {name: 'urlname'},
            {name: 'shortinfo'}
        ])
    });

     // Custom rendering Template
    var resultTpl = new Ext.Template(
        '<div class="booking-item">',
            '<p><b>{name}</b>',
            '<br>{shortinfo}',
        '</div>'
    );

    var search = new Ext.form.ComboBox({
        store: ds,
        displayField:'name',
        typeAhead: false,
        minChars:3,
        loadingText: 'Suche...',
        width: 145,
        pageSize:0,
        grow:true,
        hideTrigger:true,
        tpl: resultTpl,
        onSelect: function(record){ // override default onSelect to do redirect
            window.location =
                String.format('{0}', record.data.urlname);
        }
    });
    // apply it to the exsting input element
    search.applyTo('lsearch');



}


function zurueckziehen(id,aid,animfield) {

     Ext.MessageBox.buttonText.yes="OK";
    Ext.MessageBox.buttonText.cancel="Abbruch";
    Ext.MessageBox.buttonText.no="Nein";

        var msgb = Ext.MessageBox.getDialog();
    msgb.fixedcenter = false;
    msgb.on("beforeshow", function() {
        msgb.moveTo(200, 300);
    });

        Ext.MessageBox.show({
           title:'Wirklich zurückziehen?',
           msg: 'Wenn du deine Bewerbung zurückziehst, kannst du dich nicht erneut für dieses Angebot bewerben.',
           buttons: Ext.MessageBox.YESNO,
           fn: doZResult,
           maxWidth:400,
           animEl: animfield
       });


    function doZResult(btn){
        if (btn=="yes") {
            location.href='/backstage/gigs/zurueckziehen?aid='+aid+'&id='+id;
        }
    };

}


