;(function( $, undefined )
{
	ko.bindingHandlers.jPlayer = {
		init: function(element, valueAccessor, allBindingsAccessor, viewModel) {
			$(element).jPlayer({
				ready: function (event) {
					$(this).jPlayer("setMedia", {
						mp3: viewModel.json().audioURL,
					}).jPlayer("play");
				},
				ended: function (event) {
					viewModel.updateVM();
				},
				swfPath: "http://www.jplayer.org/2.1.0/js/Jplayer.swf",
				supplied: "mp3",
				preload: 'auto',
				wmode: 'window',
			});
		},
		
		update: function(element, valueAccessor, allBindingsAccessor, viewModel) {
			console.log("jPlayer updated! Now playing "
						+ viewModel.json().songTitle
						+ " by "
						+ viewModel.json().artistSummary
						+ " at URL "
						+ viewModel.json().audioURL);
			$(element).jPlayer("clearMedia").jPlayer("setMedia", {
				mp3: viewModel.json().audioURL
			}).jPlayer("play");
		}
	};
	
	function ViewModel()
	{
		this.stationText = '';
		
		this.stations = ko.observableArray([]);
		
		this.json = ko.observable({});
		
		this.history = ko.observableArray([]);
		
		this.addHistory = function(json)
		{
			this.history.unshift(json);
		}
		
		this.forceUpdateHistory = function($data)
		{
			viewModel.json($data);
			viewModel.addHistory(viewModel.json());
		}
		
		/***
		 *  accessors for the view
		 ***/
		 
		this.songUrl = ko.dependentObservable(function(key)
		{
			return this.json()['audioURL'];
		}, this);
		this.albumArt = ko.dependentObservable(function(key)
		{
			return this.json()['artistArtUrl'];
		}, this);
		this.title = ko.dependentObservable(function(key)
		{
			return this.json()['songTitle'];
		}, this);
		this.artist = ko.dependentObservable(function(key)
		{
			return this.json()['artistSummary'];
		}, this);
		this.album = ko.dependentObservable(function(key)
		{
			return this.json()['albumTitle'];
		}, this);
	}
	window.viewModel = new ViewModel();
	
	viewModel.getStations = function()
	{
		$.getJSON('/ajax/stations.json', function(data)
		{
			viewModel.stations(data);
		});
	}
	
	viewModel.updateVM = function()
	{
		$("#jquery_jplayer_1").jPlayer("pause");
		$.getJSON('/ajax/next_song.json', function(data)
		{
			data['artistArtUrl'] = data['artistArtUrl'] || "/static/img/noalbumart.png";
			viewModel.json(data);
			viewModel.addHistory(viewModel.json());
		});
	}
		
	$(document).ready(function()
	{
		viewModel.getStations();
		viewModel.updateVM();
		ko.applyBindings(viewModel, document.head);
		ko.applyBindings(viewModel, document.body);
	});
}(jQuery));

@@ -22,16 +22,31 @@
 ned )%0A%7B%0A
+%09var bridge;%0A%09%0A
 %09ko.bind
@@ -1946,41 +1946,84 @@
 %7B%0A%09%09
-$.getJSON('/ajax/stations.json', 
+bridge.getService(%22pandora%22, function (service) %7B%0A%09%09%09service.getStationList(
 func
@@ -2028,29 +2028,28 @@
 nction(data)
-%0A%09%09
+ 
 %7B%0A
+%09
 %09%09%09viewModel
@@ -2065,16 +2065,23 @@
 (data);%0A
+%09%09%09%7D);%0A
 %09%09%7D);%0A%09%7D
@@ -2168,42 +2168,81 @@
 ;%0A%09%09
-$.getJSON('/ajax/next_song.json', 
+bridge.getService(%22pandora%22, function (service) %7B%0A%09%09%09service.getNextSong(
 func
@@ -2251,21 +2251,20 @@
 on(data)
-%0A%09%09
+ 
 %7B%0A
+%09
 %09%09%09data%5B
@@ -2334,24 +2334,25 @@
 rt.png%22;%0A%09%09%09
+%09
 viewModel.js
@@ -2357,24 +2357,25 @@
 json(data);%0A
+%09
 %09%09%09viewModel
@@ -2405,16 +2405,23 @@
 son());%0A
+%09%09%09%7D);%0A
 %09%09%7D);%0A%09%7D
@@ -2422,17 +2422,16 @@
 %7D);%0A%09%7D%0A%09
-%09
 %0A%09$(docu
@@ -2456,16 +2456,101 @@
 on()%0A%09%7B%0A
+%09%09bridge = new Bridge(%7B apiKey: %22//FILL THIS IN%22 %7D);%0A%09%09%0A%09%09bridge.ready(function() %7B%0A%09
 %09%09viewMo
@@ -2568,16 +2568,17 @@
 ions();%0A
+%09
 %09%09viewMo
@@ -2591,24 +2591,25 @@
 dateVM();%0A%09%09
+%09
 ko.applyBind
@@ -2642,16 +2642,17 @@
 ead);%0A%09%09
+%09
 ko.apply
@@ -2687,16 +2687,22 @@
 .body);%0A
+%09%09%7D);%0A
 %09%7D);%0A%7D(j

Use bridge to get song information, rather than ajax.