/*
################################################################
#Page: player.js
#Purpose: 
#Description: 
#Caveats: 
#Dependancies:
#Create Date: 23rd March 2007
#History:
#Author: Paul Hesketh
#params:
################################################################
*/
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function fnWritePlayer(config,height,width) {
	var so = new SWFObject(sitePath+"flash/main.swf", "main", height, width, "8", "#ffffff");
	so.addParam("menu", "false");
	so.addParam("play", "true");
	so.addParam("scale", "noscale");
	so.addParam("salign", "lt");
	so.addParam("wmode", "transparent");
	so.addVariable("sDebug", "false");
	so.addVariable("sPlayNextTrack", "true");
	so.addVariable("sSession", sSession);
	so.addVariable("sXmlConfig", sitePath+'xml/player/'+config);
	so.useExpressInstall(sitePath+'flash/expressinstall.swf');
	document.write(so.write("flashPlayer"));
}

function addTrackQS(qs){
	if(document.main.addTrackQS){
		document.main.addTrackQS(qs);
	}else{
		//we will use the embed instead;
		if(document.getElementById('embedMain')){
			document.getElementById('embedMain').addTrackQS(qs);
		}else{
			
		}
	}
}

function addXML(xml){
	if(document.main.addXML){
		document.main.addXML(xml);
	}else{
		//we will use the embed instead;
		if(document.getElementById('embedMain')){
			document.getElementById('embedMain').addXML(xml);
		}else{
			
		}
	}
}

// Handle all the FSCommand messages in a Flash movie.
function main_DoFSCommand(command, args) {
	var mainObj = isInternetExplorer ? document.all.main : document.main;
	if ((command == "buyAction") || (command == "FSCommand:buyAction")){
		vars = args.split(",");
		sPrice = vars[2].replace("}]","");
		fnUpdateCart(sPrice);
	}
	if ((command == "removeAction") || (command == "FSCommand:removeAction")){
		//code here
	}
	if ((command == "addAction") || (command == "FSCommand:addAction")){
		//code here
	}
	if ((command == "infoAction") || (command == "FSCommand:infoAction")){
		//code here
	}
}
	// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub main_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call main_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
	