// JavaScript Document
// STJWomenTelling.js
//	29-Nov-2009
// Description:
//		Functions and data common to the article - STJWomenTelling
//
//		Depends on JQuery, JQueryTools
//
	$(document).ready(function(){ 
		try { 
			// setup Overlay tool
			$("#speakerThumbnails a").overlay({
				target: '#gallery'
				, expose: '#f1f1f1'
				, onBeforeLoad: function (event) {
					sjhs.consoleTrace.log("LOG", "Overlay event type (%s), tabIndex (%d)", event.type);
					// hide the player
					$f(0).hide();
				}
				, onBeforeClose: function (event) {
					sjhs.consoleTrace.log("LOG", "Overlay event type (%s), tabIndex (%d)", event.type);
					// show the player
					$f(0).show();
				}
			}).gallery({
				preload: true
			});
			
			// setup scrolling for the playlist elements
			$("div.playlist").scrollable({
				items:'div.clips',
				vertical:true,
				next:'a.down',
				prev:'a.up'

				, onBeforeSeek: function (event, indexNum) {
					sjhs.consoleTrace.log("LOG", "Scrollable event type (%s), tabIndex (%d)", event.type, indexNum);
				}, onSeek: function (event, indexNum) {
					sjhs.consoleTrace.log("LOG", "Scrollable event type (%s), tabIndex (%d)", event.type, indexNum);
				}, onStart: function (event, indexNum) {
					sjhs.consoleTrace.log("LOG", "Scrollable event type (%s), tabIndex (%d)", event.type, indexNum);
				}
			// use mousewheel plugin 
			}).mousewheel();
			
			// setup player 
			$f("player", '../flowplayer/flowplayer-3.1.5.swf', {
				plugins: { 
					// audio plugin
					audio: { 
						url: '../flowplayer/flowplayer.audio-3.1.2.swf'
					} 
					
					
					// bandwidth check plugin
					, bwcheck: {  
						url: '../flowplayer/flowplayer.bwcheck-3.1.3.swf' 
						, netConnectionUrl: 'http://www.stjohnhistoricalsociety.org/Articles/STJWomenTellingSpeakers/img_AliceOConnor_xl.jpg' + '?' + Math.random()
						, bitrates: { slow: 32, low: 48, mid: 64, high: 128 }
						, defaultBitRate: 32
//						, rememberBitRate: false
						, onBwDone: function(url, chosenBitrate, bitrate) {
							sjhs.consoleTrace.log("LOG", "Bandwith check done: url (%s) chosenBitrate(%d), bitrate(%d)" , url, chosenBitrate, bitrate);
							if (!$f(0).getConfig().bitrate) {
								$f(0).getConfig().bitrate = bitrate;
								$f(0).getConfig().chosenBitrate = chosenBitrate;
								var html;
								html = "Network download speed is: " +parseInt(bitrate)+ " kbps, selecting audio encoded at " +chosenBitrate+ " kbps.";
								$("#networkSpeed").html(html);
							}
						}
					}

					, myContent: {
						url: '../flowplayer/flowplayer.content-3.1.0.swf'
						, width: '95%'
						, height: '88%'
						, opacity: '1.0'
					}
				}	
			
				, clip: {
//					autoBuffering: true
//					, autoPlay: true
					baseUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/'
					
					// this event never fires !!!
					, onbeforeBegin: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeBegin: ", clip.completeUrl);
						
					}
					, onBegin: function (clip) {
						try {
							sjhs.consoleTrace.log("LOG", "Clip onBegin: ", clip.completeUrl);

							// Create array of cuepoints							
							var xx;
							xx = this.getConfig().playlistCuepoints;
							var cueTimes = [];
							var clipUrl1;
							clipUrl1 = (clip.originalUrl.search(/^http:/i) != -1) ? clip.originalUrl : clip.baseUrl + clip.originalUrl;
							for (var ii=0, nn=xx.length; ii < nn; ii++ ) {
								if (xx[ii].clipUrl == clipUrl1) {
									for (var j=0, nnn=xx[ii].clipCuepoints.length; j < nnn; j++ ) {
										cueTimes.push(xx[ii].clipCuepoints[j].cueTime);
									}
									break;
								}
							}
							
							// If this playlist has cuepoints, then mark them invalid
							//var z = this.getConfig().playlistCuepoints;
			//				/for (var iii=0, nnn=z.length; iii < nnn; iii++ ) {
			//					z[iii].isInvalid = true;
			//				}
	
							// Operate on current clip
							this.getPlaylist()[0].onCuepoint(cueTimes, function (clip, cuepoint) {
								// if (!x[i].isInvalid) {  Confused where to test????
								sjhs.consoleTrace.log("LOG", "cuepoint " + cuepoint + " entered on clip " + clip.url);
								var x;
								x = this.getConfig().playlistCuepoints;
								for (var i=0, n=x.length; i < n; i++ ) {
									var clipUrl2;
									clipUrl2 = (clip.originalUrl.search(/^http:/i) != -1) ? clip.originalUrl : clip.baseUrl + clip.originalUrl;
									if (x[i].clipUrl == clipUrl2) {
										// loop thru array of cuepoints for this url, searching for matching cue time
										for (var k=0, kn=x[i].clipCuepoints.length; k < kn; k++ ) {
											if (x[i].clipCuepoints[k].cueTime == cuepoint) {
												var html;
												html =  x[i].clipCuepoints[k].cueHtml;
												this.getPlugin("myContent").setHtml(html);
											}
										}
									}
								}
							});

						} catch(exception) {
							sjhs.consoleTrace.log("ERROR", 'Clip Exception: ', exception);
						}
					}

					, onBeforeFinish: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeFinish: ", clip.completeUrl);
						$("#playerStatus").html("Player: onBeforeFinish");
					}
					, onFinish: function (clip) {
						pageTracker._trackEvent("Audio", "Clip Finish", clip.url, parseInt(this.getTime()));
						sjhs.consoleTrace.log("LOG", "onFinish: ", clip.completeUrl);
						$("#playerStatus").html("Player: onFinish");
					}
					
					, onBeforeStart: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeStart: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBeforeStart");
					}
					, onStart: function (clip) {
						pageTracker._trackEvent("Audio", "Clip Start", clip.url, parseInt(this.getTime()));
						sjhs.consoleTrace.log("LOG", "onStart: ", clip.completeUrl);
						$("#playerStatus").html("Playing: " + clip.url );
					}
					
					, onBeforePause: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforePause: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBeforePause");
					}
					, onPause: function (clip) {
						pageTracker._trackEvent("Audio", "Clip Pause", clip.url, parseInt(this.getTime()));
						sjhs.consoleTrace.log("LOG", "onPause: ", clip.completeUrl);
						$("#playerStatus").html("Player: onFinish");
					}
					
					, onBeforeResume: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeResume: ", clip.completeUrl);
						$("#playerStatus").html("Player: onBeforeResume");
					}
					, onResume: function (clip) {
						pageTracker._trackEvent("Audio", "Clip Resume", clip.url, parseInt(this.getTime()));
						sjhs.consoleTrace.log("LOG", "onResume: ", clip.completeUrl);
						$("#playerStatus").html("Player: onResume");
					}
					
					, onBeforeSeek: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeSeek: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBeforeSeek");
					}
					, onSeek: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onSeek: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onSeek");
					}
					
					, onBeforeStop: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBeforeStop: ", clip.completeUrl);
						$("#playerStatus").html("Player: onBeforeStop");
					}
					, onStop: function (clip) {
						pageTracker._trackEvent("Audio", "Clip Stop", clip.url, parseInt(this.getTime()));
						sjhs.consoleTrace.log("LOG", "onStop: ", clip.completeUrl);
						$("#playerStatus").html("Player: onStop");
					}
					
					, onUpdate: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onUpdate: ", clip.completeUrl);
						$("#playerStatus").html("Player: onUpdate");
					}
					
					, onBufferEmpty: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBufferEmpty: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBufferEmpty");
					}
					
					, onBufferFull: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBufferFull: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBufferFull");
					}
					, onBufferStop: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onBufferStop: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onBufferStop");
					}
					
					, onNetStreamEvent: function (clip) {
						sjhs.consoleTrace.log("LOG", "Clip onNetStreamEvent: ", clip.completeUrl);
						//$("#playerStatus").html("Player: onNetStreamEvent");
					}
					, urlResolvers: 'bwcheck'
				
				}
				
				// Custom property
				, playlistCuepoints: [ {
					clipUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/STJWomenTelling/LST1.m4a'
					, clipCuepoints: [ 
						  { cueTime: ((0*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_BeverlyBiziewski_pl.jpg" width="107" height="110" /><p>Beverly Biziewski</p>' }
						, { cueTime: ((0*60) + 19) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((0*60) + 36) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((0*60) + 45) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((0*60) + 50) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((0*60) + 58) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_ShirleySewer_pl.jpg" width="277" height="250" /><p>Shirley Frazier Sewer</p>' }
						, { cueTime: ((1*60) + 03) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EulitaJacobs_pl.jpg" width="274" height="250" /><p>Eulita Hansby Jacobs</p>' }
						, { cueTime: ((1*60) + 06) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((4*60) + 34) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EulitaJacobs_pl.jpg" width="274" height="250" /><p>Eulita Hansby Jacobs</p>' }
						, { cueTime: ((8*60) + 37) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((9*60) + 30) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((11*60) + 35) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((12*60) + 53) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						] }
				
					, {clipUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/STJWomenTelling/LST2.m4a'
					  , clipCuepoints: [ 
						  { cueTime: ((0*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((0*60) + 41) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((1*60) + 25) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((4*60) + 02) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((4*60) + 15) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndroChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((5*60) + 15) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((6*60) + 59) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((10*60) + 45) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_ShirleySewer_pl.jpg" width="277" height="250" /><p>Shirley Frazier Sewer</p>' }
						] }
	
					, {clipUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/STJWomenTelling/LST3.m4a'
					  , clipCuepoints: [ 
						  { cueTime: ((0*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EulitaJacobs_pl.jpg" width="274" height="250" /><p>Eulita Hansby Jacobs</p>' }
						, { cueTime: ((1*60) + 14) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((1*60) + 33) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((5*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((9*60) + 15) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((10*60) + 21) * 1000, cueHtml: '<img src="STJWomenTellingSpeakersimg_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((12*60) + 13) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						] }
	
					, {clipUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/STJWomenTelling/LST4.m4a'
					  , clipCuepoints: [ 
						  { cueTime: ((0*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_ShirleySewer_pl.jpg" width="277" height="250" /><p>Shirley Frazier Sewer</p>' }
						, { cueTime: ((0*60) + 57) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((2*60) + 05) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EulitaJacobs_pl.jpg" width="274" height="250" /><p>Eulita Hansby Jacobs</p>' }
						, { cueTime: ((4*60) + 50) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((8*60) + 39) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((9*60) + 40) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((10*60) + 25) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((10*60) + 48) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((11*60) + 02) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((11*60) + 41) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((14*60) + 31) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AliceOConnor_pl.jpg" width="222" height="250" /><p>Alice Rhymer OConnor</p>' }
						, { cueTime: ((15*60) + 18) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((17*60) + 20) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((19*60) + 10) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						] }
	
					, {clipUrl: 'http://www.stjohnhistoricalsociety.org/Multimedia/audio/STJWomenTelling/LST5.m4a'
					  , clipCuepoints: [ 
						  { cueTime: ((0*60) + 00) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((0*60) + 40) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((0*60) + 45) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_ShirleySewer_pl.jpg" width="277" height="250" /><p>Shirley Frazier Sewer</p>' }
						, { cueTime: ((0*60) + 55) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((1*60) + 14) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((2*60) + 35) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((3*60) + 25) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((3*60) + 46) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_YvonneWells_pl.jpg" width="222" height="250" /><p>Yvonne Hodge Wells</p>' }
						, { cueTime: ((4*60) + 05) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((6*60) + 41) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((7*60) + 33) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_ShirleySewer_pl.jpg" width="277" height="250" /><p>Shirley Frazier Sewer</p>' }
						, { cueTime: ((8*60) + 20) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Childs</p>' }
						, { cueTime: ((9*60) + 50) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_BeverlyBiziewski_pl.jpg" width="107" height="110" /><p>Beverly Biziewski</p>' }
						, { cueTime: ((9*60) + 56) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_MargieLabrenz_pl.jpg" width="116" height="109" /><p>Margie Labrenz</p>' }
						, { cueTime: ((10*60) + 10) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EulitaJacobs_pl.jpg" width="274" height="250" /><p>Eulita Hansby Jacobs</p>' }
						, { cueTime: ((10*60) + 38) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((10*60) + 45) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((10*60) + 52) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((11*60) + 35) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((13*60) + 01) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_EdnaFreeman_pl.jpg" width="285" height="250" /><p>Edna OConnor Freedman</p>' }
						, { cueTime: ((13*60) + 20) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((14*60) + 05) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_MorganBarlas_pl.jpg" width="110" height="110" /><p>Morgan Barlas</p>' }
						, { cueTime: ((14*60) + 15) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((14*60) + 58) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((15*60) + 26) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_MorganBarlas_pl.jpg" width="110" height="110" /><p>Morgan Barlas</p>' }
						, { cueTime: ((15*60) + 32) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_NaomiVarlack_pl.jpg" width="310" height="250" /><p>Naomi OConnor Varlack</p>' }
						, { cueTime: ((15*60) + 41) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_AndromeadaChilds_pl.jpg" width="282" height="250" /><p>Andro Keating Childs</p>' }
						, { cueTime: ((16*60) + 01) * 1000, cueHtml: '<img src="STJWomenTellingSpeakers/img_BeverlyBiziewski_pl.jpg" width="107" height="110" /><p>Beverly Biziewski</p>' }
						] }
					]
				// Custom properties
				, chosenBitrate: null
				, bitrate: null
				
				// event callbacks
				, onBeforeClick: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onBeforeClick (%s)", event);
					$("#playerStatus").html("Player: onBeforeFinish");
				}

				, onError: function (errorCode, errorMessage) {
					sjhs.consoleTrace.log("ERROR", errorMessage);
					$("#playerStatus").html("Player: onBeforeFinish");
				}
				
				, onBeforeLoad: function (event) {
					sjhs.consoleTrace.log("LOG", "Player OnBeforeLoad (%s)", event);
					$("#playerStatus").html("Player: Loading...");
					// Since player not loaded, api call fails...
					var html;
					html = 'Loading data...<img src="../GIFs/loading.gif" />';
//	player not loaded yet!					
//					this.getPlugin("myContent").setHtml(html);
				}
				, onLoad: function (event) {
					sjhs.consoleTrace.log("LOG", "Player Onload (%s)", event);
					$("#playerStatus").html("Player: Loaded.  Detecting network download speed...");
 
				}
				
				, onBeforeUnload: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onBeforeUnload (%s)", event);
					// $("#playerStatus").html("Player: onBeforeUnload");
				}
				, onUnload: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onUnload (%s)", event);
					// $("#playerStatus").html("Player: onUnload");
				}
				
				, onClipAdd: function(clip) {
					sjhs.consoleTrace.log("LOG", "Player onClipAdd ", clip.completeUrl);
					$("#playerStatus").html("Player: onClipAdd");
				}
				, onPlaylistReplace: function(playlist) {
					sjhs.consoleTrace.log("LOG", "Player onPlaylistReplace ", playlist[0].completeUrl);
					$("#playerStatus").html("Player: onPlaylistReplace");
				}
				
				, onMouseOver: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onMouseOver (%s)", event);
					//$("#playerStatus").html("Player: onMouseOver");
				}
				
				, onMouseOut: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onMouseOut (%s)", event);
					//$("#playerStatus").html("Player: onMouseOut");
				}
				
				, onKeyPress: function (event) {
					sjhs.consoleTrace.log("LOG", "Player onKeyPress (%s)", event);
					//$("#playerStatus").html("Player: onKeyPress");
				}
				
			// use playlist plugin to enable playlist items work as movie clips
			}).playlist("div.clips"
				, {loop: true}				// When clip completes, advance to next clip
				, {playOnClick: true}		// ??
			);	
		} catch(exception) {
			sjhs.consoleTrace.log("ERROR", 'Exception: ', exception);
		}
	});	
