var additionalInit=function(){


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

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

    var search = new Ext.form.ComboBox({
        store: ds,
        displayField:'name',
        typeAhead: true,
        minChars:3,
        loadingText: 'Suche....',
        width: 160,
        pageSize:0,
        hideTrigger:true,
        validateOnBlur:false,
        selectOnFocus:true,
        tpl: resultTpl,
        onSelect: function(record){ // override default onSelect to do redirect
            document.getElementById('cityId').value=record.data.id;
            document.getElementById('cityname').value=record.data.name;
            this.collapse();
            document.getElementById("evSubmit").disabled=''; 
        }
        

    });
    search.on("beforequery",function() {
            document.getElementById("evSubmit").disabled='disabled';
        }
    );
    search.on("focus",function() {
            document.getElementById("evSubmit").disabled='disabled';
        }
    );
    search.on("blur",function() {
            document.getElementById("evSubmit").disabled='';
        }
    );
   
    // apply it to the exsting input element
    search.applyTo('cityname');

};

