
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
var swfVersionStr = "10.2.0";
// To use express install, set to playerProductInstall.swf, otherwise the empty string. 
var xiSwfUrlStr = "flash/playerProductInstall.swf";
var flashvars = {}; //splixID: "4AmYismrct.xml"};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "always";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "splixPlayer";
attributes.name = "splixPlayer";
swfobject.embedSWF(
    "flash/SplixPlayer.swf", "playerPlugin", 
    "320", "240", 
    swfVersionStr, xiSwfUrlStr, 
    flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#playerPlugin", "display:block;text-align:left;");

$(function() {
	$( "#beginning" ).button({
		text: false,
		icons: {
			primary: "ui-icon-seek-start"
		}
	});
	$( "#rewind" ).button({
		text: false,
		icons: {
			primary: "ui-icon-seek-prev"
		}
	});
	$( "#play" ).button({
		text: false,
		icons: {
			primary: "ui-icon-play"
		}
	})
	.click(function() {
		var options;
		if ( $( this ).text() === "play" ) {
			options = {
				label: "pause",
				icons: {
					primary: "ui-icon-pause"
				}
			};
			$('#splixPlayer').externalInterface({method:'startPlayer', args: '4AmYismrct.xml'});
		} else {
			options = {
				label: "play",
				icons: {
					primary: "ui-icon-play"
				}
			};
			$('#splixPlayer').externalInterface({method:'pausePlayer'});
		}
		$( this ).button( "option", options );
	});
	$( "#stop" ).button({
		text: false,
		icons: {
			primary: "ui-icon-stop"
		}
	})
	.click(function() {
		$( "#play" ).button( "option", {
			label: "play",
			icons: {
				primary: "ui-icon-play"
			}
		});
		$('#splixPlayer').externalInterface({method:'stopPlayer'});
	});
	$( "#forward" ).button({
		text: false,
		icons: {
			primary: "ui-icon-seek-next"
		}
	});
	$( "#end" ).button({
		text: false,
		icons: {
			primary: "ui-icon-seek-end"
		}
	});
	$( "#shuffle" ).button();
	$( "#repeat" ).buttonset();
});

