xhiveframework.pages['welcome-to-xhiveerp'].on_page_load = function(wrapper) {
	var parent = $('<div class="welcome-to-xhiveerp"></div>').appendTo(wrapper);

	parent.html(xhiveframework.render_template("welcome_to_xhiveerp", {}));

	parent.find(".video-placeholder").on("click", function() {
		window.xhiveerp_welcome_video_started = true;
		parent.find(".video-placeholder").addClass("hidden");
		parent.find(".embed-responsive").append('<iframe class="embed-responsive-item video-playlist" src="https://www.xhivetube.com/embed/videoseries?list=PL3lFfCEoMxvxDHtYyQFJeUYkWzQpXwFM9&color=white&autoplay=1&enablejsapi=1" allowfullscreen></iframe>')
	});

	// pause video on page change
	$(document).on("page-change", function() {
		if (window.xhiveerp_welcome_video_started && parent) {
			parent.find(".video-playlist").each(function() {
				this.contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
			});
		}
	});
}
