function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	}

function loadIndex() {
        var url="/playlists/12/playlist/";
        url+="?genre="+document.getElementById('genre').options[document.getElementById('genre').selectedIndex].value;
        url+="&order="+document.getElementById('order').options[document.getElementById('order').selectedIndex].value;
        url+="&limit="+document.getElementById('limit').options[document.getElementById('limit').selectedIndex].value;
        //alert(url);
        loadFile(url);
    }

function additionalInit(){

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

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

    var asearch = new Ext.form.ComboBox({
        store: ads,
        displayField:'name',
        typeAhead: false,
        minChars:3,
        loadingText: 'Suche...',
        width: 250,
        pageSize:0,
        grow:true,
        hideTrigger:true,
        tpl: aresultTpl,
        onSelect: function(record){ // override default onSelect to do redirect
            loadFile('/artist/'+record.data.id+'/playlist/');
            //document.getElementById('asearch').value=record.data.name;
            this.collapse();
        }
    });

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

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

    var usearch = new Ext.form.ComboBox({
        store: uds,
        displayField:'name',
        typeAhead: true,
        minChars:3,
        loadingText: 'Suche...',
        width: 200,
        pageSize:0,
        hideTrigger:true,
        validateOnBlur:false,
        selectOnFocus:true,
        tpl: uresultTpl,
        onSelect: function(record){ // override default onSelect to do redirect
            loadFile('/user/'+record.data.id+'/playlist/');
            //document.getElementById('asearch').value=record.data.name;
            this.collapse();
        }

    });


    // apply it to the exsting input element
    asearch.applyTo('asearch');
    //usearch.applyTo('usearch');


    if (typeof(standalone)=="undefined") var so = new SWFObject("/player/mp3player.swf", "mpl", "610", "450", "8", "#cecece");
    else var so = new SWFObject("/player/mp3player_w.swf", "mpl", "610", "370", "8", "#cecece");
    if (typeof(playlist)=="undefined") playlist="/playlists/1/playlist/";
    so.addVariable("file",playlist);
    so.addVariable("autostart","false");
    so.addVariable("shownavigator","true");
    so.addVariable("overstretch","false");
    so.addVariable("displayheight","0");
    so.addVariable("backcolor","0xdddddd");
    so.addVariable("frontcolor","0x777777");
    so.addVariable("lightcolor","0x777777");
    so.addVariable("autoscroll","false");
    so.addVariable("shuffle","false");
    so.addVariable("repeat","list");
    so.addVariable("thumbsinplaylist","true");

    if (typeof(standalone)=="undefined") {
    so.addVariable("width","610");
    so.addVariable("height","450");
    }
    else {
    so.addVariable("width","610");
    so.addVariable("height","370");
    }

    so.addVariable("enablejs","true");
    so.addVariable("javascriptid","mpl");
    so.addParam("wmode", "transparent");

    so.write("player");
   

}



