function player(file) {
	return '&nbsp;&nbsp;&nbsp;<object type="application/x-shockwave-flash" data="' + file + '" width="' + 340 + '" height="' + 22 + '"><param name="movie" value="' + file + '" /><div style="width: 336px; height: 18px; font: 12px verdana; border: 2px solid black; vertical-align: middle; text-align: center">Please <a href="http://www.macromedia.com/go/getflashplayer">install flash</a> to hear this track.</div></object>';
}

function play_file(file) {
	document.getElementById('music_container').innerHTML = player(file);
	return false;
}

// called by music.html
function play(file) {
	play_file('music/' + file);
}

// called by admin_music.html
function play_audio(file) {
	play_file('audio/' + file);
}

// called by browse.html (to replace music.html)
function play_sample(id) {
	return play_file('audio/sample_' + id + '.swf');
}

var search_button_state = false;

// onchange="update_search_button()" onkeyup="update_search_button()" onkeydown="update_search_button()" 
function update_search_button() {
	if(tag('search').value == '') {
		if(search_button_state) {
			return;
		}
		search_button_state = true;
		tag('search_button').value = 'Display All Tracks';
	} else {
		if(!search_button_state) {
			return;
		}
		search_button_state = false;
		tag('search_button').value = 'Search';
	}
}

