/*
	JWPLAYER.JS
	
	Version 1.0 2009-12-24 - Caroline Rojas
	 - Created
	Version 1.1 2010-09-29 - Mark Van de Velde 
	 - Function viewXMLMediaPlayer has attributes id and name to allow the video object to be identified
	 - Function viewXMLMediaPlayer has version updated from 9.0.0 to 9.0.115.0 in the instance of the object
*/

	
/* 	Function - MediaPlayer XML 
	Get Flash Player Variables from Config XML
	Set Default Height and Widths
*/
function XMLMediaPlayer(divid, configxml, playerwidthpx, playerheightpx) {
	//Config XML
	this.config = configxml;
	this.divid = divid;
	
		
	//Default Width
	this.playerwidthpx = playerwidthpx;
		
	if(!playerwidthpx){
		this.playerwidthpx = 480;
	}
		
	//Default Height + Skin Height
	this.playerheightpx = parseInt(playerheightpx)+18;
	
		
	if(!playerheightpx){
		this.playerheightpx = 270;
	}
		
	this.viewXMLMediaPlayer = viewXMLMediaPlayer;	
}


/* 	Function - viewXMLMediaPlayer
	Creates and write swf object
*/

function viewXMLMediaPlayer() {
		
	//Get the config flashvars
	var flashvars = {
		config: this.config,
		dock: false
		//autostart: false
	};
	var params = {
		allowfullscreen:true,
		allowscriptaccess:'always',
		allownetworking:'all'
	};
	var attributes = { 
		wmode:'opaque', 
		id:this.divid, // allows video object to be identified by id
		name:this.divid // allows video object to be identified by name

	};
		
	 //Write SWF object - updated to 9.0.115.0
	swfobject.embedSWF("http://www.swinburne.edu.au/import/jwplayer/player5.swf", this.divid, this.playerwidthpx, this.playerheightpx, "9.0.115.0", "http://www.swinburne.edu.au/import/jwplayer/expressInstall.swf", flashvars, params, attributes);
}
