	/*
	* Called from flash when the video player is initialised - prior to this function being called, you have no control of the video player
	*/
	function onVideoPlayerReady(id)
	{
		firstVidId = id.split("_")[2];
		loadVideo("/video/menu/inline/id/"+firstVidId, '', id);
	}

	function onVideoComplete(id)
	{
		//alert(id + ': video complete');
	}

	/*
	* Wraps up the equivalent loadVideoXML in the flash - will add an autoPlay flag later.... 
	*/
	function loadVideoXML(xmlURL, force)
	{
		var videoPlayer = (navigator.appName.indexOf ("Microsoft") != -1) ? window["video_player"] : document["video_player"];
		videoPlayer.loadVideoXML(xmlURL, force);
	}
	
	function getPlayer(id)
	{
		return videoPlayer = (navigator.appName.indexOf ("Microsoft") != -1) ? window[id] : document[id];
	}

	function trackLoadVideo(menuURL, path, videoTitle, id)
	{
		getPlayer(id).loadVideo(menuURL, path);

		// test to see if omniture is set on this page
		// if there is, record the tab load
	   	if(typeof s_gi=="undefined"){
			// there is not omniture code set on this page. 
			// as such, do not record a tab view.
		}else{
			setTimeout(function () { recordOmnitureVideoInline(videoTitle, 'loadInlineVideo','load inline video' ); },200);
		}
	}

	// load the omni image after the tab content loads.
	function recordOmnitureVideoInline(videoTitle, contenttype, contenttypename){
		// this function supplies pageName, site, division etc from what's already in the page.
		var s=s_gi('sbsdev');
		var fullTitle = s.pageName+':'+contenttypename+':'+videoTitle.toLowerCase();
		s.linkTrackVars='s.pageName,s.prop20,s.prop1,s.prop2,prop3,s.prop4,s.prop8';
		s.prop8 = contenttype;
		s.linkTrackEvents='None';
		s.tl(this,'o',fullTitle);
	}

	
	function loadVideo(menuURL, path, id)
	{
		getPlayer(id).loadVideo(menuURL, path);
	}

	function playVideo(menuURL, path, id)
	{
		getPlayer(id).playVideo(menuURL, path);
	}
