﻿var videoNonLeadPanel = function(settings) {
	this.adVideoPlayUrl = settings.adVideoPlayUrl;

	this.bindEvents();
}

videoNonLeadPanel.prototype = {
	bindEvents: function() {

	},


	adVideoPlay: function(e) {
		var firstAndOnlyVideoAd = $(".videoAd");

		if (firstAndOnlyVideoAd.length > 1)
			console.log("More then one video ad detected on page. This will cause problems");

		this.targetId = firstAndOnlyVideoAd.attr("targetId");
		this.hitId = firstAndOnlyVideoAd.attr("usageHitId");

		$.ajax(
		{
			type: "POST",
			url: this.adVideoPlayUrl,
			dataType: "json",
			data: {
				SchedulesRef: this.targetId,
				HitsRef: this.hitId
			},
			context: this,
			cache: false,
			success: function(bool) {
				var test = bool;
			}
		});
	}
};
