function defaultVideoAdvancementHandler() {
	this.position = 0;
	this.setNewPosition = function(position) {
		this.position = position;
		// do any fancy UI moves like highlighting items here
	}
}

function defaultStartSlateHandler(backgroundImage) {
	return '<img style="POSITION: absolute; Z-INDEX: 5000;" src="'+backgroundImage+'" width="384" height="216"><div id="playDiv" style="filter:alpha(opacity=100);-moz-opacity:1;opacity:1; position:absolute; top: 68px; left: 135px; z-index:10000;"><a href="javascript:CNNPlaylistManager.getInstance().advanceTo(\''+CNNPlaylistManager.getInstance().activePlaylist+'\',0)"><div id="play_button_ht"><img id="playImg" border="no" src="http://i.l.cnn.net/cnn/video/bvp/images/play_HT_off.png"></div></a></div>';
}

function defaultNextUpSlateHandler(backgroundImage) {
	
}

function defaultControlsHandler(m,a) {
	var controller = (navigator.appName.indexOf("Microsoft") != -1) ? window["customcontrols"] : document["customcontrols"];
	return controller[m](a);
}

function defaultEndSlateHandler(backgroundImage) {
	str = "<img style='filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60; POSITION: absolute; Z-INDEX: 5000' src='"+backgroundImage+"' width='384' height='216'>";
	str += '<div id="replayButton" style="z-index: 9500; position: absolute;top:82px;left:78px;"><a onmouseover="flipBVPImage(\'replay\',\'rply_sm\',\'on\',\'_ht\');" onmouseout="flipBVPImage(\'replay\',\'rply_sm\',\'off\',\'_ht\');" href="javascript:CNNPlaylistManager.getInstance().advanceTo(\''+CNNPlaylistManager.getInstance().activePlaylist+'\','+(CNNPlaylistManager.getInstance().playlists[CNNPlaylistManager.getInstance().activePlaylist].jsonList.length-1)+')"><div id="replay_button_ht"><img id="replayImg" border="no" src="http://i.l.cnn.net/cnn/video/bvp/images/rply_sm_off.png"></div></a></div>';
	return str;
}

function defaultStartupErrorHandler(errorObjectCode) {
	document.getElementById('cnnVPFlashLargeContainer').innerHTML =	'<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 5px 0px 0px 0px; text-align: center; width: 100%;">'+generateXMPErrorMessage(errorObjectCode)+'</div></div>'
}

function defaultErrorSlateHandler(errorObjectCode) {
	return '<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 138px 0px 0px 0px; text-align: center; width: 100%;">'+generateXMPErrorMessage(errorObjectCode);+'</div></div>';
}

function generateXMPErrorMessage(errorObjectCode) {
	switch (errorObjectCode) {
		case xmp.XmpErrorCodes.FATAL_PLATFORM:
			return "The web browser you are using to view this video is not supported.";
		case xmp.XmpErrorCodes.FATAL_PLUGIN:
			return "A plugin required to play your video could not be located.";
		case xmp.XmpErrorCodes.FATAL_PLUGIN_INIT:
			return "The video timed out attempting to play.";
		case xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR:
			return "The video system was not able to establish connectivity due to a Proxy/Firewall or network connectivity.";
		case xmp.XmpErrorCodes.CRITICAL_PLAYER_CONNECTION:
			return "The video system was not able to establish connectivity due to a Proxy/Firewall or network connectivity.";
		default:
			return "Unspecified Fatal Error";
	}
}
