var resetPosition;	// < Stores the original layout location of the video player. Populated before expansion.
var resetDimensions; // < Stores the original layout width/height of the video player
var winDims; // < Stores window dimensions
var docDims; // < Stores document dimensions
var fullScreenState = false; // < Boolean flag denoting player state
var fullScreenDocPad = 10; // < Desired border around the player
var fullScreenTransitionDuration = 1; // In seconds.
var fullScreenWindowListener; // Reference to the interval used in this case.
var playerDidUpdateTrimParameters = false;

function updateTrimFormWithStartAndEnd(args) {
	playerDidUpdateTrimParameters = true;
	args = args.split(":");
	var start = args[0];
		start = (start=="NaN")? 0 : start;
	var end = args[1];
		end = (end=="NaN")? 0 : end;
	$('video_clip_start_at').value = start;
	$('video_clip_starts_at_readout').innerHTML = millisecondsToFriendlyDuration(start);
	$('video_clip_end_at').value = end;
	$('video_clip_ends_at_readout').innerHTML = millisecondsToFriendlyDuration(end);
}

function millisecondsToFriendlyDuration(arg) {
	arg = parseInt(arg);
	s = arg/1000;
	m = Math.floor(s/60); s -= (m*60);
	h = Math.floor(m/60); m -= (h*60);
	s = Math.floor(s); m = Math.floor(m); h = Math.floor(h);
	s = (s==0)? "00" : s;
	m = (m==0)? "00" : m;
	h = (h==0)? "00" : h;
	return (h>0)? h+"h"+m+"m" : m+"m"+s+"s";
}