function doSearch(event) {
  if (event.keyCode == 13) {
      search();
	  event.preventDefault();
	  return false;
  }
}

function search() {
    var keyword = jQuery('#searchInput').val();
    if (keyword.length > 1) {
      jQuery('#searchForm').submit();
    }
    return false;
}

function download(id) {
	url = '/download/file/'+id;
	window.location.href=url;
	return;
	var newWindow = window.open(url, "_blank");
	if (newWindow) {
		if (newWindow.focus) {
			newWindow.focus();
		}
	}
	return false;
}

function bodyScrolled() {
    if(jQuery(window).scrollTop()>0) {
        jQuery("#scrollUp").show('slow');
    } else {
        jQuery("#scrollUp").hide('fast');
    }
}

function refreshJustPlaying(radioId){
    jQuery.ajax({
      method: "POST",
      url: "/ajax/justPlaying",
      data: "id="+radioId,
      success: function(data){
        jQuery("#justPlayingHolder").text(data);
      }
    });
}


