﻿var currentProductLabel = '';
var curVisistatId = '';

function startFlowPlayer(productLabel, visistatId) {
	currentProductLabel = productLabel;
	curVisistatId = visistatId;
	addPlayVisistat('start');
}

function addPlayVisistat(curPercent) {
	InsertExtraVisistat(curVisistatId, '' + currentProductLabel + ' progress = ' + curPercent);
}

function playVid(id, half, complete) {
	flowplayer(id, "/media/movies/flvs/flowplayer.commercial-3.1.5.swf", { key: '#@bf894d5ed2e56f7f7e0',
		clip: {
			onCuepoint: [[half, complete], function (clip, cuepoint) {
				if (cuepoint == half)
					point = 'half';
				else if (cuepoint == complete)
					point = 'complete';
				addPlayVisistat(point);
			} ]
		},
		plugins: {
			controls: null
		}
	});
}

jQuery(document).ready(function () {
	if ($('#platinumVideo').length > 0) {
		flowplayer("platinumVideo", "/media/movies/flvs/flowplayer.commercial-3.1.5.swf", { key: '#@bf894d5ed2e56f7f7e0',
			clip: {
				onCuepoint: [[70000, 141000], function (clip, cuepoint) {
					if (cuepoint == 70000)
						point = 'half';
					else if (cuepoint == 141000)
						point = 'complete';
					addPlayVisistat(point);
				} ]
			},
			plugins: {
				controls: null
			}
		});
	}
});
