

//the flash video player calls the trackVideoEvent function
function trackVideoEvent(eventVars) {
	// the eventVars look something like "vid-start|webcasts|webcasts-living-with"
	// so we want to look at particular parts of the event to trigger the right tracking
	var myEventVars = eventVars.split("|"); 

	switch(myEventVars[0]){
	case "vid-start":
		omniVideoStart(myEventVars[2]);
		break;
	case "vid-25%":
		omniVideo25(myEventVars[2]);
		break;
	case "vid-50%":
		omniVideo50(myEventVars[2]);
		break;
	case "vid-75%":
		omniVideo75(myEventVars[2]);
		break;
	case "vid-end":
		omniVideoComplete(myEventVars[2]);
		break;
	case "vid-end":
		omniVideoReplay(myEventVars[2]);
		break;
	}
}
geneVideoTrack = function( videoName, eventName ) {

	switch(eventName){
	case "start":
		omniVideoStart(videoName);
		break;
	case "25%":
		omniVideo25(videoName);
		break;
	case "50%":
		omniVideo50(videoName);
		break;
	case "75%":
		omniVideo75(videoName);
		break;
	case "complete":
		omniVideoComplete(videoName);
		break;
	case "replay":
		omniVideoReplay(videoName);
		break;
	} // end switch
} // end geneVideoTrack
/*
 * FLASH VIDEO TRACKING The following functions should be used to track Video
 * Starts, Completes, 25% Progress, 50% Progress, 75% Progress, and Replays.
 * Note that this is NOT the same tracking as enabled by the Omniture Media
 * Plugin. It is not possible to get this tracking using that plugin.
 * 
 * Each of the following functions should be called at the moment the video
 * passes a given completion point. If a user scrubs past or through a given
 * point, do NOT call the function. If a user scrubs back to a previous
 * completion point, the function should be called again.
 * 
 * omniVideoStart(videoName) omniVideoComplete(videoName) omniVideo25(videoName)
 * omniVideo50(videoName) omniVideo75(videoName) omniVideoReplay(videoName)
 * 
 * videoName should be a string of the appropriate video name. The entire value
 * captured in prop17 can only be 100 characters long. We will be prepending
 * around 30 characters for the channel, so please keep video name less than 70
 * characters.
 * 
 */

function omniVideoStart(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event18';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event18';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_start');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}

function omniVideoComplete(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event19';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event19';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_complete');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}

function omniVideo25(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event20';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event20';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_25');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}

function omniVideo50(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event21';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event21';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_50');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}

function omniVideo75(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event22';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event22';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_75');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}

function omniVideoReplay(videoName) {
	var s_linkTrackVarsTemp = s.linkTrackVars;
	var s_linkTrackEventsTemp = s.linkTrackEvents;
	s.linkTrackVars = 'events,eVar17,prop17';
	s.linkTrackEvents = 'event23';
	s.prop17 = s.eVar17 = s.channel + ':' + videoName;
	s.events = 'event23';
	s.tl(this, 'o', s.pageName + '|' + videoName + '| video_replay');
	s.linkTrackVars = s_linkTrackVarsTemp;
	s.linkTrackEvents = s_linkTrackEventsTemp;
	clearOmniVar();
}


