document.write('<div id="traildiv"></div>');

$(document).ready(function(){
	$('.external').attr('target', '_blank');
	
	$('#sermonLists').change(function(){	
		if(this.selectedIndex == 1) window.location = '/mcms_page_sermonlist_sort.php?groupby=series';
		if(this.selectedIndex == 2) window.location = '/mcms_page_sermonlist_sort.php?groupby=category';
		if(this.selectedIndex == 3) window.location = '/mcms_page_sermonlist_sort.php?groupby=month';
		if(this.selectedIndex == 4) window.location = '/mcms_page_sermonlist_sort.php?groupby=preacher';
	});
	
	$('.play').click(function(){
		var id = $(this).attr('id').split('-')[1];
		var url = 'http://my.ekklesia360.com/Clients/sermonaudioplayer.php?CMSCODE=EKK&siteid=2319&sermonid='+id+'&useSkin=skin_plain.xml&CMS_LINK=http://my.ekklesia360.com';
		window.open(url, 'wimpyMP3player','width=350,height=140,title=blah');
		return false;	
	});
});