// jquery wild card selectors https://api.jquery.com/category/selectors/
jQuery(function($) 
{
	// scroll bar for long lists
	$(".do-scroll").perfectScrollbar();

	//initialize jquery tooltip
	//https://api.jqueryui.com/tooltip/
	$(".cmsetip").tooltip({
		track: true,
		tooltipClass: "cmsetips",
		hide: "fast",
		show: "fast"
	});
	

	
	/** Chosen Init*/
	var config = {
	'.cmse-form select[size="1"]' : {width: 200, placeholder_text_single: 'Select'},
	'.chosen-select-deselect'  : { allow_single_deselect: true },
	'.chosen-select-no-single' : { disable_search_threshold: 10 },
	'.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
	'.chosen-select-rtl'       : { rtl: true },
	'.cmse-form select.wide-select': { width: 400 }
	};
	for (var selector in config) {
		$(selector).chosen(config[selector]);
	}
	
	$.fn.cmsechosen = function() {
	$(this).chosen({
		disable_search_threshold: 10,
		no_results_text: "Oops, nothing found!",
		placeholder_text_multiple: "Selct",
		width: 300
	});
	};
	
	$('.cmse-form select.chosen').cmsechosen();
	
	
	// Scroll To Top
	$(".btntop").click(function() {
	$("html, body").animate({ scrollTop: 0 }, "slow");
	return false;
	});
	
	// Scroll reveal
	$(window).on("scroll", function() {
		var yaxis = $(this).scrollTop();
		$(".btntop").toggleClass("slide-in", yaxis > 400);
	});
	
	// page builder section random display handler
	const rand_id = ["group1","group2","group3","group4","group5","group6","group7","group8","group9","group10"];
	$.each(rand_id, function(index,value) {
		var sectid = "section.maax-section-rand-"+value;
		var sectrand = Math.floor(Math.random() * $(sectid).length);
		$(sectid).hide().eq(sectrand).show();
	});
	
	
	/**Textarea Auto Height
	* https://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize#answer-25621277
	*/
	$('.autogrow').each(function() {
		this.setAttribute('style', 'height:'+(this.scrollHeight)+'px;overflow-y:hidden;');
	}).on('input', function() {
		this.style.height = 'auto';
		this.style.height = (this.scrollHeight)+'px';
	});
	
	// populate textarea on option select
	var fieldId = {
		"#cmse_options_cat_layout_def_preset":"#cmse_options_cat_layout_def",
		"#cmse_options_cat_itemslayout_def_preset":"#cmse_options_cat_itemslayout_def",
		"#cmse_options_page_layout_def_preset":"#cmse_options_page_layout_def",
	};
	$.each(fieldId, function(selector, txarea) {
		$(selector).change(function() {
			var selectVal = "#"+$(this).val();
			$(txarea).val( $(selectVal).text() );
			return false;
		});
	});
	
	
	// Slide Tabs
	function cmseSlideTabs() 
	{
		var allPanels = $(".tabcontent").hide();
		$(".tabhandle").click(function(e) {
			//e.preventDefault();
			$this = $(this);
			$target = $this.next();
			
			if( !$target.hasClass('active') ) {
				allPanels.removeClass('active').slideUp();
				$target.addClass('active').slideDown();
			}else{
				$target.removeClass('active').slideUp();
			}
			return false;
		});
	}
	
	cmseSlideTabs();
	
	
	/* ## LOGIN FORM WIDHET
	-------------------------------*/
	let formWrap = "#login-form-widget";
	$(formWrap).on("click", ".reg-form-slide", function() {
		$(".login-form-show").animate({"left": "-700px","right":"700px"}, "slow");
		$(".reg-form-show").animate({"left": "0px","right":"0px"}, "slow");
	});
	$(formWrap).on("click", ".login-form-slide", function() {
		$(".reg-form-show").animate({"left": "700px","right":"-700px"}, "slow");
		$(".login-form-show").animate({"right": "0px","left":"0px"}, "slow");
	});
	
	$(formWrap).on("click","#regbtn", function(e) {
		e.preventDefault();
		$.ajax({
			type: "POST",
			url: jsvar.maaxAjaxurl,
			data: {action: "userReg", formVal: $("#form-register").serialize()}
		}).done(function(response,status,xhr) {
			if( status == "success" && "" !== response )
			console.log(response);
		});
	});
	
	
	
	// direction slider
	$.fn.extend({
		slideRightShow: function() {
		return this.each(function() {
			$(this).show('slide', {direction: 'right'}, 1000);
		});
		},
		slideLeftHide: function() {
		return this.each(function() {
		  $(this).hide('slide', {direction: 'left'}, 1000);
		});
		},
		slideRightHide: function() {
		return this.each(function() {
		  $(this).hide('slide', {direction: 'right'}, 1000);
		});
		},
		slideLeftShow: function() {
		return this.each(function() {
		  $(this).show('slide', {direction: 'left'}, 1000);
		});
		}
	});
	
	// Select2 sortable list
	//$(".cmse-form select[size=\"1\"]").select2sortable();
	
	// shift title on/off radio buttons
	$.fn.cmseshift = function(src, dest) {
		
		$(src).insertAfter(dest);
		// if in widget
		if( pagenow == "widgets" ) {
		$(document).on("widget-added widget-updated", function(event, widget) {
			$(src).insertAfter(dest);
		});
		}
		
		return false;
	};
	
	/* 
	* highlight active dropslide when input checkbox is checked
	*/
	var activeCheck = "input[id*=_ison]";
	
	// find all checked when page is loaded and apply class to parent element
	$.fn.activeobject = function() {
		$(this).each(function() {
			if( $(this).is(":checked") ) {
				$(this).parents(".tabcontent").prev().addClass('inuse');
			}
		});
	};
	
	$(activeCheck).activeobject();
	
	// live indicator added when input is checked or unchecked
	$(activeCheck).change(function() {
		if( $(this).prop('checked') ) {
			$(this).parents(".tabcontent").prev().addClass('inuse');
		}else{
			$(this).parents(".tabcontent").prev().removeClass('inuse');
		}
	});
	
	
	
	/** Widget Save
	* on widget save re-initialize the functions
	* because the pagenow is literally admin-ajax.php
	* where the fuction was never initialized
	*
	* widget var list: wp-includes\js\customize-preview-widgets.js
	* widget-updated, widget-added, highlight-widget, active, refresh-widget-partial, partial-content-rendered, refresh
	* sidebar-updated, change, partial-content-moved, preview-ready
	*/
	$(document).on('widget-added widget-updated', function(event, widget) {
		cmseSlideTabs();
		//$(".cmse-form select[size=\"1\"]").select2sortable();
		$(activeCheck).activeobject();
		
		// chosen select
		$('.cmse-form select.chosen').cmsechosen();
	});
	
	/* JSCLOCK
	--------------------*/
	var $dOut = $('#date'),$hOut = $('#hours'),$mOut = $('#minutes'),$sOut = $('#seconds'),$ampmOut = $('#ampm');
	var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
	var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];

	function update(){
	  var date = new Date();
	  var ampm = date.getHours() < 12 ? 'AM':'PM';
	  var hours = date.getHours() === 0 ? 12 : date.getHours() > 12 ? date.getHours() - 12 : date.getHours();
	  var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
	  var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
	  var dayOfWeek = days[date.getDay()];
	  var month = months[date.getMonth()];
	  var day = date.getDate();
	  var year = date.getFullYear();
	  var dateString = dayOfWeek + ', ' + month + ' ' + day + ', ' + year;
	  
	  $dOut.text(dateString);
	  $hOut.text(hours);
	  $mOut.text(minutes);
	  $sOut.text(seconds);
	  $ampmOut.text(ampm);
	} 

	update();
	window.setInterval(update, 1000);
	
	
	/* KenBurns
	https://www.jqueryscript.net/slideshow/subtle-slideshow-ken-burns-effect.html
	---------------------------*/
	$.fn.kenBurnsFx = function(options)
	{
		var slides = $(this);

		var settings = $.extend({
		randomize: true,
		slideDuration: 6000,
		fadeDuration: 1000,
		animate: true,
		pauseOnTabBlur: true,
		enableLog: true,
		slideElementClass: 'slide',
		slideshowId: 'slideshow'
		}, options);

		// debug mode
		if(settings.enableLog == false){
			console.log = function() {};
		}

		if( settings.randomize == true ) {
			var slidesDOM = slides[0];
			for(var i = slidesDOM.children.length; i >= 0; i--) {
				slidesDOM.appendChild(slidesDOM.children[Math.random() * i | 0]);
			}
		}
		
		// Insert slideshow element
		//$('<div id="' + settings.slideshowId + '"></div>').insertBefore(slides);

		var paused = false;
		var slideshow = $('#' + settings.slideshowId);
		var slideTimeDelta = 0;
		var resumeStartTime = 0;
		var resumeTimer;
		if( settings.animate == true ) {
			var cssAnimationDuration = settings.slideDuration + settings.fadeDuration;
		}else{
			slides.find('.' + settings.slideElementClass + ' span.animate').removeClass('animate');
			var cssAnimationDuration = 0;
		}

		console.log('Slideshow initialized.');

		// Add the first slide to the slideshow
		slides.find('.' + settings.slideElementClass + ':first span.animate').addClass('active').css('animation-duration', cssAnimationDuration + 'ms')
		slides.find('.' + settings.slideElementClass + ':first').prependTo(slideshow);
		var currentSlideStartTime = Date.now();

		// Start interval loop
		slidesInterval = setInterval(slideRefresh, settings.slideDuration);

		console.log('Slideshow started.');

		if( settings.pauseOnTabBlur == true ) 
		{
			$(window).focus(function() 
			{
				console.log('Window gained focus.');
				if( paused == true ) {
					console.log('Resuming slideshow.');
					resumeStartTime = Date.now();
					paused = false;
					$('#' + settings.slideshowId + ' span.active:last').removeClass('paused');
					resumeTimer = setTimeout(function(){
						slideTimeDelta = 0;
						slideRefresh();
						slidesInterval = setInterval(slideRefresh, settings.slideDuration);
					}, settings.slideDuration - slideTimeDelta);
				}
			}).blur(function() {
				paused = true;
				console.log('Window lost focus, slideshow paused.');
				if( slideTimeDelta != 0 ) {
					var timeSinceLastPause = Date.now() - resumeStartTime;
					slideTimeDelta = slideTimeDelta + timeSinceLastPause;
					console.log('Time since last pause within this slide: ' + timeSinceLastPause + ' ms');
				}else{
					slideTimeDelta = Date.now() - currentSlideStartTime;
				}
				console.log('Current slide at ' + slideTimeDelta + ' ms.');
				$('#' + settings.slideshowId + ' span.active:first').addClass('paused');
				clearInterval(slidesInterval);
				clearTimeout(resumeTimer);
			});
		}

		function slideRefresh() 
		{
			console.log('Slide refresh triggered.');
			currentSlideStartTime = Date.now();
			var slideshowDOM = slideshow[0];

			if( slideshowDOM.children.length == 0 ) {
				console.log('There are no slides in the slideshow.');
				slides.find('.' + settings.slideElementClass + ':first').prependTo(slideshow);
			}else{
				slides.find('.' + settings.slideElementClass + ':first').prependTo(slideshow);
				var slideElement = '#' + settings.slideshowId + ' .' + settings.slideElementClass;
				$(slideElement + ':first span.animate').addClass('active').css('animation-duration', cssAnimationDuration + 'ms');;
				$(slideElement + ':last').fadeOut(settings.fadeDuration, function() {
					$(slideElement + ':last span.animate').removeClass('active').css('animation-duration', '0ms');;
					$(slideElement + ':last').appendTo(slides);
					slides.find('.' + settings.slideElementClass).show(0);
				});
			}
		}
	};
	
	/*
	Youtube off canvas controls
	to create play / stop buttons in HTML and locate anywhere on the page
	requires the video embed url to query enablejsapi=1
	<iframe id="lonevid" 
	src="https://www.youtube.com/embed/LrJbrydDf2s?enablejsapi=1&version=3&playerapiid=ytplayer" 
	frameborder="0" 
	allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
	</iframe>
	*/
	$("#stop-button,#pause-button,.pause-layer").hide();
	
	$("#play-button,#play-sm-button").on("click",function() {
		$("#lonevid")[0].contentWindow.postMessage(
		'{"event":"command","func":"'+'playVideo'+'","args":""}', '*'
		);
		$("#play-button,#play-sm-button").hide();
		$("#stop-button,#pause-button,.pause-layer").show();
	});

	$("#stop-button").on("click",function(){
		$("#lonevid")[0].contentWindow.postMessage(
		'{"event":"command","func":"'+'stopVideo'+'","args":""}', '*'
		);
		$("#stop-button,#pause-button,.pause-layer").hide();
		$("#play-button,#play-sm-button").show();
	});

	$("#pause-button,.pause-layer").on("click",function() {
		$("#lonevid")[0].contentWindow.postMessage(
		'{"event":"command","func":"'+'pauseVideo'+'","args":""}', '*'
		);
		$("#stop-button,#pause-button,.pause-layer").hide();
		$("#play-button,#play-sm-button").show();
	});
	
	$("#see-minicart").on("click",function() {
		$("#minicart").toggle(300);
	});
	
	// google map
	$(".gmaps").each(function(){
		let attribs = "width='100%' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0'";
		let gmapembed = "<iframe "+attribs+" src='https://maps.google.com/maps?&amp;q="+encodeURIComponent($(this).text())+"&amp;output=embed'></iframe>";
		$(this).html(gmapembed);
	});
	
});//\jQuery

// debugger
function dump(val) {
	return console.log(val);
}



/* MaaxSticky Change class on scroll*/
function maaxSticky(selector,stickOffset,stickPoint) {
	jQuery(function($) {
	$(window).scroll(function() {    
		var scroll = $(document).scrollTop();

		if (scroll >= stickOffset) {
			$(selector).addClass("opaque");
		}else
		if (scroll == stickPoint) {
			$(selector).removeClass("opaque");
		}
	});
	});
}

/*YouTube API connect*/
// https://developers.google.com/youtube/iframe_api_reference
/*var tag = document.createElement("script");
tag.src = "//www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

var player, fsiframe;
var $ = document.querySelector.bind(document);

function onYouTubePlayerAPIReady() {
	player = new YT.Player("lonevid", {
		events: {
			onReady: onPlayerReady,
			onStateChange: onPlayerStateChange,
			//onPlaybackQualityChange: onPlayerPlaybackQualityChange,
			//onPlaybackRateChange: onPlayerPlaybackRateChange,
			//onError: onPlayerError,
			//onApiChange: onPlayerApiChange
		}
	});
}

function onPlayerReady(event) {
	player.setVolume(100);
	var playButton = document.getElementById("play-button");
	playButton.addEventListener("click", function() {
		player.playVideo();
	});

	var pauseButton = document.getElementById("pause-button");
	pauseButton.addEventListener("click", function() {
		player.pauseVideo();
	});
	
	// do full screen
	var fsplayer = event.target;
	fsiframe = $('#lonevid');
	setupListener(); 
}

function onPlayerStateChange(event) {
  switch (event.data) {
    case YT.PlayerState.UNSTARTED:
      console.log('unstarted');
      break;
    case YT.PlayerState.ENDED:
      console.log('ended');
      break;
    case YT.PlayerState.PLAYING:
      console.log('playing');
      break;
    case YT.PlayerState.PAUSED:
      console.log('paused');
      break;
    case YT.PlayerState.BUFFERING:
      console.log('buffering');
      break;
    case YT.PlayerState.CUED:
      console.log('video cued');
      break;
  }
}

function onPlayerPlaybackQualityChange(playbackQuality) {
	console.log('playback quality changed to '+playbackQuality.data);
}

function onPlayerPlaybackRateChange(playbackRate) {
	console.log('playback rate changed to '+playbackRate.data);
}

function onPlayerError(e) {
	console.log('An error occurred: '+e.data);
}

function onPlayerApiChange() {
	console.log('The player API changed');
}

// fullscreen method
function setupListener() {
	$("#fs-button").addEventListener("click", function() {
		player.playVideo();//won't work on mobile

		var requestFullScreen = fsiframe.requestFullScreen || fsiframe.mozRequestFullScreen || fsiframe.webkitRequestFullScreen;
		if( requestFullScreen ) {
			requestFullScreen.bind(fsiframe)();
		}
	}
}
*/


/*UCWORDS
https://stackoverflow.com/questions/2017456/with-jquery-how-do-i-capitalize-the-first-letter-of-a-text-field-while-the-user
*/
function ucwords(str,force){
	str=force ? str.toLowerCase() : str;  
	return str.replace(/(\b)([a-zA-Z])/g, function(firstLetter) {
		return firstLetter.toUpperCase();
	});
}

function striptags(string) {
	return string.replace(/(<([^>]+)>)/gi, "");
}



/* get container width and height
https://www.javascripttutorial.net/javascript-dom/javascript-width-height/
cmseHW("div.wrap")["height"] - when output as objet
cmseHW("div.wrap","height") with var
*/
function cmseHW(wrapclass,type='') 
{
	let cmsewrap = document.querySelector(wrapclass);
	
	//offset include padding and border
	let offwidth = cmsewrap.offsetWidth;
	let offheight = cmsewrap.offsetHeight;
	
	//client include padding no border
	let cwidth = cmsewrap.clientWidth;
	let cheight = cmsewrap.clientHeight;
	
	// get margin or border of element
	let style = getComputedStyle(cmsewrap);
	
	let marginLeft = parseInt(style.marginLeft);
	let marginRight = parseInt(style.marginRight);
	let marginTop = parseInt(style.marginTop);
	let marginBottom = parseInt(style.marginBottom);
	
	let borderTopWidth = parseInt(style.borderTopWidth) || 0;
	let borderLeftWidth = parseInt(style.borderLeftWidth) || 0;
	let borderBottomWidth = parseInt(style.borderBottomWidth) || 0;
	let borderRightWidth = parseInt(style.borderRightWidth) || 0;
	
	//get the height and width of the window
	let win_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
	let win_height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
	
	// object output
	/*var val = {
		width:offwidth,
		height:offheight,
		winwidth:win_width,
		winheight:win_height
		};*/
	

	switch(type) {
		case 'height': val = offheight; break;
		case 'width': val = offwidth; break;
		default: val='';
	}
	
	//return JSON.stringify(val,null,4);
	return val;
}


/* PayPal Form ReadForm*/
function ReadForm(obj1, tst)
{
	var i,j,pos;
	val_total="";val_combo="";

	for(i=0; i < obj1.length; i++)
	{
		obj = obj1.elements[i];

		if( obj.type == "select-one" )
		{
			if( obj.name == "quantity" || obj.name == "amount" )
				continue;
			pos = obj.selectedIndex;
			val = obj.options[pos].value;
			val_combo = val_combo + " ("+val+")";
		}
	}

	val_total = obj1.product_tmp.value + val_combo;
	obj1.wspsc_product.value = val_total;
}



/*Select2 combined with jQuery UI sortable
* to enable multiple select field sorting
* this code snip enables updating the option values to the order of the sorting
* should be able to incorporate into jquery chosen
*/
(function($) 
{
	$.fn.extend({
		select2sortable: function(){
			var select = $(this);
			$(select).select2({width: 220});
			var ul = $(select).prev('.select2-container').first('ul');
			ul.sortable({
				placeholder	: 'ui-state-highlight',
				forcePlaceholderSize: true,
				items		: 'li:not(.select2-search-field)',
				tolerance	: 'pointer',
				stop: function() {
					$($(ul).find('.select2-search-choice').get().reverse()).each(function() {
						var id = $(this).data('select2Data').id;
						var option = select.find('option[value="'+id+'"]')[0];
						$(select).prepend(option);
					});
				}
			});
		}
	});
	
}(jQuery));


// set javascript time 12 hour
function formatDate(date) {
  var hours = date.getHours();
  var minutes = date.getMinutes();
  var ampm = hours >= 12 ? 'pm' : 'am';
  hours = hours % 12;
  hours = hours ? hours : 12; // the hour '0' should be '12'
  minutes = minutes < 10 ? '0'+minutes : minutes;
  var strTime = hours + ':' + minutes + ' ' + ampm;
  
  return strTime;
}



/*! vTicker 1.21 http://richhollis.github.com/vticker/ | 
http://richhollis.github.com/vticker/license/ | 
based on Jubgits vTicker http://www.jugbit.com/jquery-vticker-vertical-news-ticker/ 
*/
!function(a){var n={speed:700,pause:3e3,showItems:1,mousePause:!0,height:0,animate:!0,margin:0,padding:0,startPaused:!1,autoAppend:!0},r={moveUp:function(t,e){return r.showNextItem(t,e,"up")},moveDown:function(t,e){return r.showNextItem(t,e,"down")},nextItemState:function(t,e){var i=t.element.children("ul"),n=t.itemHeight;return 0<t.options.height&&(n=i.children("li:first").height()),{height:n+=t.options.margin+2*t.options.padding,options:t.options,el:t.element,obj:i,selector:"up"===e?"li:first":"li:last",dir:e}},showNextItem:function(t,e,i){var n=r.nextItemState(t,i);return n.el.trigger("vticker.beforeTick"),i=n.obj.children(n.selector).clone(!0),"down"===n.dir&&n.obj.css("top","-"+n.height+"px").prepend(i),e&&e.animate?t.animating||r.animateNextItem(n,t):r.nonAnimatedNextItem(n),"up"===n.dir&&t.options.autoAppend&&i.appendTo(n.obj),n.el.trigger("vticker.afterTick")},animateNextItem:function(t,e){return e.animating=!0,t.obj.animate("up"===t.dir?{top:"-="+t.height+"px"}:{top:0},e.options.speed,function(){return a(t.obj).children(t.selector).remove(),a(t.obj).css("top","0px"),e.animating=!1})},nonAnimatedNextItem:function(t){return t.obj.children(t.selector).remove(),t.obj.css("top","0px")},nextUsePause:function(){var t=a(this).data("state"),e=t.options;if(!t.isPaused&&!r.hasSingleItem(t))return s.next.call(this,{animate:e.animate})},startInterval:function(){var t,e=a(this).data("state"),i=e.options;return e.intervalId=setInterval((t=this,function(){return r.nextUsePause.call(t)}),i.pause)},stopInterval:function(){var t;if(t=a(this).data("state"))return t.intervalId&&clearInterval(t.intervalId),t.intervalId=void 0},restartInterval:function(){return r.stopInterval.call(this),r.startInterval.call(this)},getState:function(t,e){var i;if(!(i=a(e).data("state")))throw Error("vTicker: No state available from "+t);return i},isAnimatingOrSingleItem:function(t){return t.animating||this.hasSingleItem(t)},hasMultipleItems:function(t){return 1<t.itemCount},hasSingleItem:function(t){return!r.hasMultipleItems(t)},bindMousePausing:function(t,e){return t.bind("mouseenter",function(){if(!e.isPaused)return e.pausedByCode=!0,r.stopInterval.call(this),s.pause.call(this,!0)}).bind("mouseleave",function(){if(!e.isPaused||e.pausedByCode)return e.pausedByCode=!1,s.pause.call(this,!1),r.startInterval.call(this)})},setItemLayout:function(t,e,i){var n;return t.css({overflow:"hidden",position:"relative"}).children("ul").css({position:"absolute",margin:0,padding:0}).children("li").css({margin:i.margin,padding:i.padding}),isNaN(i.height)||0===i.height?(t.children("ul").children("li").each(function(){if(a(this).height()>e.itemHeight)return e.itemHeight=a(this).height()}),t.children("ul").children("li").each(function(){return a(this).height(e.itemHeight)}),n=i.margin+2*i.padding,t.height((e.itemHeight+n)*i.showItems+i.margin)):t.height(i.height)},defaultStateAttribs:function(t,e){return{itemCount:t.children("ul").children("li").length,itemHeight:0,itemMargin:0,element:t,animating:!1,options:e,isPaused:e.startPaused,pausedByCode:!1}}},s={init:function(t){var e,i;if(a(this).data("state")&&s.stop.call(this),e=jQuery.extend({},n),t=a.extend(e,t),e=a(this),i=r.defaultStateAttribs(e,t),a(this).data("state",i),r.setItemLayout(e,i,t),t.startPaused||r.startInterval.call(this),t.mousePause)return r.bindMousePausing(e,i)},pause:function(t){var e=r.getState("pause",this);return!!r.hasMultipleItems(e)&&(e.isPaused=t,e=e.element,t?(a(this).addClass("paused"),e.trigger("vticker.pause")):(a(this).removeClass("paused"),e.trigger("vticker.resume")))},next:function(t){var e=r.getState("next",this);return!r.isAnimatingOrSingleItem(e)&&(r.restartInterval.call(this),r.moveUp(e,t))},prev:function(t){var e=r.getState("prev",this);return!r.isAnimatingOrSingleItem(e)&&(r.restartInterval.call(this),r.moveDown(e,t))},stop:function(){return r.getState("stop",this),r.stopInterval.call(this)},remove:function(){var t=r.getState("remove",this);return r.stopInterval.call(this),(t=t.element).unbind(),t.remove()}};a.fn.vTicker=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?a.error("Method "+t+" does not exist on jQuery.vTicker"):s.init.apply(this,arguments)}}(jQuery);




/**
* Accordion Content script: By Dynamic Drive, at http://www.dynamicdrive.com
* Created: Jan 7th, 08'. Last updated: Feb 16th, 2012 to v2.0
*
* Modification added by CMSEnergizer.com 12.24.2018
* added closing semi-colon to end lines
* added typeof conditions to variables which thre undefined errors in some browsers
*/
var ddaccordion={headergroup:{},contentgroup:{},preloadimages:function(e){e.each(function(){(new Image).src=this.src})},expandone:function(e,t,n){this.toggleone(e,t,"expand",n)},collapseone:function(e,t){this.toggleone(e,t,"collapse")},expandall:function(e){var t=this.headergroup[e];this.contentgroup[e].filter(":hidden").each(function(){t.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},collapseall:function(e){var t=this.headergroup[e];this.contentgroup[e].filter(":visible").each(function(){t.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},toggleone:function(e,t,n,a){var o=this.headergroup[e].eq(t),i=this.contentgroup[e].eq(t);(void 0===n||"expand"==n&&i.is(":hidden")||"collapse"==n&&i.is(":visible"))&&o.trigger("evt_accordion",[!1,a])},ajaxloadcontent:function(e,t,n,a){var o=e.data("ajaxinfo");function i(e){e&&(o.cacheddata=e,o.status="cached",0==t.queue("fx").length&&(t.hide().html(e),o.status="complete",a())),"complete"!=o.status&&setTimeout(function(){i(o.cacheddata)},100)}"none"==o.status?(t.slideDown(n.animatespeed),o.status="loading",$.ajax({url:o.url,error:function(e){i("Error fetching content. Server Response: "+e.responseText)},success:function(e){i(e=""==e?" ":e)}})):"loading"==o.status&&i(o.cacheddata)},expandit:function(n,a,o,i,c,e,s){var t=n.data("ajaxinfo");t&&("none"==t.status||"loading"==t.status?this.ajaxloadcontent(n,a,o,function(){ddaccordion.expandit(n,a,o,i,c)}):"cached"==t.status&&(a.html(t.cacheddata),t.cacheddata=null,t.status="complete")),this.transformHeader(n,o,"expand"),a.slideDown(e?0:o.animatespeed,function(){var e,t;o.onopenclose(n.get(0),parseInt(n.attr("headerindex")),a.css("display"),i),s&&(e=o.collapseprev?20:0,clearTimeout(o.sthtimer),o.sthtimer=setTimeout(function(){ddaccordion.scrollToHeader(n)},e)),"gotourl"!=o.postreveal||!c||(t=n.is("a")?n.get(0):n.find("a:eq(0)").get(0))&&setTimeout(function(){location=t.href},200+(s?400+e:0))})},scrollToHeader:function(e){ddaccordion.$docbody.stop().animate({scrollTop:e.offset().top},400)},collapseit:function(e,t,n,a){this.transformHeader(e,n,"collapse"),t.slideUp(n.animatespeed,function(){n.onopenclose(e.get(0),parseInt(e.attr("headerindex")),t.css("display"),a)})},transformHeader:function(e,t,n){e.addClass("expand"==n?t.cssclass.expand:t.cssclass.collapse).removeClass("expand"==n?t.cssclass.collapse:t.cssclass.expand),"src"==t.htmlsetting.location?(e=e.is("img")?e:e.find("img").eq(0)).attr("src","expand"==n?t.htmlsetting.expand:t.htmlsetting.collapse):"prefix"==t.htmlsetting.location?e.find(".accordprefix").empty().append("expand"==n?t.htmlsetting.expand:t.htmlsetting.collapse):"suffix"==t.htmlsetting.location&&e.find(".accordsuffix").empty().append("expand"==n?t.htmlsetting.expand:t.htmlsetting.collapse)},urlparamselect:function(e){var t=window.location.search.match(new RegExp(e+"=((\\d+)(,(\\d+))*)","i"));return null!=t&&(t=RegExp.$1.split(",")),t},getCookie:function(e){var t=new RegExp(e+"=[^;]+","i");return document.cookie.match(t)?document.cookie.match(t)[0].split("=")[1]:null},setCookie:function(e,t){document.cookie=e+"="+t+"; path=/"},init:function(r){document.write('<style type="text/css">\n'),document.write("."+r.contentclass+"{display: inherit}\n"),document.write("a.hiddenajaxlink{display: none}\n"),document.write("</style>"),jQuery(function(i){ddaccordion.urlparamselect(r.headerclass);var e=ddaccordion.getCookie(r.headerclass);ddaccordion.headergroup[r.headerclass]=i("."+r.headerclass),ddaccordion.contentgroup[r.headerclass]=i("."+r.contentclass),ddaccordion.$docbody=window.opera?"CSS1Compat"==document.compatMode?jQuery("html"):jQuery("body"):jQuery("html,body");var n=ddaccordion.headergroup[r.headerclass],c=ddaccordion.contentgroup[r.headerclass];r.cssclass={collapse:r.toggleclass[0],expand:r.toggleclass[1]},r.revealtype=r.revealtype||"click",r.revealtype=r.revealtype.replace(/mouseover/i,"mouseenter"),"clickgo"==r.revealtype&&(r.postreveal="gotourl",r.revealtype="click"),void 0===r.togglehtml?r.htmlsetting={location:"none"}:r.htmlsetting={location:r.togglehtml[0],collapse:r.togglehtml[1],expand:r.togglehtml[2]},r.oninit=void 0===r.oninit?function(){}:r.oninit,r.onopenclose=void 0===r.onopenclose?function(){}:r.onopenclose;var s={},d=ddaccordion.urlparamselect(r.headerclass)||(r.persiststate&&null!=e?e:r.defaultexpanded);"string"==typeof d&&(d=d.replace(/c/gi,"").split(",")),void 0!==d&&1==d.length&&"-1"==d[0]&&(d=[]),void 0!==d&&r.collapseprev&&1<d.length&&(d=[d.pop()]),r.onemustopen&&0==d.length&&(d=[0]),n.each(function(e){var t=i(this);/(prefix)|(suffix)/i.test(r.htmlsetting.location)&&""!=t.html()&&(i('<span class="accordprefix"></span>').prependTo(this),i('<span class="accordsuffix"></span>').appendTo(this)),t.attr("headerindex",e+"h"),c.eq(e).attr("contentindex",e+"c");var n,a=c.eq(e),o=a.find("a.hiddenajaxlink:eq(0)");1==o.length&&t.data("ajaxinfo",{url:o.attr("href"),cacheddata:null,status:"none"}),void 0!==d&&(n="number"==typeof d[0]?e:e+""),-1!=jQuery.inArray(n,d)?(ddaccordion.expandit(t,a,r,!1,!1,!r.animatedefault),s={$header:t,$content:a}):(a.hide(),r.onopenclose(t.get(0),parseInt(t.attr("headerindex")),a.css("display"),!1),ddaccordion.transformHeader(t,r,"collapse"))}),n.bind("evt_accordion",function(e,t,n){var a=c.eq(parseInt(i(this).attr("headerindex")));"none"==a.css("display")?(ddaccordion.expandit(i(this),a,r,!0,t,!1,n),r.collapseprev&&s.$header&&i(this).get(0)!=s.$header.get(0)&&ddaccordion.collapseit(s.$header,s.$content,r,!0),s={$header:i(this),$content:a}):(!r.onemustopen||r.onemustopen&&s.$header&&i(this).get(0)!=s.$header.get(0))&&ddaccordion.collapseit(i(this),a,r,!0)}),n.bind(r.revealtype,function(){if("mouseenter"!=r.revealtype)return i(this).trigger("evt_accordion",[!0,r.scrolltoheader]),!1;clearTimeout(r.revealdelay);var e=parseInt(i(this).attr("headerindex"));r.revealdelay=setTimeout(function(){ddaccordion.expandone(r.headerclass,e,r.scrolltoheader)},r.mouseoverdelay||0)}),n.bind("mouseleave",function(){clearTimeout(r.revealdelay)}),r.oninit(n.get(),d),i(window).bind("unload",function(){n.unbind();var t=[];c.filter(":visible").each(function(e){t.push(i(this).attr("contentindex"))}),1==r.persiststate&&0<n.length&&(t=0==t.length?"-1c":t,ddaccordion.setCookie(r.headerclass,t))})})}};

// ddaccordion initializer
function cmseslides(slidetab,slidecontent,defopen=null,mustopen=false) {
	ddaccordion.init({
		headerclass: 	slidetab,
		contentclass: 	slidecontent,
		revealtype: 	"click",
		collapseprev: 	true,
		defaultexpanded:[defopen],
		scrolltoheader: false,
		onemustopen: 	mustopen,
		animatedefault: false,
		persiststate: 	false,
		toggleclass: 	["isup", "isdown"],
		togglehtml: 	["suffix", "", ""],
		animatespeed: 	"slow",
		oninit:			function(expandedindices){},
		onopenclose:	function(header, index, state, isuseractivated){}
	});
}

function clearIt(fid){
	document.getElementById(fid).value='';
}


// Sticky Plugin v1.0.4 for jQuery
// =============
// Author: Anthony Garand
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
// Improvements by Leonardo C. Daronco (daronco)
// Created: 02/14/2011
// Date: 07/20/2015
// Website: http://stickyjs.com/
// Description: Makes an element on the page stick on the screen as you scroll
//              It will only set the 'top' and 'position' of your element, you
//              might need to adjust the width in some cases.

!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){function t(){for(var t=h.scrollTop(),e=u.height(),i=e-m,n=i<t?i-t:0,r=0,s=g.length;r<s;r++){var o,c,p,a=g[r],d=a.stickyWrapper.offset().top-a.topSpacing-n;a.stickyWrapper.css("height",a.stickyElement.outerHeight()),t<=d?null!==a.currentTop&&(a.stickyElement.css({width:"",position:"",top:"","z-index":""}),a.stickyElement.parent().removeClass(a.className),a.stickyElement.trigger("sticky-end",[a]),a.currentTop=null):((o=e-a.stickyElement.outerHeight()-a.topSpacing-a.bottomSpacing-t-n)<0?o+=a.topSpacing:o=a.topSpacing,a.currentTop!==o&&(a.getWidthFrom?(padding=a.stickyElement.innerWidth()-a.stickyElement.width(),c=l(a.getWidthFrom).width()-padding||null):a.widthFromWrapper&&(c=a.stickyWrapper.width()),null==c&&(c=a.stickyElement.width()),a.stickyElement.css("width",c).css("position","fixed").css("top",o).css("z-index",a.zIndex),a.stickyElement.parent().addClass(a.className),null===a.currentTop?a.stickyElement.trigger("sticky-start",[a]):a.stickyElement.trigger("sticky-update",[a]),a.currentTop===a.topSpacing&&a.currentTop>o||null===a.currentTop&&o<a.topSpacing?a.stickyElement.trigger("sticky-bottom-reached",[a]):null!==a.currentTop&&o===a.topSpacing&&a.currentTop<o&&a.stickyElement.trigger("sticky-bottom-unreached",[a]),a.currentTop=o),p=a.stickyWrapper.parent(),a.stickyElement.offset().top+a.stickyElement.outerHeight()>=p.offset().top+p.outerHeight()&&a.stickyElement.offset().top<=a.topSpacing?a.stickyElement.css("position","absolute").css("top","").css("bottom",0).css("z-index",""):a.stickyElement.css("position","fixed").css("top",o).css("bottom","").css("z-index",a.zIndex))}}function e(){m=h.height();for(var t=0,e=g.length;t<e;t++){var i=g[t],n=null;i.getWidthFrom?i.responsiveWidth&&(n=l(i.getWidthFrom).width()):i.widthFromWrapper&&(n=i.stickyWrapper.width()),null!=n&&i.stickyElement.css("width",n)}}var i=Array.prototype.slice,n=Array.prototype.splice,c={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1,zIndex:"inherit"},h=l(window),u=l(document),g=[],m=h.height(),p={init:function(o){return this.each(function(){var t=l.extend({},c,o),e=l(this),i=e.attr("id"),n=i?i+"-"+c.wrapperClassName:c.wrapperClassName,r=l("<div></div>").attr("id",n).addClass(t.wrapperClassName);e.wrapAll(function(){if(0==l(this).parent("#"+n).length)return r});var s=e.parent();t.center&&s.css({width:e.outerWidth(),marginLeft:"auto",marginRight:"auto"}),"right"===e.css("float")&&e.css({float:"none"}).parent().css({float:"right"}),t.stickyElement=e,t.stickyWrapper=s,t.currentTop=null,g.push(t),p.setWrapperHeight(this),p.setupChangeListeners(this)})},setWrapperHeight:function(t){var e=l(t),i=e.parent();i&&i.css("height",e.outerHeight())},setupChangeListeners:function(e){window.MutationObserver?new window.MutationObserver(function(t){(t[0].addedNodes.length||t[0].removedNodes.length)&&p.setWrapperHeight(e)}).observe(e,{subtree:!0,childList:!0}):window.addEventListener?(e.addEventListener("DOMNodeInserted",function(){p.setWrapperHeight(e)},!1),e.addEventListener("DOMNodeRemoved",function(){p.setWrapperHeight(e)},!1)):window.attachEvent&&(e.attachEvent("onDOMNodeInserted",function(){p.setWrapperHeight(e)}),e.attachEvent("onDOMNodeRemoved",function(){p.setWrapperHeight(e)}))},update:t,unstick:function(t){return this.each(function(){for(var t=l(this),e=-1,i=g.length;0<i--;)g[i].stickyElement.get(0)===this&&(n.call(g,i,1),e=i);-1!==e&&(t.unwrap(),t.css({width:"",position:"",top:"",float:"","z-index":""}))})}};window.addEventListener?(window.addEventListener("scroll",t,!1),window.addEventListener("resize",e,!1)):window.attachEvent&&(window.attachEvent("onscroll",t),window.attachEvent("onresize",e)),l.fn.sticky=function(t){return p[t]?p[t].apply(this,i.call(arguments,1)):"object"!=typeof t&&t?void l.error("Method "+t+" does not exist on jQuery.sticky"):p.init.apply(this,arguments)},l.fn.unstick=function(t){return p[t]?p[t].apply(this,i.call(arguments,1)):"object"!=typeof t&&t?void l.error("Method "+t+" does not exist on jQuery.sticky"):p.unstick.apply(this,arguments)},l(function(){setTimeout(t,0)})});


  



  /** Repeatable Fields
  -----------------------------*/
  /*
 * jQuery Repeatable Fields v1.5.0
 * http://www.rhyzz.com/repeatable-fields.html
 *
 * Copyright (c) 2014-2018 Rhyzz
 * License MIT
*/
var repeatCount = {};

(function($) {
	"use strict";

	$.fn.repeatable_fields = function(custom_settings) {
		var self = this;

		self.after_add = function(container, new_row) {
			var row_count = $(container).attr('data-rf-row-count');
			repeatCount.val = row_count;
			
			row_count++;

			$('*', new_row).each(function() {
				$.each(this.attributes, function() {
					this.value = this.value.replace(self.settings.row_count_placeholder, row_count - 1);
				});
			});

			$(container).attr('data-rf-row-count', row_count);

		};

		self.default_settings = {
			wrapper: '.wrapper',
			container: '.container',
			row: '.row',
			add: '.add',
			remove: '.remove',
			move: '.move',
			move_up: '.move-up',
			move_down: '.move-down',
			move_steps: '.move-steps',
			template: '.template',
			is_sortable: true,
			before_add: null,
			after_add: self.after_add,
			before_remove: null,
			after_remove: null,
			sortable_options: null,
			row_count_placeholder: '{{row-count-placeholder}}',
		};

		self.settings = $.extend({}, self.default_settings, custom_settings);

		self.initialize = function(parent) {
			$(self.settings.wrapper, parent).each(function() {
				var wrapper = this;

				var container = $(wrapper).children(self.settings.container);

				// Disable all form elements inside the row template
				$(container).children(self.settings.template).hide().find(':input').each(function() {
					$(this).prop('disabled', true);
				});

				var row_count = $(container).children(self.settings.row).filter(function() {
					return !$(this).hasClass(self.settings.template.replace('.', ''));
				}).length;

				$(container).attr('data-rf-row-count', row_count);

				$(wrapper).on('click', self.settings.add, function(event) {
					event.stopImmediatePropagation();

					var row_template = $($(container).children(self.settings.template).clone().removeClass(self.settings.template.replace('.', ''))[0].outerHTML);

					// Enable all form elements inside the row template
					$(row_template).find(':input').each(function() {
						$(this).prop('disabled', false);
					});

					if(typeof self.settings.before_add === 'function') {
						self.settings.before_add(container);
					}

					var new_row = $(row_template).show().appendTo(container);

					if(typeof self.settings.after_add === 'function') {
						self.settings.after_add(container, new_row, self.settings.after_add);
					}

					// The new row might have it's own repeatable field wrappers so initialize them too
					self.initialize(new_row);
				});

				$(wrapper).on('click', self.settings.remove, function(event) {
					event.stopImmediatePropagation();

					var row = $(this).parents(self.settings.row).first();

					if(typeof self.settings.before_remove === 'function') {
						self.settings.before_remove(container, row);
					}

					row.remove();

					if(typeof self.settings.after_remove === 'function') {
						self.settings.after_remove(container);
					}
				});
			
				if(self.settings.is_sortable === true) {
					if(typeof $.ui !== 'undefined' && typeof $.ui.sortable !== 'undefined') {
						var sortable_options = self.settings.sortable_options !== null ? self.settings.sortable_options : {};

						sortable_options.handle = self.settings.move;

						$(wrapper).find(self.settings.container).sortable(sortable_options);
					}

					$(wrapper).find(self.settings.container).on('click', function(event) {
						if(!$(event.target).is(self.settings.move_up) && !$(event.target).is(self.settings.move_down)) {
							return;
						}

						var steps = 1;
						
						if($(event.target).siblings(self.settings.move_steps).length === 1) {
							var custom_steps = parseInt($(event.target).siblings(self.settings.move_steps).val(), 10);
							
							if(isNaN(custom_steps) === false && (custom_steps > 0 || custom_steps === -1)) {
								steps = custom_steps;
							}
						}

						var current_row = $(event.target).closest(self.settings.row);

						var i = 0;

						if($(event.target).is(self.settings.move_up) === true) {
							var previous_row;
							
							for(i = 0; steps === -1 ? true : i < steps; i++) {
								if(previous_row === undefined) {
									if(current_row.prev().not(self.settings.template).length === 1) {
										previous_row = current_row.prev();
									}
									else {
										break;
									}
								}
								else {
									if(previous_row.prev().not(self.settings.template).length === 1) {
										previous_row = previous_row.prev();
									}
									else {
										break;
									}
								}
							}
							
							if(previous_row !== undefined) {
								previous_row.before(current_row);
							}
						}
						else if($(event.target).is(self.settings.move_down) === true) {
							var next_row;

							for(i = 0; steps === -1 ? true : i < steps; i++) {
								if(next_row === undefined) {
									if(current_row.next().length === 1) {
										next_row = current_row.next();
									}
									else {
										break;
									}
								}
								else {
									if(next_row.next().length === 1) {
										next_row = next_row.next();
									}
									else {
										break;
									}
								}
							}

							if(next_row !== undefined) {
								next_row.after(current_row);
							}
						}

						event.stopImmediatePropagation();
					});
				}
			});
		};

		// Initialize all repeatable field wrappers
		self.initialize(self);
		
		return self;
	};
})(jQuery);


/*RRSSB social share buttons*/
+function(t,e,i){"use strict";var r={calc:!1};e.fn.rrssb=function(t){var r=e.extend({description:i,emailAddress:i,emailBody:i,emailSubject:i,image:i,title:i,url:i},t);r.emailSubject=r.emailSubject||r.title,r.emailBody=r.emailBody||(r.description?r.description:"")+(r.url?"\n\n"+r.url:"");for(var s in r)r.hasOwnProperty(s)&&r[s]!==i&&(r[s]=a(r[s]));r.url!==i&&(e(this).find(".rrssb-facebook a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+r.url),e(this).find(".rrssb-tumblr a").attr("href","http://tumblr.com/share/link?url="+r.url+(r.title!==i?"&name="+r.title:"")+(r.description!==i?"&description="+r.description:"")),e(this).find(".rrssb-linkedin a").attr("href","http://www.linkedin.com/shareArticle?mini=true&url="+r.url+(r.title!==i?"&title="+r.title:"")+(r.description!==i?"&summary="+r.description:"")),e(this).find(".rrssb-twitter a").attr("href","https://twitter.com/intent/tweet?text="+(r.description!==i?r.description:"")+"%20"+r.url),e(this).find(".rrssb-hackernews a").attr("href","https://news.ycombinator.com/submitlink?u="+r.url+(r.title!==i?"&text="+r.title:"")),e(this).find(".rrssb-reddit a").attr("href","http://www.reddit.com/submit?url="+r.url+(r.description!==i?"&text="+r.description:"")+(r.title!==i?"&title="+r.title:"")),e(this).find(".rrssb-googleplus a").attr("href","https://plus.google.com/share?url="+(r.description!==i?r.description:"")+"%20"+r.url),e(this).find(".rrssb-pinterest a").attr("href","http://pinterest.com/pin/create/button/?url="+r.url+(r.image!==i?"&amp;media="+r.image:"")+(r.description!==i?"&description="+r.description:"")),e(this).find(".rrssb-pocket a").attr("href","https://getpocket.com/save?url="+r.url),e(this).find(".rrssb-github a").attr("href",r.url),e(this).find(".rrssb-print a").attr("href","javascript:window.print()"),e(this).find(".rrssb-whatsapp a").attr("href","whatsapp://send?text="+(r.description!==i?r.description+"%20":r.title!==i?r.title+"%20":"")+r.url)),(r.emailAddress!==i||r.emailSubject)&&e(this).find(".rrssb-email a").attr("href","mailto:"+(r.emailAddress?r.emailAddress:"")+"?"+(r.emailSubject!==i?"subject="+r.emailSubject:"")+(r.emailBody!==i?"&body="+r.emailBody:""))};var s=function(){var t=e("<div>"),i=["calc","-webkit-calc","-moz-calc"];e("body").append(t);for(var s=0;s<i.length;s++)if(t.css("width",i[s]+"(1px)"),1===t.width()){r.calc=i[s];break}t.remove()},a=function(t){if(t!==i&&null!==t){if(null===t.match(/%[0-9a-f]{2}/i))return encodeURIComponent(t);t=decodeURIComponent(t),a(t)}},n=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li:visible",i),s=r.length,a=100/s;r.css("width",a+"%").attr("data-initwidth",a)})},l=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=i.width(),s=e("li",i).not(".small").eq(0).width(),a=e("li.small",i).length;if(s>170&&1>a){i.addClass("large-format");var n=s/12+"px";i.css("font-size",n)}else i.removeClass("large-format"),i.css("font-size","");25*a>r?i.removeClass("small-format").addClass("tiny-format"):i.removeClass("tiny-format")})},o=function(){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li",i),s=r.filter(".small"),a=0,n=0,l=s.eq(0),o=parseFloat(l.attr("data-size"))+55,c=s.length;if(c===r.length){var h=42*c,u=i.width();u>h+o&&(i.removeClass("small-format"),s.eq(0).removeClass("small"),d())}else{r.not(".small").each(function(t){var i=e(this),r=parseFloat(i.attr("data-size"))+55,s=parseFloat(i.width());a+=s,n+=r});var m=a-n;m>o&&(l.removeClass("small"),d())}})},c=function(t){e(".rrssb-buttons").each(function(t){var i=e(this),r=e("li",i);e(r.get().reverse()).each(function(t,i){var s=e(this);if(s.hasClass("small")===!1){var a=parseFloat(s.attr("data-size"))+55,n=parseFloat(s.width());if(a>n){var l=r.not(".small").last();e(l).addClass("small"),d()}}--i||o()})}),t===!0&&u(d)},d=function(){e(".rrssb-buttons").each(function(t){var i,s,a,l,o,c=e(this),d=e("li",c),h=d.filter(".small"),u=h.length;u>0&&u!==d.length?(c.removeClass("small-format"),h.css("width","42px"),a=42*u,i=d.not(".small").length,s=100/i,o=a/i,r.calc===!1?(l=(c.innerWidth()-1)/i-o,l=Math.floor(1e3*l)/1e3,l+="px"):l=r.calc+"("+s+"% - "+o+"px)",d.not(".small").css("width",l)):u===d.length?(c.addClass("small-format"),n()):(c.removeClass("small-format"),n())}),l()},h=function(){e(".rrssb-buttons").each(function(t){e(this).addClass("rrssb-"+(t+1))}),s(),n(),e(".rrssb-buttons li .rrssb-text").each(function(t){var i=e(this),r=i.width();i.closest("li").attr("data-size",r)}),c(!0)},u=function(t){e(".rrssb-buttons li.small").removeClass("small"),c(),t()},m=function(e,r,s,a){var n=t.screenLeft!==i?t.screenLeft:screen.left,l=t.screenTop!==i?t.screenTop:screen.top,o=t.innerWidth?t.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,c=t.innerHeight?t.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,d=o/2-s/2+n,h=c/3-a/3+l,u=t.open(e,r,"scrollbars=yes, width="+s+", height="+a+", top="+h+", left="+d);u&&u.focus&&u.focus()},f=function(){var t={};return function(e,i,r){r||(r="Don't call this twice without a uniqueId"),t[r]&&clearTimeout(t[r]),t[r]=setTimeout(e,i)}}();e(document).ready(function(){try{e(document).on("click",".rrssb-buttons a.popup",{},function(t){var i=e(this);m(i.attr("href"),i.find(".rrssb-text").html(),580,470),t.preventDefault()})}catch(i){}e(t).resize(function(){u(d),f(function(){u(d)},200,"finished resizing")}),h()}),t.rrssbInit=h}(window,jQuery);

/*PopUp*/
(function($){ 		  
	$.fn.popupWindow = function(instanceSettings){
		
		return this.each(function(){
		
		$(this).click(function(){
		
		$.fn.popupWindow.defaultSettings = {
			centerBrowser:0, // center window over browser window? {1 (YES) or 0 (NO)}. overrides top and left
			centerScreen:0, // center window over entire screen? {1 (YES) or 0 (NO)}. overrides top and left
			height:500, // sets the height in pixels of the window.
			left:0, // left position when the window appears.
			location:0, // determines whether the address bar is displayed {1 (YES) or 0 (NO)}.
			menubar:0, // determines whether the menu bar is displayed {1 (YES) or 0 (NO)}.
			resizable:0, // whether the window can be resized {1 (YES) or 0 (NO)}. Can also be overloaded using resizable.
			scrollbars:0, // determines whether scrollbars appear on the window {1 (YES) or 0 (NO)}.
			status:0, // whether a status line appears at the bottom of the window {1 (YES) or 0 (NO)}.
			width:500, // sets the width in pixels of the window.
			windowName:null, // name of window set from the name attribute of the element that invokes the click
			windowURL:null, // url used for the popup
			top:0, // top position when the window appears.
			toolbar:0 // determines whether a toolbar (includes the forward and back buttons) is displayed {1 (YES) or 0 (NO)}.
		};
		
		settings = $.extend({}, $.fn.popupWindow.defaultSettings, instanceSettings || {});
		
		var windowFeatures =    'height=' + settings.height +
								',width=' + settings.width +
								',toolbar=' + settings.toolbar +
								',scrollbars=' + settings.scrollbars +
								',status=' + settings.status + 
								',resizable=' + settings.resizable +
								',location=' + settings.location +
								',menuBar=' + settings.menubar;

				settings.windowName = this.name || settings.windowName;
				settings.windowURL = this.href || settings.windowURL;
				var centeredY,centeredX;
			
				if(settings.centerBrowser){
						
					if ($.browser.msie) {//hacked together for IE browsers
						centeredY = (window.screenTop - 120) + ((((document.documentElement.clientHeight + 120)/2) - (settings.height/2)));
						centeredX = window.screenLeft + ((((document.body.offsetWidth + 20)/2) - (settings.width/2)));
					}else{
						centeredY = window.screenY + (((window.outerHeight/2) - (settings.height/2)));
						centeredX = window.screenX + (((window.outerWidth/2) - (settings.width/2)));
					}
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
				}else if(settings.centerScreen){
					centeredY = (screen.height - settings.height)/2;
					centeredX = (screen.width - settings.width)/2;
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
				}else{
					window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + settings.left +',top=' + settings.top).focus();	
				}
				return false;
			});
			
		});	
	};
})(jQuery);





/*
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License MIT
*/
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,n=function(t){return parseFloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={
byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,
r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0",
"padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
}n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});






/** PayPal
----------------------------*/
<!--
  function Dollar (val) {														// force to valid dollar amount
  var str,pos,rnd=0;
    if (val < .995) rnd = 1;													// for old Netscape browsers
    str = escape (val*1.0 + 0.005001 + rnd);									// float, round, escape
    pos = str.indexOf (".");
    if (pos > 0) str = str.substring (rnd, pos + 3);
    return str;
  }

  var amt,des,obj,val,op1a,op1b,op2a,op2b,itmn;

  function ChkTok (obj1) {
  var j,tok,ary=new Array ();													// where we parse
    ary = val.split (" ");														// break apart
    for (j=0; j<ary.length; j++) {												// look at all items
  // first we do single character tokens...
      if (ary[j].length < 2) continue;
      tok = ary[j].substring (0,1);												// first character
      val = ary[j].substring (1);												// get data
      if (tok == "@") amt = val * 1.0;
      if (tok == "+") amt = amt + val*1.0;
      if (tok == "%") amt = amt + (amt * val/100.0);
      if (tok == "#") {															// record item number
        if (obj1.item_number) obj1.item_number.value = val;
        ary[j] = "";															// zap this array element
      }
  // Now we do 3-character tokens...
      if (ary[j].length < 4) continue;
      tok = ary[j].substring (0,3);												// first 3 chars
      val = ary[j].substring (3);												// get data
      if (tok == "s1=") {														// value for shipping
        if (obj1.shipping)  obj1.shipping.value  = val;
        ary[j] = "";															// clear it out
      }
      if (tok == "s2=") {														// value for shipping2
        if (obj1.shipping2) obj1.shipping2.value = val;
        ary[j] = "";															// clear it out
      }
    }
    val = ary.join (" ");														// rebuild val with what's left
  }

  function StorVal () {
  var tag;
    tag = obj.name.substring (obj.name.length-2);								// get flag
    if      (tag == "1a") op1a = op1a + " " + val;
    else if (tag == "1b") op1b = op1b + " " + val;
    else if (tag == "2a") op2a = op2a + " " + val;
    else if (tag == "2b") op2b = op2b + " " + val;
    else if (tag == "3i") itmn = itmn + " " + val;
    else if (des.length == 0) des = val;
    else des = des + ", " + val;
  }

  function ReadForm (obj1, tst) {												// Read the user form
  var i,j,pos;
    amt=0;des="";op1a="";op1b="";op2a="";op2b="";itmn="";
    if (obj1.baseamt) amt  = obj1.baseamt.value*1.0;							// base amount
    if (obj1.basedes) des  = obj1.basedes.value;								// base description
    if (obj1.baseon0) op1a = obj1.baseon0.value;								// base options
    if (obj1.baseos0) op1b = obj1.baseos0.value;
    if (obj1.baseon1) op2a = obj1.baseon1.value;
    if (obj1.baseos1) op2b = obj1.baseos1.value;
    if (obj1.baseitn) itmn = obj1.baseitn.value;
    for (i=0; i<obj1.length; i++) {												// run entire form
      obj = obj1.elements[i];													// a form element
      if (obj.type == "select-one") {											// just selects
        if (obj.name == "quantity" ||
            obj.name == "amount") continue;
        pos = obj.selectedIndex;												// which option selected
        val = obj.options[pos].value;											// selected value
        ChkTok (obj1);															// check for any specials

        if (obj.name == "on0" ||												// let this go where it wants
            obj.name == "os0" ||
            obj.name == "on1" ||
            obj.name == "os1") continue;

        StorVal ();

      } else
      if (obj.type == "checkbox" ||												// just get checkboxex
          obj.type == "radio") {												//  and radios
        if (obj.checked) {
          val = obj.value;														// the value of the selection
          ChkTok (obj1);
          StorVal ();
        }
      } else
      if (obj.type == "select-multiple") {										//one or more
        for (j=0; j<obj.options.length; j++) {									// run all options
          if (obj.options[j].selected) {
            val = obj.options[j].value;											// selected value (default)
            ChkTok (obj1);
            StorVal ();
          }
        }
      } else
      if ((obj.type == "text" ||												// just read text,
           obj.type == "textarea") &&
           obj.name != "tot" &&													//  but not from here
           obj.name != "quantity") {
        val = obj.value;														// get the data
        if (val == "" && tst) {													// force an entry
          alert ("Enter data for " + obj.name);
          return false;
        }
        StorVal ();
      }
    }
  // Now summarize stuff we just processed, above
    if (op1a.length > 0) obj1.on0.value = op1a;
    if (op1b.length > 0) obj1.os0.value = op1b;
    if (op2a.length > 0) obj1.on1.value = op2a;
    if (op2b.length > 0) obj1.os1.value = op2b;
    if (itmn.length > 0) obj1.item_number.value = itmn;
    obj1.item_name.value = des;
    obj1.amount.value = Dollar (amt);
    if (obj1.tot) obj1.tot.value = "$" + Dollar (amt);
  }
  //-->
  
  
/*jPlayer 2.9.2 for jQuery ~ (c) 2009-2014 Happyworm Ltd ~ MIT License */
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery?a.jQuery:a.Zepto)}(this,function(a,b){a.fn.jPlayer=function(c){var d="jPlayer",e="string"==typeof c,f=Array.prototype.slice.call(arguments,1),g=this;return c=!e&&f.length?a.extend.apply(null,[!0,c].concat(f)):c,e&&"_"===c.charAt(0)?g:(this.each(e?function(){var e=a(this).data(d),h=e&&a.isFunction(e[c])?e[c].apply(e,f):e;return h!==e&&h!==b?(g=h,!1):void 0}:function(){var b=a(this).data(d);b?b.option(c||{}):a(this).data(d,new a.jPlayer(c,this))}),g)},a.jPlayer=function(b,c){if(arguments.length){this.element=a(c),this.options=a.extend(!0,{},this.options,b);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()}),this._init()}},"function"!=typeof a.fn.stop&&(a.fn.stop=function(){}),a.jPlayer.emulateMethods="load play pause",a.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate",a.jPlayer.emulateOptions="muted volume",a.jPlayer.reservedEvent="ready flashreset resize repeat error warning",a.jPlayer.event={},a.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){a.jPlayer.event[this]="jPlayer_"+this}),a.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"],a.jPlayer.pause=function(){a.jPlayer.prototype.destroyRemoved(),a.each(a.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})},a.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var c=function(){this.init()};c.prototype={init:function(){this.options={timeFormat:a.jPlayer.timeFormat}},time:function(a){a=a&&"number"==typeof a?a:0;var b=new Date(1e3*a),c=b.getUTCHours(),d=this.options.timeFormat.showHour?b.getUTCMinutes():b.getUTCMinutes()+60*c,e=this.options.timeFormat.showMin?b.getUTCSeconds():b.getUTCSeconds()+60*d,f=this.options.timeFormat.padHour&&10>c?"0"+c:c,g=this.options.timeFormat.padMin&&10>d?"0"+d:d,h=this.options.timeFormat.padSec&&10>e?"0"+e:e,i="";return i+=this.options.timeFormat.showHour?f+this.options.timeFormat.sepHour:"",i+=this.options.timeFormat.showMin?g+this.options.timeFormat.sepMin:"",i+=this.options.timeFormat.showSec?h+this.options.timeFormat.sepSec:""}};var d=new c;a.jPlayer.convertTime=function(a){return d.time(a)},a.jPlayer.uaBrowser=function(a){var b=a.toLowerCase(),c=/(webkit)[ \/]([\w.]+)/,d=/(opera)(?:.*version)?[ \/]([\w.]+)/,e=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/,g=c.exec(b)||d.exec(b)||e.exec(b)||b.indexOf("compatible")<0&&f.exec(b)||[];return{browser:g[1]||"",version:g[2]||"0"}},a.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),c=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/,d=/(ipad|playbook)/,e=/(android)/,f=/(mobile)/,g=c.exec(b)||[],h=d.exec(b)||!f.exec(b)&&e.exec(b)||[];return g[1]&&(g[1]=g[1].replace(/\s/g,"_")),{platform:g[1]||"",tablet:h[1]||""}},a.jPlayer.browser={},a.jPlayer.platform={};var e=a.jPlayer.uaBrowser(navigator.userAgent);e.browser&&(a.jPlayer.browser[e.browser]=!0,a.jPlayer.browser.version=e.version);var f=a.jPlayer.uaPlatform(navigator.userAgent);f.platform&&(a.jPlayer.platform[f.platform]=!0,a.jPlayer.platform.mobile=!f.tablet,a.jPlayer.platform.tablet=!!f.tablet),a.jPlayer.getDocMode=function(){var b;return a.jPlayer.browser.msie&&(document.documentMode?b=document.documentMode:(b=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(b=7))),b},a.jPlayer.browser.documentMode=a.jPlayer.getDocMode(),a.jPlayer.nativeFeatures={init:function(){var a,b,c,d=document,e=d.createElement("video"),f={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},g=["w3c","moz","webkit","webkitVideo","ms"];for(this.fullscreen=a={support:{w3c:!!d[f.w3c[0]],moz:!!d[f.moz[0]],webkit:"function"==typeof d[f.webkit[3]],webkitVideo:"function"==typeof e[f.webkitVideo[2]],ms:"function"==typeof e[f.ms[2]]},used:{}},b=0,c=g.length;c>b;b++){var h=g[b];if(a.support[h]){a.spec=h,a.used[h]=!0;break}}if(a.spec){var i=f[a.spec];a.api={fullscreenEnabled:!0,fullscreenElement:function(a){return a=a?a:d,a[i[1]]},requestFullscreen:function(a){return a[i[2]]()},exitFullscreen:function(a){return a=a?a:d,a[i[3]]()}},a.event={fullscreenchange:i[4],fullscreenerror:i[5]}}else a.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},a.event={}}},a.jPlayer.nativeFeatures.init(),a.jPlayer.focus=null,a.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var g=function(b){var c,d=a.jPlayer.focus;d&&(a.each(a.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(a,d){return b.target.nodeName.toUpperCase()===d.toUpperCase()?(c=!0,!1):void 0}),c||a.each(d.options.keyBindings,function(c,e){return e&&a.isFunction(e.fn)&&("number"==typeof e.key&&b.which===e.key||"string"==typeof e.key&&b.key===e.key)?(b.preventDefault(),e.fn(d),!1):void 0}))};a.jPlayer.keys=function(b){var c="keydown.jPlayer";a(document.documentElement).unbind(c),b&&a(document.documentElement).bind(c,g)},a.jPlayer.keys(!0),a.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(b){b.jPlayer.options.loop?a(this).unbind(".jPlayerRepeat").bind(a.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){a(this).jPlayer("play")}):a(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(a){a.status.paused?a.play():a.pause()}},fullScreen:{key:70,fn:function(a){(a.status.video||a.options.audioFullScreen)&&a._setOption("fullScreen",!a.options.fullScreen)}},muted:{key:77,fn:function(a){a._muted(!a.options.muted)}},volumeUp:{key:190,fn:function(a){a.volume(a.options.volume+.1)}},volumeDown:{key:188,fn:function(a){a.volume(a.options.volume-.1)}},loop:{key:76,fn:function(a){a._loop(!a.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var c=this;if(this.element.empty(),this.status=a.extend({},this.status),this.internal=a.extend({},this.internal),this.options.timeFormat=a.extend({},a.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=a.jPlayer.platform.ipad||a.jPlayer.platform.iphone||a.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!a.jPlayer.focus&&(a.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:0/0},a.jPlayer.platform.android&&(this.options.preload="auto"!==this.options.preload?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),a.each(this.options.supplied.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.formats.push(e)}}),a.each(this.options.solution.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.solution[e]){var f=!1;a.each(c.solutions,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.solutions.push(e)}}),a.each(this.options.auroraFormats.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.aurora.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.aurora.formats.push(e)}}),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=a.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=a.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:b}),this.internal.video=a.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:b}),this.internal.flash=a.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:b,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=a.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:b}),a.each(a.jPlayer.event,function(a,d){c.options[a]!==b&&(c.element.bind(d+".jPlayer",c.options[a]),c.options[a]=b)}),this.require.audio=!1,this.require.video=!1,a.each(this.formats,function(a,b){c.require[c.format[b].media]=!0}),this.options=this.require.video?a.extend(!0,{},this.optionsVideo,this.options):a.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),a.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!c.status.video||c.status.waitForPlay)&&c.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=a("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",function(){c._trigger(a.jPlayer.event.click)}),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},a.each(this.formats,function(b,d){c.html.canPlay[d]=c.html[c.format[d].media].available&&""!==c.htmlElement[c.format[d].media].canPlayType(c.format[d].codec),c.aurora.canPlay[d]=a.inArray(d,c.aurora.formats)>-1,c.flash.canPlay[d]=c.format[d].flashCanPlay&&c.flash.available}),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,a.each(this.solutions,function(b,d){if(0===b)c[d].desired=!0;else{var e=!1,f=!1;a.each(c.formats,function(a,b){c[c.solutions[0]].canPlay[b]&&("video"===c.format[b].media?f=!0:e=!0)}),c[d].desired=c.require.audio&&!e||c.require.video&&!f}}),this.html.support={},this.aurora.support={},this.flash.support={},a.each(this.formats,function(a,b){c.html.support[b]=c.html.canPlay[b]&&c.html.desired,c.aurora.support[b]=c.aurora.canPlay[b]&&c.aurora.desired,c.flash.support[b]=c.flash.canPlay[b]&&c.flash.desired}),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,a.each(this.solutions,function(b,d){a.each(c.formats,function(a,b){return c[d].support[b]?(c[d].used=!0,!1):void 0})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:a.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SOLUTION,hint:a.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){var d,e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(a.jPlayer.browser.msie&&(Number(a.jPlayer.browser.version)<9||a.jPlayer.browser.documentMode<9)){var f='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>',g=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+e+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];d=document.createElement(f);for(var h=0;h<g.length;h++)d.appendChild(document.createElement(g[h]))}else{var i=function(a,b,c){var d=document.createElement("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)};d=document.createElement("object"),d.setAttribute("id",this.internal.flash.id),d.setAttribute("name",this.internal.flash.id),d.setAttribute("data",this.internal.flash.swf),d.setAttribute("type","application/x-shockwave-flash"),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("tabindex","-1"),i(d,"flashvars",e),i(d,"allowscriptaccess","always"),i(d,"bgcolor",this.options.backgroundColor),i(d,"wmode",this.options.wmode)}this.element.append(d),this.internal.flash.jq=a(d)}this.status.playbackRateEnabled=this.html.used&&!this.flash.used?this._testPlaybackRate("audio"):!1,this._updatePlaybackRate(),this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=a("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=a("#"+this.internal.video.id),this.internal.video.jq.css(this.status.nativeVideoControls?{width:this.status.width,height:this.status.height}:{width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){c._trigger(a.jPlayer.event.click)}))),this.aurora.used,this.options.emulateHtml&&this._emulateHtmlBridge(),!this.html.used&&!this.aurora.used||this.flash.used||setTimeout(function(){c.internal.ready=!0,c.version.flash="n/a",c._trigger(a.jPlayer.event.repeat),c._trigger(a.jPlayer.event.ready)},100),this._updateNativeVideoControls(),this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),a.jPlayer.prototype.count++},destroy:function(){this.clearMedia(),this._removeUiClass(),this.css.jq.currentTime.length&&this.css.jq.currentTime.text(""),this.css.jq.duration.length&&this.css.jq.duration.text(""),a.each(this.css.jq,function(a,b){b.length&&b.unbind(".jPlayer")}),this.internal.poster.jq.unbind(".jPlayer"),this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer"),this._fullscreenRemoveEventListeners(),this===a.jPlayer.focus&&(a.jPlayer.focus=null),this.options.emulateHtml&&this._destroyHtmlBridge(),this.element.removeData("jPlayer"),this.element.unbind(".jPlayer"),this.element.empty(),delete this.instances[this.internal.instance]},destroyRemoved:function(){var b=this;a.each(this.instances,function(a,c){b.element!==c&&(c.data("jPlayer")||(c.jPlayer("destroy"),delete b.instances[a]))})},enable:function(){},disable:function(){},_testCanPlayType:function(a){try{return a.canPlayType(this.format.mp3.codec),!0}catch(b){return!1}},_testPlaybackRate:function(a){var b,c=.5;a="string"==typeof a?a:"audio",b=document.createElement(a);try{return"playbackRate"in b?(b.playbackRate=c,b.playbackRate===c):!1}catch(d){return!1}},_uaBlocklist:function(b){var c=navigator.userAgent.toLowerCase(),d=!1;return a.each(b,function(a,b){return b&&b.test(c)?(d=!0,!1):void 0}),d},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(b,c){var d=this;b.preload=this.options.preload,b.muted=this.options.muted,b.volume=this.options.volume,this.status.playbackRateEnabled&&(b.defaultPlaybackRate=this.options.defaultPlaybackRate,b.playbackRate=this.options.playbackRate),b.addEventListener("progress",function(){c.gate&&(d.internal.cmdsIgnored&&this.readyState>0&&(d.internal.cmdsIgnored=!1),d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress))},!1),b.addEventListener("loadeddata",function(){c.gate&&(d.androidFix.setMedia=!1,d.androidFix.play&&(d.androidFix.play=!1,d.play(d.androidFix.time)),d.androidFix.pause&&(d.androidFix.pause=!1,d.pause(d.androidFix.time)),d._trigger(a.jPlayer.event.loadeddata))},!1),b.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.timeupdate))},!1),b.addEventListener("durationchange",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(a.jPlayer.event.play))},!1),b.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(a.jPlayer.event.playing))},!1),b.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(a.jPlayer.event.pause))},!1),b.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.waiting))},!1),b.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.seeking))},!1),b.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.seeked))},!1),b.addEventListener("volumechange",function(){c.gate&&(d.options.volume=b.volume,d.options.muted=b.muted,d._updateMute(),d._updateVolume(),d._trigger(a.jPlayer.event.volumechange))},!1),b.addEventListener("ratechange",function(){c.gate&&(d.options.defaultPlaybackRate=b.defaultPlaybackRate,d.options.playbackRate=b.playbackRate,d._updatePlaybackRate(),d._trigger(a.jPlayer.event.ratechange))},!1),b.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.suspend))},!1),b.addEventListener("ended",function(){c.gate&&(a.jPlayer.browser.webkit||(d.htmlElement.media.currentTime=0),d.htmlElement.media.pause(),d._updateButtons(!1),d._getHtmlStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.addEventListener("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1),a.each(a.jPlayer.htmlEvent,function(e,f){b.addEventListener(this,function(){c.gate&&d._trigger(a.jPlayer.event[f])},!1)})},_addAuroraEventListeners:function(b,c){var d=this;b.volume=100*this.options.volume,b.on("progress",function(){c.gate&&(d.internal.cmdsIgnored&&this.readyState>0&&(d.internal.cmdsIgnored=!1),d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress),b.duration>0&&d._trigger(a.jPlayer.event.timeupdate))},!1),b.on("ready",function(){c.gate&&d._trigger(a.jPlayer.event.loadeddata)},!1),b.on("duration",function(){c.gate&&(d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.on("end",function(){c.gate&&(d._updateButtons(!1),d._getAuroraStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.on("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1)},_getHtmlStatus:function(a,b){var c=0,d=0,e=0,f=0;isFinite(a.duration)&&(this.status.duration=a.duration),c=a.currentTime,d=this.status.duration>0?100*c/this.status.duration:0,"object"==typeof a.seekable&&a.seekable.length>0?(e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=this.status.duration>0?100*a.currentTime/a.seekable.end(a.seekable.length-1):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=a.readyState,this.status.networkState=a.networkState,this.status.playbackRate=a.playbackRate,this.status.ended=a.ended},_getAuroraStatus:function(a,b){var c=0,d=0,e=0,f=0;this.status.duration=a.duration/1e3,c=a.currentTime/1e3,d=this.status.duration>0?100*c/this.status.duration:0,a.buffered>0?(e=this.status.duration>0?a.buffered*this.status.duration/this.status.duration:100,f=this.status.duration>0?c/(a.buffered*this.status.duration):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_resetStatus:function(){this.status=a.extend({},this.status,a.jPlayer.prototype.status)},_trigger:function(b,c,d){var e=a.Event(b);e.jPlayer={},e.jPlayer.version=a.extend({},this.version),e.jPlayer.options=a.extend(!0,{},this.options),e.jPlayer.status=a.extend(!0,{},this.status),e.jPlayer.html=a.extend(!0,{},this.html),e.jPlayer.aurora=a.extend(!0,{},this.aurora),e.jPlayer.flash=a.extend(!0,{},this.flash),c&&(e.jPlayer.error=a.extend({},c)),d&&(e.jPlayer.warning=a.extend({},d)),this.element.trigger(e)},jPlayerFlashEvent:function(b,c){if(b===a.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media),this.volumeWorker(this.options.volume),d>0&&(e?this.pause(d):this.play(d))}this._trigger(a.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:a.jPlayer.error.VERSION,context:this.version.flash,message:a.jPlayer.errorMsg.VERSION+this.version.flash,hint:a.jPlayer.errorHint.VERSION}),this._trigger(a.jPlayer.event.repeat),this._trigger(b);if(this.flash.gate)switch(b){case a.jPlayer.event.progress:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.timeupdate:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.play:this._seeked(),this._updateButtons(!0),this._trigger(b);break;case a.jPlayer.event.pause:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.ended:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.click:this._trigger(b);break;case a.jPlayer.event.error:this.status.waitForLoad=!0,this.status.waitForPlay=!0,this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"}),this._validString(this.status.media.poster)&&this.internal.poster.jq.show(),this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show(),this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media),this._updateButtons(!1),this._error({type:a.jPlayer.error.URL,context:c.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL});break;case a.jPlayer.event.seeking:this._seeking(),this._trigger(b);break;case a.jPlayer.event.seeked:this._seeked(),this._trigger(b);break;case a.jPlayer.event.ready:break;default:this._trigger(b)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent,this.status.currentPercentRelative=a.currentPercentRelative,this.status.currentPercentAbsolute=a.currentPercentAbsolute,this.status.currentTime=a.currentTime,this.status.duration=a.duration,this.status.remaining=a.duration-a.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_updateButtons:function(a){a===b?a=!this.status.paused:this.status.paused=!a,a?this.addStateClass("playing"):this.removeStateClass("playing"),!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen"),this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped"),this.css.jq.play.length&&this.css.jq.pause.length&&(a?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide())),this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide())),this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%"),this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));var a="";this.css.jq.currentTime.length&&(a=this._convertTime(this.status.currentTime),a!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var b="",c=this.status.duration,d=this.status.remaining;this.css.jq.duration.length&&("string"==typeof this.status.media.duration?b=this.status.media.duration:("number"==typeof this.status.media.duration&&(c=this.status.media.duration,d=c-this.status.currentTime),b=this.options.remainingDuration?(d>0?"-":"")+this._convertTime(d):this._convertTime(c)),b!==this.css.jq.duration.text()&&this.css.jq.duration.text(b))},_convertTime:c.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg"),this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg"),this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1,this.html.video.gate=!1,this.aurora.gate=!1,this.flash.gate=!1},_resetActive:function(){this.html.active=!1,this.aurora.active=!1,this.flash.active=!1},_escapeHtml:function(a){return a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},_qualifyURL:function(a){var b=document.createElement("div");
return b.innerHTML='<a href="'+this._escapeHtml(a)+'">x</a>',b.firstChild.href},_absoluteMediaUrls:function(b){var c=this;return a.each(b,function(a,d){d&&c.format[a]&&"data:"!==d.substr(0,5)&&(b[a]=c._qualifyURL(d))}),b},addStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[a])},removeStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[a])},setMedia:function(b){var c=this,d=!1,e=this.status.media.poster!==b.poster;this._resetMedia(),this._resetGate(),this._resetActive(),this.androidFix.setMedia=!1,this.androidFix.play=!1,this.androidFix.pause=!1,b=this._absoluteMediaUrls(b),a.each(this.formats,function(e,f){var g="video"===c.format[f].media;return a.each(c.solutions,function(e,h){if(c[h].support[f]&&c._validString(b[f])){var i="html"===h,j="aurora"===h;return g?(i?(c.html.video.gate=!0,c._html_setVideo(b),c.html.active=!0):(c.flash.gate=!0,c._flash_setVideo(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.show(),c.status.video=!0):(i?(c.html.audio.gate=!0,c._html_setAudio(b),c.html.active=!0,a.jPlayer.platform.android&&(c.androidFix.setMedia=!0)):j?(c.aurora.gate=!0,c._aurora_setAudio(b),c.aurora.active=!0):(c.flash.gate=!0,c._flash_setAudio(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1),d=!0,!1}}),d?!1:void 0}),d?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(b.poster)&&(e?this.htmlElement.poster.src=b.poster:this.internal.poster.jq.show()),"string"==typeof b.title&&(this.css.jq.title.length&&this.css.jq.title.html(b.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",b.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",b.title)),this.status.srcSet=!0,this.status.media=a.extend({},b),this._updateButtons(!1),this._updateInterface(),this._trigger(a.jPlayer.event.setmedia)):this._error({type:a.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SUPPORT,hint:a.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus(),this._updateButtons(!1),this._updateInterface(),this._seeked(),this.internal.poster.jq.hide(),clearTimeout(this.internal.htmlDlyCmdId),this.html.active?this._html_resetMedia():this.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia(),this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia(),this._resetGate(),this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(a.jPlayer.focus=this)},play:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&!this.status.paused?this.pause(a):(a="number"==typeof a?a:0/0,this.status.srcSet?(this.focus(),this.html.active?this._html_play(a):this.aurora.active?this._aurora_play(a):this.flash.active&&this._flash_play(a)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(a){a="number"==typeof a?a:0/0,this.status.srcSet?this.html.active?this._html_pause(a):this.aurora.active?this._aurora_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},tellOthers:function(b,c){var d=this,e="function"==typeof c,f=Array.prototype.slice.call(arguments);"string"==typeof b&&(e&&f.splice(1,1),a.jPlayer.prototype.destroyRemoved(),a.each(this.instances,function(){d.element!==this&&(!e||c.call(this.data("jPlayer"),d))&&this.jPlayer.apply(this,f)}))},pauseOthers:function(a){this.tellOthers("pause",function(){return this.status.srcSet},a)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100),this.status.srcSet?this.html.active?this._html_playHead(a):this.aurora.active?this._aurora_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.mutedWorker(a),this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},a)},mutedWorker:function(b){this.options.muted=b,this.html.used&&this._html_setProperty("muted",b),this.aurora.used&&this._aurora_mute(b),this.flash.used&&this._flash_mute(b),this.html.video.gate||this.html.audio.gate||(this._updateMute(b),this._updateVolume(this.options.volume),this._trigger(a.jPlayer.event.volumechange))},mute:function(a){var c="object"==typeof a;c&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(a=a===b?!0:!!a,this._muted(a))},unmute:function(a){a=a===b?!0:!!a,this._muted(!a)},_updateMute:function(a){a===b&&(a=this.options.muted),a?this.addStateClass("muted"):this.removeStateClass("muted"),this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){this.volumeWorker(a),this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},a)},volumeWorker:function(b){b=this._limitValue(b,0,1),this.options.volume=b,this.html.used&&this._html_setProperty("volume",b),this.aurora.used&&this._aurora_volume(b),this.flash.used&&this._flash_volume(b),this.html.video.gate||this.html.audio.gate||(this._updateVolume(b),this._trigger(a.jPlayer.event.volumechange))},volumeBar:function(b){if(this.css.jq.volumeBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=c.height()-b.pageY+d.top,h=c.height();this.volume(this.options.verticalVolume?g/h:e/f)}this.options.muted&&this._muted(!1)},_updateVolume:function(a){a===b&&(a=this.options.volume),a=this.options.muted?0:a,this.status.noVolume?(this.addStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.removeStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*a+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1),this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(b){var c=this;this.options.cssSelectorAncestor=b,this._removeUiClass(),this.ancestorJq=b?a(b):[],b&&1!==this.ancestorJq.length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT}),this._addUiClass(),a.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)}),this._updateInterface(),this._updateButtons(),this._updateAutohide(),this._updateVolume(),this._updateMute()},_cssSelector:function(b,c){var d=this;if("string"==typeof c)if(a.jPlayer.prototype.options.cssSelector[b]){if(this.css.jq[b]&&this.css.jq[b].length&&this.css.jq[b].unbind(".jPlayer"),this.options.cssSelector[b]=c,this.css.cs[b]=this.options.cssSelectorAncestor+" "+c,this.css.jq[b]=c?a(this.css.cs[b]):[],this.css.jq[b].length&&this[b]){var e=function(c){c.preventDefault(),d[b](c),d.options.autoBlur?a(this).blur():a(this).focus()};this.css.jq[b].bind("click.jPlayer",e)}c&&1!==this.css.jq[b].length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[b],message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[b].length+" found for "+b+" method.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_METHOD,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:a.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:a.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:a.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(a){this.options.toggleDuration&&(this.options.captureDuration&&a.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(b){if(this.css.jq.seekBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=100*e/f;this.playHead(g)}},playbackRate:function(a){this._setOption("playbackRate",a)},playbackRateBar:function(b){if(this.css.jq.playbackRateBar.length){var c,d,e=a(b.currentTarget),f=e.offset(),g=b.pageX-f.left,h=e.width(),i=e.height()-b.pageY+f.top,j=e.height();c=this.options.verticalPlaybackRate?i/j:g/h,d=c*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate,this.playbackRate(d)}},_updatePlaybackRate:function(){var a=this.options.playbackRate,b=(a-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*b+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(a){var b="object"==typeof a;this._loop(b&&this.options.useStateClassSkin&&this.options.loop?!1:!0)},repeatOff:function(){this._loop(!1)},_loop:function(b){this.options.loop!==b&&(this.options.loop=b,this._updateButtons(),this._trigger(a.jPlayer.event.repeat))},option:function(c,d){var e=c;if(0===arguments.length)return a.extend(!0,{},this.options);if("string"==typeof c){var f=c.split(".");if(d===b){for(var g=a.extend(!0,{},this.options),h=0;h<f.length;h++){if(g[f[h]]===b)return this._warning({type:a.jPlayer.warning.OPTION_KEY,context:c,message:a.jPlayer.warningMsg.OPTION_KEY,hint:a.jPlayer.warningHint.OPTION_KEY}),b;g=g[f[h]]}return g}e={};for(var i=e,j=0;j<f.length;j++)j<f.length-1?(i[f[j]]={},i=i[f[j]]):i[f[j]]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(b,c){var d=this;switch(b){case"volume":this.volume(c);break;case"muted":this._muted(c);break;case"globalVolume":this.options[b]=c;break;case"cssSelectorAncestor":this._cssSelectorAncestor(c);break;case"cssSelector":a.each(c,function(a,b){d._cssSelector(a,b)});break;case"playbackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("playbackRate",c),this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("defaultPlaybackRate",c),this._updatePlaybackRate();break;case"minPlaybackRate":this.options[b]=c=this._limitValue(c,.1,this.options.maxPlaybackRate-.1),this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate+.1,16),this._updatePlaybackRate();break;case"fullScreen":if(this.options[b]!==c){var e=a.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;(!e||e&&!this.status.waitForPlay)&&(e||(this.options[b]=c),c?this._requestFullscreen():this._exitFullscreen(),e||this._setOption("fullWindow",c))}break;case"fullWindow":this.options[b]!==c&&(this._removeUiClass(),this.options[b]=c,this._refreshSize());break;case"size":this.options.fullWindow||this.options[b].cssClass===c.cssClass||this._removeUiClass(),this.options[b]=a.extend({},this.options[b],c),this._refreshSize();break;case"sizeFull":this.options.fullWindow&&this.options[b].cssClass!==c.cssClass&&this._removeUiClass(),this.options[b]=a.extend({},this.options[b],c),this._refreshSize();break;case"autohide":this.options[b]=a.extend({},this.options[b],c),this._updateAutohide();break;case"loop":this._loop(c);break;case"remainingDuration":this.options[b]=c,this._updateInterface();break;case"toggleDuration":this.options[b]=c;break;case"nativeVideoControls":this.options[b]=a.extend({},this.options[b],c),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this._restrictNativeVideoControls(),this._updateNativeVideoControls();break;case"noFullWindow":this.options[b]=a.extend({},this.options[b],c),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this._restrictNativeVideoControls(),this._updateButtons();break;case"noVolume":this.options[b]=a.extend({},this.options[b],c),this.status.noVolume=this._uaBlocklist(this.options.noVolume),this._updateVolume(),this._updateMute();break;case"emulateHtml":this.options[b]!==c&&(this.options[b]=c,c?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case"timeFormat":this.options[b]=a.extend({},this.options[b],c);break;case"keyEnabled":this.options[b]=c,c||this!==a.jPlayer.focus||(a.jPlayer.focus=null);break;case"keyBindings":this.options[b]=a.extend(!0,{},this.options[b],c);break;case"audioFullScreen":this.options[b]=c;break;case"autoBlur":this.options[b]=c}return this},_refreshSize:function(){this._setSize(),this._addUiClass(),this._updateSize(),this._updateButtons(),this._updateAutohide(),this._trigger(a.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass),this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var a=this,b="mousemove.jPlayer",c=".jPlayerAutohide",d=b+c,e=function(b){var c,d,e=!1;"undefined"!=typeof a.internal.mouse?(c=a.internal.mouse.x-b.pageX,d=a.internal.mouse.y-b.pageY,e=Math.floor(c)>0||Math.floor(d)>0):e=!0,a.internal.mouse={x:b.pageX,y:b.pageY},e&&a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId),a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(c),this.css.jq.gui.unbind(c),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(d,e),this.css.jq.gui.bind(d,e),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var b=this,c=a.jPlayer.nativeFeatures.fullscreen;c.api.fullscreenEnabled&&c.event.fullscreenchange&&("function"!=typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){b._fullscreenchange()}),document.addEventListener(c.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var b=a.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(b.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!a.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var b=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.requestFullscreen(b)},_exitFullscreen:function(){var b,c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.exitFullscreen(b)},_html_initMedia:function(b){var c=a(this.htmlElement.media).empty();a.each(b.track||[],function(a,b){var d=document.createElement("track");d.setAttribute("kind",b.kind?b.kind:""),d.setAttribute("src",b.src?b.src:""),d.setAttribute("srclang",b.srclang?b.srclang:""),d.setAttribute("label",b.label?b.label:""),b.def&&d.setAttribute("default",b.def),c.append(d)}),this.htmlElement.media.src=this.status.src,"none"!==this.options.preload&&this._html_load(),this._trigger(a.jPlayer.event.timeupdate)},_html_setFormat:function(b){var c=this;a.each(this.formats,function(a,d){return c.html.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0})},_html_setAudio:function(a){this._html_setFormat(a),this.htmlElement.media=this.htmlElement.audio,this._html_initMedia(a)},_html_setVideo:function(a){this._html_setFormat(a),this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(a.poster)?a.poster:""),this.htmlElement.media=this.htmlElement.video,this._html_initMedia(a)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load()),clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this,c=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=a;else if(isNaN(a))c.play();else{this.internal.cmdsIgnored&&c.play();try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a,c.play()}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},250))}}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this,c=this.htmlElement.media;if(this.androidFix.play=!1,a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),c.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=a;else if(!isNaN(a))try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},250))}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this,c=this.htmlElement.media;this._html_load();try{if("object"==typeof c.seekable&&c.seekable.length>0)c.currentTime=a*c.seekable.end(c.seekable.length-1)/100;else{if(!(c.duration>0)||isNaN(c.duration))throw"e";c.currentTime=a*c.duration/100}}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},250))}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(a,b){this.html.audio.available&&(this.htmlElement.audio[a]=b),this.html.video.available&&(this.htmlElement.video[a]=b)},_aurora_setAudio:function(b){var c=this;a.each(this.formats,function(a,d){return c.aurora.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0}),this.aurora.player=new AV.Player.fromURL(this.status.src),this._addAuroraEventListeners(this.aurora.player,this.aurora),"auto"===this.options.preload&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(b){this.status.waitForLoad||isNaN(b)||this.aurora.player.seek(b),this.aurora.player.playing||this.aurora.player.play(),this.status.waitForLoad=!1,this._aurora_checkWaitForPlay(),this._updateButtons(!0),this._trigger(a.jPlayer.event.play)},_aurora_pause:function(b){isNaN(b)||this.aurora.player.seek(1e3*b),this.aurora.player.pause(),b>0&&this._aurora_checkWaitForPlay(),this._updateButtons(!1),this._trigger(a.jPlayer.event.pause)},_aurora_playHead:function(a){this.aurora.player.duration>0&&this.aurora.player.seek(a*this.aurora.player.duration/100),this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(a){this.aurora.player.volume=100*a},_aurora_mute:function(a){a?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume,this.aurora.properties.muted=a},_flash_setAudio:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4a":case"fla":c._getMovie().fl_setAudio_m4a(b[d]);break;case"mp3":c._getMovie().fl_setAudio_mp3(b[d]);break;case"rtmpa":c._getMovie().fl_setAudio_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_setVideo:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4v":case"flv":c._getMovie().fl_setVideo_m4v(b[d]);break;case"rtmpv":c._getMovie().fl_setVideo_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"}),this._flash_pause(0/0)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=!1,this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}a>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var a,b=0;if(window.ActiveXObject)try{if(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var c=a.GetVariable("$version");c&&(c=c.split(" ")[1].split(","),b=parseInt(c[0],10)+"."+parseInt(c[1],10))}}catch(d){}else navigator.plugins&&navigator.mimeTypes.length>0&&(a=navigator.plugins["Shockwave Flash"],a&&(b=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return 1*b},_checkForFlash:function(a){var b=!1;return this._getFlashPluginVersion()>=a&&(b=!0),b},_validString:function(a){return a&&"string"==typeof a},_limitValue:function(a,b,c){return b>a?b:a>c?c:a},_urlNotSetError:function(b){this._error({type:a.jPlayer.error.URL_NOT_SET,context:b,message:a.jPlayer.errorMsg.URL_NOT_SET,hint:a.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(b){var c;c=this.internal.ready?"FLASH_DISABLED":"FLASH",this._error({type:a.jPlayer.error[c],context:this.internal.flash.swf,message:a.jPlayer.errorMsg[c]+b.message,hint:a.jPlayer.errorHint[c]}),this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(b){this._trigger(a.jPlayer.event.error,b),this.options.errorAlerts&&this._alert("Error!"+(b.message?"\n"+b.message:"")+(b.hint?"\n"+b.hint:"")+"\nContext: "+b.context)},_warning:function(c){this._trigger(a.jPlayer.event.warning,b,c),this.options.warningAlerts&&this._alert("Warning!"+(c.message?"\n"+c.message:"")+(c.hint?"\n"+c.hint:"")+"\nContext: "+c.context)},_alert:function(a){var b="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(b):alert(b)},_emulateHtmlBridge:function(){var b=this;a.each(a.jPlayer.emulateMethods.split(/\s+/g),function(a,c){b.internal.domNode[c]=function(a){b[c](a)}}),a.each(a.jPlayer.event,function(c,d){var e=!0;a.each(a.jPlayer.reservedEvent.split(/\s+/g),function(a,b){return b===c?(e=!1,!1):void 0}),e&&b.element.bind(d+".jPlayer.jPlayerHtml",function(){b._emulateHtmlUpdate();var a=document.createEvent("Event");a.initEvent(c,!1,!0),b.internal.domNode.dispatchEvent(a)})})},_emulateHtmlUpdate:function(){var b=this;a.each(a.jPlayer.emulateStatus.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.status[c]}),a.each(a.jPlayer.emulateOptions.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.options[c]})},_destroyHtmlBridge:function(){var b=this;this.element.unbind(".jPlayerHtml");var c=a.jPlayer.emulateMethods+" "+a.jPlayer.emulateStatus+" "+a.jPlayer.emulateOptions;a.each(c.split(/\s+/g),function(a,c){delete b.internal.domNode[c]})}},a.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"},a.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+a.jPlayer.prototype.version.script+" needs Jplayer.swf version "+a.jPlayer.prototype.version.needFlash+" but found "},a.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."},a.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"},a.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."},a.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
/*
 * Playlist Object for the jPlayer Plugin
 * http://www.jplayer.org
 *
 * Copyright (c) 2009 - 2014 Happyworm Ltd
 * Licensed under the MIT license.
 * http://www.opensource.org/licenses/MIT
 *
 * Author: Mark J Panaghiston
 * Version: 2.4.1
 * Date: 19th November 2014
 *
 * Requires:
 *  - jQuery 1.7.0+
 *  - jPlayer 2.8.2+
 */

/*global jPlayerPlaylist:true */
! function(s, t) {
	jPlayerPlaylist = function(t, e, i) {
		var l = this;
		this.current = 0, this.loop = !1, this.shuffled = !1, this.removing = !1, this.cssSelector = s.extend({}, this._cssSelector, t), this.options = s.extend(!0, {
			keyBindings: {
				next: {
					key: 221,
					fn: function() {
						l.next()
					}
				},
				previous: {
					key: 219,
					fn: function() {
						l.previous()
					}
				},
				shuffle: {
					key: 83,
					fn: function() {
						l.shuffle()
					}
				}
			},
			stateClass: {
				shuffled: "jp-state-shuffled"
			}
		}, this._options, i), this.playlist = [], this.original = [], this._initPlaylist(e), this.cssSelector.details = this.cssSelector.cssSelectorAncestor + " .jp-details", this.cssSelector.playlist = this.cssSelector.cssSelectorAncestor + " .jp-playlist", this.cssSelector.next = this.cssSelector.cssSelectorAncestor + " .jp-next", this.cssSelector.previous = this.cssSelector.cssSelectorAncestor + " .jp-previous", this.cssSelector.shuffle = this.cssSelector.cssSelectorAncestor + " .jp-shuffle", this.cssSelector.shuffleOff = this.cssSelector.cssSelectorAncestor + " .jp-shuffle-off", this.options.cssSelectorAncestor = this.cssSelector.cssSelectorAncestor, this.options.repeat = function(s) {
			l.loop = s.jPlayer.options.loop
		}, s(this.cssSelector.jPlayer).bind(s.jPlayer.event.ready, function() {
			l._init()
		}), s(this.cssSelector.jPlayer).bind(s.jPlayer.event.ended, function() {
			l.next()
		}), s(this.cssSelector.jPlayer).bind(s.jPlayer.event.play, function() {
			s(this).jPlayer("pauseOthers")
		}), s(this.cssSelector.jPlayer).bind(s.jPlayer.event.resize, function(t) {
			t.jPlayer.options.fullScreen ? s(l.cssSelector.details).show() : s(l.cssSelector.details).hide()
		}), s(this.cssSelector.previous).click(function(s) {
			s.preventDefault(), l.previous(), l.blur(this)
		}), s(this.cssSelector.next).click(function(s) {
			s.preventDefault(), l.next(), l.blur(this)
		}), s(this.cssSelector.shuffle).click(function(t) {
			t.preventDefault(), l.shuffled && s(l.cssSelector.jPlayer).jPlayer("option", "useStateClassSkin") ? l.shuffle(!1) : l.shuffle(!0), l.blur(this)
		}), s(this.cssSelector.shuffleOff).click(function(s) {
			s.preventDefault(), l.shuffle(!1), l.blur(this)
		}).hide(), this.options.fullScreen || s(this.cssSelector.details).hide(), s(this.cssSelector.playlist + " ul").empty(), this._createItemHandlers(), s(this.cssSelector.jPlayer).jPlayer(this.options)
	}, jPlayerPlaylist.prototype = {
		_cssSelector: {
			jPlayer: "#jquery_jplayer_1",
			cssSelectorAncestor: "#jp_container_1"
		},
		_options: {
			playlistOptions: {
				autoPlay: !1,
				loopOnPrevious: !1,
				shuffleOnLoop: !0,
				enableRemoveControls: !1,
				displayTime: "slow",
				addTime: "fast",
				removeTime: "fast",
				shuffleTime: "slow",
				itemClass: "jp-playlist-item",
				freeGroupClass: "jp-free-media",
				freeItemClass: "jp-playlist-item-free",
				removeItemClass: "jp-playlist-item-remove"
			}
		},
		option: function(s, e) {
			if(e === t) return this.options.playlistOptions[s];
			switch(this.options.playlistOptions[s] = e, s) {
				case "enableRemoveControls":
					this._updateControls();
					break;
				case "itemClass":
				case "freeGroupClass":
				case "freeItemClass":
				case "removeItemClass":
					this._refresh(!0), this._createItemHandlers()
			}
			return this
		},
		_init: function() {
			var s = this;
			this._refresh(function() {
				s.options.playlistOptions.autoPlay ? s.play(s.current) : s.select(s.current)
			})
		},
		_initPlaylist: function(t) {
			this.current = 0, this.shuffled = !1, this.removing = !1, this.original = s.extend(!0, [], t), this._originalPlaylist()
		},
		_originalPlaylist: function() {
			var t = this;
			this.playlist = [], s.each(this.original, function(s) {
				t.playlist[s] = t.original[s]
			})
		},
		_refresh: function(t) {
			var e = this;
			if(t && !s.isFunction(t)) s(this.cssSelector.playlist + " ul").empty(), s.each(this.playlist, function(t) {
				s(e.cssSelector.playlist + " ul").append(e._createListItem(e.playlist[t]))
			}), this._updateControls();
			else {
				var i = s(this.cssSelector.playlist + " ul").children().length ? this.options.playlistOptions.displayTime : 0;
				s(this.cssSelector.playlist + " ul").slideUp(i, function() {
					var i = s(this);
					s(this).empty(), s.each(e.playlist, function(s) {
						i.append(e._createListItem(e.playlist[s]))
					}), e._updateControls(), s.isFunction(t) && t(), e.playlist.length ? s(this).slideDown(e.options.playlistOptions.displayTime) : s(this).show()
				})
			}
		},
		_createListItem: function(s) {
			var t = "";
			t += "<li>",
			t += "<div class='pl-inner'>",
			t += "<div class='item-detail " + this.options.playlistOptions.itemClass + "' tabindex='0'>"+s.item+"</div>", 
			t += s.itemlink, 
			t += "</div>",
			t += "</li>"
			
			return t
		},
		_createItemHandlers: function() {
			var t = this;
			s(this.cssSelector.playlist).off("click", "div." + this.options.playlistOptions.itemClass).on("click", "div." + this.options.playlistOptions.itemClass, function(e) {
				e.preventDefault();
				var i = s(this).parent().parent().index();
				t.current !== i ? t.play(i) : s(t.cssSelector.jPlayer).jPlayer("play"), t.blur(this)
			}), s(this.cssSelector.playlist).off("click", "div." + this.options.playlistOptions.freeItemClass).on("click", "div." + this.options.playlistOptions.freeItemClass, function(e) {
				e.preventDefault(), s(this).parent().parent().find("." + t.options.playlistOptions.itemClass).click(), t.blur(this)
			}), s(this.cssSelector.playlist).off("click", "div." + this.options.playlistOptions.removeItemClass).on("click", "div." + this.options.playlistOptions.removeItemClass, function(e) {
				e.preventDefault();
				var i = s(this).parent().parent().index();
				t.remove(i), t.blur(this)
			})
		},
		_updateControls: function() {
			this.options.playlistOptions.enableRemoveControls ? s(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).show() : s(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).hide(), this.shuffled ? s(this.cssSelector.jPlayer).jPlayer("addStateClass", "shuffled") : s(this.cssSelector.jPlayer).jPlayer("removeStateClass", "shuffled"), s(this.cssSelector.shuffle).length && s(this.cssSelector.shuffleOff).length && (this.shuffled ? (s(this.cssSelector.shuffleOff).show(), s(this.cssSelector.shuffle).hide()) : (s(this.cssSelector.shuffleOff).hide(), s(this.cssSelector.shuffle).show()))
		},
		_highlight: function(e) {
			this.playlist.length && e !== t && (s(this.cssSelector.playlist + " .jp-playlist-current").removeClass("jp-playlist-current"), s(this.cssSelector.playlist + " li:nth-child(" + (e + 1) + ")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current"))
		},
		setPlaylist: function(s) {
			this._initPlaylist(s), this._init()
		},
		add: function(t, e) {
			s(this.cssSelector.playlist + " ul").append(this._createListItem(t)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime), this._updateControls(), this.original.push(t), this.playlist.push(t), e ? this.play(this.playlist.length - 1) : 1 === this.original.length && this.select(0)
		},
		remove: function(e) {
			var i = this;
			return e === t ? (this._initPlaylist([]), this._refresh(function() {
				s(i.cssSelector.jPlayer).jPlayer("clearMedia")
			}), !0) : this.removing ? !1 : (e = 0 > e ? i.original.length + e : e, e >= 0 && e < this.playlist.length && (this.removing = !0, s(this.cssSelector.playlist + " li:nth-child(" + (e + 1) + ")").slideUp(this.options.playlistOptions.removeTime, function() {
				if(s(this).remove(), i.shuffled) {
					var t = i.playlist[e];
					s.each(i.original, function(s) {
						return i.original[s] === t ? (i.original.splice(s, 1), !1) : void 0
					}), i.playlist.splice(e, 1)
				} else i.original.splice(e, 1), i.playlist.splice(e, 1);
				i.original.length ? e === i.current ? (i.current = e < i.original.length ? i.current : i.original.length - 1, i.select(i.current)) : e < i.current && i.current-- : (s(i.cssSelector.jPlayer).jPlayer("clearMedia"), i.current = 0, i.shuffled = !1, i._updateControls()), i.removing = !1
			})), !0)
		},
		select: function(t) {
			t = 0 > t ? this.original.length + t : t, t >= 0 && t < this.playlist.length ? (this.current = t, this._highlight(t), s(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current])) : this.current = 0
		},
		play: function(e) {
			e = 0 > e ? this.original.length + e : e, e >= 0 && e < this.playlist.length ? this.playlist.length && (this.select(e), s(this.cssSelector.jPlayer).jPlayer("play")) : e === t && s(this.cssSelector.jPlayer).jPlayer("play")
		},
		pause: function() {
			s(this.cssSelector.jPlayer).jPlayer("pause")
		},
		next: function() {
			var s = this.current + 1 < this.playlist.length ? this.current + 1 : 0;
			this.loop ? 0 === s && this.shuffled && this.options.playlistOptions.shuffleOnLoop && this.playlist.length > 1 ? this.shuffle(!0, !0) : this.play(s) : s > 0 && this.play(s)
		},
		previous: function() {
			var s = this.current - 1 >= 0 ? this.current - 1 : this.playlist.length - 1;
			(this.loop && this.options.playlistOptions.loopOnPrevious || s < this.playlist.length - 1) && this.play(s)
		},
		shuffle: function(e, i) {
			var l = this;
			e === t && (e = !this.shuffled), (e || e !== this.shuffled) && s(this.cssSelector.playlist + " ul").slideUp(this.options.playlistOptions.shuffleTime, function() {
				l.shuffled = e, e ? l.playlist.sort(function() {
					return .5 - Math.random()
				}) : l._originalPlaylist(), l._refresh(!0), i || !s(l.cssSelector.jPlayer).data("jPlayer").status.paused ? l.play(0) : l.select(0), s(this).slideDown(l.options.playlistOptions.shuffleTime)
			})
		},
		blur: function(t) {
			s(this.cssSelector.jPlayer).jPlayer("option", "autoBlur") && s(t).blur()
		}
	}
}(jQuery);

/* CountDown
Author:		Robert Hashemian (http://www.hashemian.com/)
Modified by:	Munsifali Rashid (http://www.munit.co.uk/)
*/
function countdown(t){this.obj=t,this.Div="counter",this.BackColor="white",this.ForeColor="black",this.TargetDate="12/31/2020 5:00 AM",this.DisplayFormat="%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.",this.FinishMessage="werdup",this.CountActive=!0,this.DisplayStr,this.Calcage=cd_Calcage,this.CountBack=cd_CountBack,this.Setup=cd_Setup}function cd_Calcage(t,i,e){return s=(Math.floor(t/i)%e).toString(),s.length<2&&(s="0"+s),s}function cd_CountBack(t){t<0?document.getElementById(this.Div).innerHTML=this.FinishMessage:(this.DisplayStr=this.DisplayFormat.replace(/%%D%%/g,this.Calcage(t,86400,1e5)),this.DisplayStr=this.DisplayStr.replace(/%%H%%/g,this.Calcage(t,3600,24)),this.DisplayStr=this.DisplayStr.replace(/%%M%%/g,this.Calcage(t,60,60)),this.DisplayStr=this.DisplayStr.replace(/%%S%%/g,this.Calcage(t,1,60)),document.getElementById(this.Div).innerHTML=this.DisplayStr,this.CountActive&&setTimeout(this.obj+".CountBack("+(t-1)+")",990))}function cd_Setup(){var t=new Date(this.TargetDate),i=new Date;ddiff=new Date(t-i),gsecs=Math.floor(ddiff.valueOf()/1e3),this.CountBack(gsecs)}


/* Bottom slide panel
https://www.jqueryscript.net/layout/Creating-A-Toggable-Bottom-Content-Panel-Using-jQuery-CSS.html
*/
(function($) {
	
	$.fn.bottomSlidePanel = function(options) 
	{
		var wrap = this;

		return this.each(function() 
		{
			var setting = $.extend ({
				tab: ".tab-controller",
				contentarea: ".panel-content",
				defaultState: "close",
				animSpeed: 250,
				cookiename: ""
			}, options);
			
			if( setting.cookiename !== "" ) {
				if( !Cookies.get(setting.cookiename) )
					Cookies.set(setting.cookiename, setting.defaultState);
			}
			
			
			let sPanel = 
			{
				isVisible : true,
				showMessage : null,
				hideMessage : null,
				animationDuration : setting.animSpeed,
				animationEasing : "linear",
				init : function() {},

				hidePanel : function() {
					$(wrap).animate({
						bottom : -(sPanel.getAnimationOffset())
					}, sPanel.animationDuration, sPanel.animationEasing, function() {
						sPanel.isVisible = false;
						sPanel.updateTabMessage();
					});
				},

				showPanel : function() {
					$(wrap).animate({
						bottom : 0
					}, sPanel.animationDuration, sPanel.animationEasing, function() {
						sPanel.isVisible = true;
						sPanel.updateTabMessage();
					});
				},

				togglePanel : function() {
					((this.isVisible) ? this.hidePanel : this.showPanel)();
				},

				updateTabMessage : function() {
					if (this.isVisible) {
						$(setting.tab+' .tabclose').show();
						$(setting.tab+' .tabshow').hide();
					} else {
						$(setting.tab+' .tabclose').hide();
						$(setting.tab+' .tabshow').show();
					}
				},

				getAnimationOffset : function() {
					return $(setting.contentarea).height();
				}
			};
			
			$(function() 
			{
				if( 
				(setting.cookiename === "" && setting.defaultState === "close") || 
				(setting.cookiename !== "" && setting.defaultState === "close" && Cookies.get(setting.cookiename) === "close") 
				) 
				{
					sPanel.init(sPanel.hidePanel(sPanel.animationDuration = 0));
					
					setTimeout(function() {
						sPanel.hidePanel(sPanel.animationDuration = setting.animSpeed); 
					}, 0);
				}
				else{
					// default to open state
					sPanel.init();
				}
				
				$(setting.tab).on("click", function() 
				{
					if( setting.cookiename !== "" ) {
						if( Cookies.get(setting.cookiename) === "close" ) {
							Cookies.set(setting.cookiename,"open");
						}else{
							Cookies.set(setting.cookiename,"close");
						}
					}
					
					sPanel.togglePanel();
				});
			});
		});
	}

})(jQuery);


/*! js-cookie v3.0.0-rc.1 | MIT 
https://github.com/js-cookie/js-cookie
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,r=e.Cookies=t();r.noConflict=function(){return e.Cookies=n,r}}())}(this,function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var t={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};return function n(r,o){function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=r.write(n,t);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+c}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=t.read(c[0]);if(o[f]=r.read(u,f),e===f)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(t){return n(this.converter,e({},this.attributes,t))},withConverter:function(t){return n(e({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}(t,{path:"/"})});

  
/* Get Background Image Height 
https://stackoverflow.com/questions/3098404/get-the-size-of-a-css-background-image-using-javascript
*/
(function ($) 
{
	var pxRegex = /px/, percentRegex = /%/, urlRegex = /url\(['"]*(.*?)['"]*\)/g;
	$.fn.getbgImgSize = function(callback) 
	{
		var img = new Image(), width, height, backgroundSize = this.css('background-size').split(' ');

		if( pxRegex.test(backgroundSize[0]) )
			width = parseInt(backgroundSize[0]);
		if( percentRegex.test(backgroundSize[0]) ) 
			width = this.parent().width() * (parseInt(backgroundSize[0]) / 100);
		if( pxRegex.test(backgroundSize[1]) ) 
			height = parseInt(backgroundSize[1]);
		if( percentRegex.test(backgroundSize[1]) ) 
			height = this.parent().height() * (parseInt(backgroundSize[0]) / 100);

		if( (typeof width != 'undefined') && (typeof height != 'undefined') ) {
			callback({ width: width, height: height });
			return this;
		}
		
		img.onload = function() {
			if( typeof width == 'undefined' ) 
				width = this.width;
			if( typeof height == 'undefined' ) 
				height = this.height;
			
			callback({ width: width, height: height });
		}
		
		img.src = this.css('background-image').replace(urlRegex, '$1');
		
		return this;
	}
})(jQuery);


/* Page reload by given time
timeReload({
		hr: 00, 
		min: 10, 
		endhr: 00, 
		endmin: 58,
		newtext: "freshed",
		elid: "div.schedule-block",
		day: 3
});
*/
function timeReload(data) 
{
	const day = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
	const now = new Date();
	const then = new Date();
	
	let dow = now.getDay();
	let tod = now.getHours()+""+now.getMinutes()+""+now.getSeconds();
	let hour = data.hr;
	let min = data.min;
	let sec = 0;
	let start = data.hr+""+data.min;
	let end = data.endhr+""+data.endmin;

	let elid = data.elid;

	if( now.getHours() > hour ||
	(now.getHours() == hour && now.getMinutes() > min) ||
	now.getHours() == hour && now.getMinutes() == min && now.getSeconds() >= sec) {
	then.setDate(now.getDate() + 1);
	}
	then.setHours(hour);
	then.setMinutes(min);
	then.setSeconds(sec);

	var timeout = (then.getTime() - now.getTime());
	
	if( dow == data.day ) {
		setTimeout(function() {
			//jQuery(elid).load(location.href+" "+elid+">*","");
			//jQuery(elid).html(data.newtext);
			window.location.reload(true); 
		}, timeout);
		//clearTimeout(timerun);
	}
}



/*!
 * jQuery Templates Plugin 1.0.0pre
 * http://github.com/jquery/jquery-tmpl
 * Requires jQuery 1.4.2
 *
 * Copyright 2011, Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 */
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(e,n,l,a){var r={data:a||0===a||a===!1?a:n?n.data:{},_wrap:n?n._wrap:null,tmpl:null,parent:n||null,nodes:[],calls:u,nest:c,wrap:f,html:m,update:s};return e&&t.extend(r,e,{nodes:[],parent:n}),l&&(r.tmpl=l,r._ctnt=r._ctnt||r.tmpl(t,r),r.key=++w,(T.length?g:y)[w]=r),r}function n(e,a,r){var i,p=r?t.map(r,function(t){return"string"==typeof t?e.key?t.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+_+'="'+e.key+'" $2'):t:n(t,e,t._ctnt)}):e;return a?p:(p=p.join(""),p.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(e,n,a,r){i=t(a).get(),o(i),n&&(i=l(n).concat(i)),r&&(i=i.concat(l(r)))}),i?i:l(p))}function l(e){var n=document.createElement("div");return n.innerHTML=e,t.makeArray(n.childNodes)}function a(e){return Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+t.trim(e).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(e,n,l,a,r,p,o){var u,c,f,m=t.tmpl.tag[l];if(!m)throw"Unknown template tag: "+l;return u=m._default||[],p&&!/\w$/.test(r)&&(r+=p,p=""),r?(r=i(r),o=o?","+i(o)+")":p?")":"",c=p?r.indexOf(".")>-1?r+i(p):"("+r+").call($item"+o:r,f=p?c:"(typeof("+r+")==='function'?("+r+").call($item):("+r+"))"):f=c=u.$1||"null",a=i(a),"');"+m[n?"close":"open"].split("$notnull_1").join(r?"typeof("+r+")!=='undefined' && ("+r+")!=null":"true").split("$1a").join(f).split("$1").join(c).split("$2").join(a||u.$2||"")+"__.push('"})+"');}return __;")}function r(e,l){e._wrap=n(e,!0,t.isArray(l)?l:[h.test(l)?l:t(l).html()]).join("")}function i(t){return t?t.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function p(t){var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}function o(n){function l(n){function l(t){t+=u,i=c[t]=c[t]||e(i,y[i.parent.key+u]||i.parent)}var a,r,i,p,o=n;if(p=n.getAttribute(_)){for(;o.parentNode&&1===(o=o.parentNode).nodeType&&!(a=o.getAttribute(_)););a!==p&&(o=o.parentNode?11===o.nodeType?0:o.getAttribute(_)||0:0,(i=y[p])||(i=g[p],i=e(i,y[o]||g[o]),i.key=++w,y[w]=i),k&&l(p)),n.removeAttribute(_)}else k&&(i=t.data(n,"tmplItem"))&&(l(i.key),y[i.key]=i,o=t.data(n.parentNode,"tmplItem"),o=o?o.key:0);if(i){for(r=i;r&&r.key!=o;)r.nodes.push(n),r=r.parent;delete i._ctnt,delete i._wrap,t.data(n,"tmplItem",i)}}var a,r,i,p,o,u="_"+k,c={};for(i=0,p=n.length;p>i;i++)if(1===(a=n[i]).nodeType){for(r=a.getElementsByTagName("*"),o=r.length-1;o>=0;o--)l(r[o]);l(a)}}function u(t,e,n,l){return t?void T.push({_:t,tmpl:e,item:this,data:n,options:l}):T.pop()}function c(e,n,l){return t.tmpl(t.template(e),n,l,this)}function f(e,n){var l=e.options||{};return l.wrapped=n,t.tmpl(t.template(e.tmpl),e.data,l,e.item)}function m(e,n){var l=this._wrap;return t.map(t(t.isArray(l)?l.join(""):l).filter(e||"*"),function(t){return n?t.innerText||t.textContent:t.outerHTML||p(t)})}function s(){var e=this.nodes;t.tmpl(null,null,null,this).insertBefore(e[0]),t(e).remove()}var d,$=t.fn.domManip,_="_tmplitem",h=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,y={},g={},v={key:0,data:{}},w=0,k=0,T=[];t.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,n){t.fn[e]=function(l){var a,r,i,p,o=[],u=t(l),c=1===this.length&&this[0].parentNode;if(d=y||{},c&&11===c.nodeType&&1===c.childNodes.length&&1===u.length)u[n](this[0]),o=this;else{for(r=0,i=u.length;i>r;r++)k=r,a=(r>0?this.clone(!0):this).get(),t(u[r])[n](a),o=o.concat(a);k=0,o=this.pushStack(o,e,u.selector)}return p=d,d=null,t.tmpl.complete(p),o}}),t.fn.extend({tmpl:function(e,n,l){return t.tmpl(this[0],e,n,l)},tmplItem:function(){return t.tmplItem(this[0])},template:function(e){return t.template(e,this[0])},domManip:function(e,n,l){if(e[0]&&t.isArray(e[0])){for(var a,r=t.makeArray(arguments),i=e[0],p=i.length,o=0;p>o&&!(a=t.data(i[o++],"tmplItem")););a&&k&&(r[2]=function(e){t.tmpl.afterManip(this,e,l)}),$.apply(this,r)}else $.apply(this,arguments);return k=0,d||t.tmpl.complete(y),this}}),t.extend({tmpl:function(l,a,i,p){var o,u=!p;if(u)p=v,l=t.template[l]||t.template(null,l),g={};else if(!l)return l=p.tmpl,y[p.key]=p,p.nodes=[],p.wrapped&&r(p,p.wrapped),t(n(p,null,p.tmpl(t,p)));return l?("function"==typeof a&&(a=a.call(p||{})),i&&i.wrapped&&r(i,i.wrapped),o=t.isArray(a)?t.map(a,function(t){return t?e(i,p,l,t):null}):[e(i,p,l,a)],u?t(n(p,null,o)):o):[]},tmplItem:function(e){var n;for(e instanceof t&&(e=e[0]);e&&1===e.nodeType&&!(n=t.data(e,"tmplItem"))&&(e=e.parentNode););return n||v},template:function(e,n){return n?("string"==typeof n?n=a(n):n instanceof t&&(n=n[0]||{}),n.nodeType&&(n=t.data(n,"tmpl")||t.data(n,"tmpl",a(n.innerHTML))),"string"==typeof e?t.template[e]=n:n):e?"string"!=typeof e?t.template(null,e):t.template[e]||t.template(null,h.test(e)?e:t(e)):null},encode:function(t){return(""+t).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}}),t.extend(t.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){y={}},afterManip:function(e,n,l){var a=11===n.nodeType?t.makeArray(n.childNodes):1===n.nodeType?[n]:[];l.call(e,n),o(a),k++}})});


/* JQuery Pajinate*/
(function($){$.fn.pajinate=function(options){var current_page="current_page";var items_per_page="items_per_page";var meta;var defaults={item_container_id:".content",items_per_page:10,nav_panel_id:".page_navigation",nav_info_id:".info_text",num_page_links_to_display:20,start_page:0,wrap_around:false,nav_label_first:"First",nav_label_prev:"Prev",nav_label_next:"Next",nav_label_last:"Last",nav_order:["first","prev","num","next","last"],nav_label_info:"Showing {0}-{1} of {2} results",show_first_last:true,abort_on_small_lists:false,jquery_ui:false,jquery_ui_active:"ui-state-highlight",jquery_ui_default:"ui-state-default",jquery_ui_disabled:"ui-state-disabled"};var options=$.extend(defaults,options);var $item_container;var $page_container;var $items;var $nav_panels;var total_page_no_links;var jquery_ui_default_class=options.jquery_ui?options.jquery_ui_default:"";var jquery_ui_active_class=options.jquery_ui?options.jquery_ui_active:"";var jquery_ui_disabled_class=options.jquery_ui?options.jquery_ui_disabled:"";return this.each(function(){$page_container=$(this);$item_container=$(this).find(options.item_container_id);$items=$page_container.find(options.item_container_id).children();if(options.abort_on_small_lists&&options.items_per_page>=$items.size())return $page_container;meta=$page_container;meta.data(current_page,0);meta.data(items_per_page,options.items_per_page);var total_items=$item_container.children().size();var number_of_pages=Math.ceil(total_items/options.items_per_page);var more='<span class="ellipse more">...</span>';var less='<span class="ellipse less">...</span>';var first=!options.show_first_last?"":'<a class="first_link '+jquery_ui_default_class+'" href="">'+options.nav_label_first+"</a>";var last=!options.show_first_last?"":'<a class="last_link '+jquery_ui_default_class+'" href="">'+options.nav_label_last+"</a>";var navigation_html="";for(var i=0;i<options.nav_order.length;i++){switch(options.nav_order[i]){case"first":navigation_html+=first;break;case"last":navigation_html+=last;break;case"next":navigation_html+='<a class="next_link '+jquery_ui_default_class+'" href="">'+options.nav_label_next+"</a>";break;case"prev":navigation_html+='<a class="previous_link '+jquery_ui_default_class+'" href="">'+options.nav_label_prev+"</a>";break;case"num":navigation_html+=less;var current_link=0;while(number_of_pages>current_link){navigation_html+='<a class="page_link '+jquery_ui_default_class+'" href="" longdesc="'+current_link+'">'+(current_link+1)+"</a>";current_link++}navigation_html+=more;break;default:break}}$nav_panels=$page_container.find(options.nav_panel_id);$nav_panels.html(navigation_html).each(function(){$(this).find(".page_link:first").addClass("first");$(this).find(".page_link:last").addClass("last")});$nav_panels.children(".ellipse").hide();$nav_panels.find(".previous_link").next().next().addClass("active_page "+jquery_ui_active_class);$items.hide();$items.slice(0,meta.data(items_per_page)).show();total_page_no_links=$page_container.find(options.nav_panel_id+":first").children(".page_link").size();options.num_page_links_to_display=Math.min(options.num_page_links_to_display,total_page_no_links);$nav_panels.children(".page_link").hide();$nav_panels.each(function(){$(this).children(".page_link").slice(0,options.num_page_links_to_display).show()});$page_container.find(".first_link").click(function(e){e.preventDefault();movePageNumbersRight($(this),0);gotopage(0)});$page_container.find(".last_link").click(function(e){e.preventDefault();var lastPage=total_page_no_links-1;movePageNumbersLeft($(this),lastPage);gotopage(lastPage)});$page_container.find(".previous_link").click(function(e){e.preventDefault();showPrevPage($(this))});$page_container.find(".next_link").click(function(e){e.preventDefault();showNextPage($(this))});$page_container.find(".page_link").click(function(e){e.preventDefault();gotopage($(this).attr("longdesc"))});gotopage(parseInt(options.start_page));toggleMoreLess();if(!options.wrap_around)tagNextPrev()});function showPrevPage(e){new_page=parseInt(meta.data(current_page))-1;if($(e).siblings(".active_page").prev(".page_link").length==true){movePageNumbersRight(e,new_page);gotopage(new_page)}else if(options.wrap_around){gotopage(total_page_no_links-1)}}function showNextPage(e){new_page=parseInt(meta.data(current_page))+1;if($(e).siblings(".active_page").next(".page_link").length==true){movePageNumbersLeft(e,new_page);gotopage(new_page)}else if(options.wrap_around){gotopage(0)}}function gotopage(page_num){page_num=parseInt(page_num,10);var ipp=parseInt(meta.data(items_per_page));start_from=page_num*ipp;end_on=start_from+ipp;var items=$items.hide().slice(start_from,end_on);items.show();$page_container.find(options.nav_panel_id).children(".page_link[longdesc="+page_num+"]").addClass("active_page "+jquery_ui_active_class).siblings(".active_page").removeClass("active_page "+jquery_ui_active_class);meta.data(current_page,page_num);var $current_page=parseInt(meta.data(current_page)+1);var total_items=$item_container.children().size();var $number_of_pages=Math.ceil(total_items/options.items_per_page);$page_container.find(options.nav_info_id).html(options.nav_label_info.replace("{0}",start_from+1).replace("{1}",start_from+items.length).replace("{2}",$items.length).replace("{3}",$current_page).replace("{4}",$number_of_pages));toggleMoreLess();tagNextPrev();if(typeof options.onPageDisplayed!=="undefined"){options.onPageDisplayed.call(this,page_num+1)}}function movePageNumbersLeft(e,new_p){var new_page=new_p;var $current_active_link=$(e).siblings(".active_page");if($current_active_link.siblings(".page_link[longdesc="+new_page+"]").css("display")=="none"){$nav_panels.each(function(){$(this).children(".page_link").hide().slice(parseInt(new_page-options.num_page_links_to_display+1),new_page+1).show()})}}function movePageNumbersRight(e,new_p){var new_page=new_p;var $current_active_link=$(e).siblings(".active_page");if($current_active_link.siblings(".page_link[longdesc="+new_page+"]").css("display")=="none"){$nav_panels.each(function(){$(this).children(".page_link").hide().slice(new_page,new_page+parseInt(options.num_page_links_to_display)).show()})}}function toggleMoreLess(){if(!$nav_panels.children(".page_link:visible").hasClass("last")){$nav_panels.children(".more").show()}else{$nav_panels.children(".more").hide()}if(!$nav_panels.children(".page_link:visible").hasClass("first")){$nav_panels.children(".less").show()}else{$nav_panels.children(".less").hide()}}function tagNextPrev(){if($nav_panels.children(".last").hasClass("active_page")){$nav_panels.children(".next_link").add(".last_link").addClass("no_more "+jquery_ui_disabled_class)}else{$nav_panels.children(".next_link").add(".last_link").removeClass("no_more "+jquery_ui_disabled_class)}if($nav_panels.children(".first").hasClass("active_page")){$nav_panels.children(".previous_link").add(".first_link").addClass("no_more "+jquery_ui_disabled_class)}else{$nav_panels.children(".previous_link").add(".first_link").removeClass("no_more "+jquery_ui_disabled_class)}}}})(jQuery);





// Classic Editor
/*(function() {

    tinymce.PluginManager.add('cmse_shortcode_button', function( editor, url ) {
        editor.addButton( 'cmse_shortcode_button', {
            title: 'Insert',
            type: 'menubutton',
            icon: false,
            text: 'Insert',
            menu: [
            {
				text: 'Blockwrap',
				onclick: function() {
				editor.insertContent('[blockwrap class="" title=""][/blockwrap]');
				}
			},
			{
				text: 'iFrame',
				onclick: function() {
				editor.insertContent('[cmseiframe url="http://websitedons.com" width="100%" height="450" scrolling="no"]');
				}
			},
			{
				text: 'Rating Stars',
				onclick: function() {
				editor.insertContent('[ratingstars starcount=5 label=Rating]');
				}
			},
			{
				text: 'Accordion',
				onclick: function() {
				editor.insertContent('[cmseaccordion title="New things" icon="folder-open" iconsuffix="folder-closed" style="background: blue; font-size: 32px;"]the content here[/cmseaccordion]');
				}
			},
			{
				text: 'Inline Modal Content',
				onclick: function() {
				editor.insertContent('[inlinemodal id="uniqueID" style="background: #ffffff;"]content here[/inlinemodal]');
				}
			},
			{
				text: 'Video Player',
				onclick: function() {
				editor.insertContent('[videoplayer]');
				}
			},
			{
				text: 'Audio Player',
				onclick: function() {
				editor.insertContent('[audioplayer]');
				}
			},
			{
				text: 'Admin Note',
				onclick: function() {
				editor.insertContent('[adminnote]<div style="background-color: #fff9c7; padding: 10px;">this note is only visible in admin view. useful for notices to administrators related to this post</div>[/adminnote]');
				}
			}
			]
        });
    });

	tinymce.PluginManager.add('cmse_links_button', function( editor, url ) {
        editor.addButton( 'cmse_links_button', {
            title: 'Links',
            type: 'menubutton',
            icon: false,
            text: 'Links',
            menu: [
				{
					text: 'Green',
					onclick: function() {
					editor.insertContent('<a href="#">link</a>');
					}
				}
			]
		});
	});

})();*/

//Wowza video player
/*
	Wowza Player v1.1.22
	Copyright 2015-2020 Wowza Media Systems, LLC.
!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
 */


/*testing*/

/*ar req = new XMLHttpRequest();
window.onload = function(e) {
req.open("GET", "https://c17.radioboss.fm:18496", true, "username", "eventsrusonline1");
//invocation.withCredentials = true;
 req.setRequestHeader('Authorization', 'Basic [base64 eventsrusonline1]' );
}*/





/* SCROLLBAR FOR OVERFLOW ELEMENTS
* 
* Copyright (c) 2012, 2014 Hyeonje Alex Jun and other contributors
* Licensed under the MIT License
*/
(function (factory) {
  'use strict';

  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['jquery'], factory);
  } else if (typeof exports === 'object') {
    // Node/CommonJS
    factory(require('jquery'));
  } else {
    // Browser globals
    factory(jQuery);
  }
}(function ($) {
  'use strict';

  // The default settings for the plugin
  var defaultSettings = {
    wheelSpeed: 10,
    wheelPropagation: false,
    minScrollbarLength: null,
    useBothWheelAxes: false,
    useKeyboard: true,
    suppressScrollX: true,
    suppressScrollY: false,
    scrollXMarginOffset: 0,
    scrollYMarginOffset: 0,
    includePadding: false
  };

  var getEventClassName = (function () {
    var incrementingId = 0;
    return function () {
      var id = incrementingId;
      incrementingId += 1;
      return '.perfect-scrollbar-' + id;
    };
  }());

  $.fn.perfectScrollbar = function (suppliedSettings, option) {

    return this.each(function () {
      // Use the default settings
      var settings = $.extend(true, {}, defaultSettings),
          $this = $(this);

      if (typeof suppliedSettings === "object") {
        // But over-ride any supplied
        $.extend(true, settings, suppliedSettings);
      } else {
        // If no settings were supplied, then the first param must be the option
        option = suppliedSettings;
      }

      // Catch options

      if (option === 'update') {
        if ($this.data('perfect-scrollbar-update')) {
          $this.data('perfect-scrollbar-update')();
        }
        return $this;
      }
      else if (option === 'destroy') {
        if ($this.data('perfect-scrollbar-destroy')) {
          $this.data('perfect-scrollbar-destroy')();
        }
        return $this;
      }

      if ($this.data('perfect-scrollbar')) {
        // if there's already perfect-scrollbar
        return $this.data('perfect-scrollbar');
      }


      // Or generate new perfectScrollbar

      // Set class to the container
      $this.addClass('ps-container');

      var $scrollbarXRail = $("<div class='ps-scrollbar-x-rail'></div>").appendTo($this),
          $scrollbarYRail = $("<div class='ps-scrollbar-y-rail'></div>").appendTo($this),
          $scrollbarX = $("<div class='ps-scrollbar-x'></div>").appendTo($scrollbarXRail),
          $scrollbarY = $("<div class='ps-scrollbar-y'></div>").appendTo($scrollbarYRail),
          scrollbarXActive,
          scrollbarYActive,
          containerWidth,
          containerHeight,
          contentWidth,
          contentHeight,
          scrollbarXWidth,
          scrollbarXLeft,
          scrollbarXBottom = parseInt($scrollbarXRail.css('bottom'), 10),
          isScrollbarXUsingBottom = scrollbarXBottom === scrollbarXBottom, // !isNaN
          scrollbarXTop = isScrollbarXUsingBottom ? null : parseInt($scrollbarXRail.css('top'), 10),
          scrollbarYHeight,
          scrollbarYTop,
          scrollbarYRight = parseInt($scrollbarYRail.css('right'), 10),
          isScrollbarYUsingRight = scrollbarYRight === scrollbarYRight, // !isNaN
          scrollbarYLeft = isScrollbarYUsingRight ? null: parseInt($scrollbarYRail.css('left'), 10),
          isRtl = $this.css('direction') === "rtl",
          eventClassName = getEventClassName();

      var updateContentScrollTop = function (currentTop, deltaY) {
        var newTop = currentTop + deltaY,
            maxTop = containerHeight - scrollbarYHeight;

        if (newTop < 0) {
          scrollbarYTop = 0;
        }
        else if (newTop > maxTop) {
          scrollbarYTop = maxTop;
        }
        else {
          scrollbarYTop = newTop;
        }

        var scrollTop = parseInt(scrollbarYTop * (contentHeight - containerHeight) / (containerHeight - scrollbarYHeight), 10);
        $this.scrollTop(scrollTop);

        if (isScrollbarXUsingBottom) {
          $scrollbarXRail.css({bottom: scrollbarXBottom - scrollTop});
        } else {
          $scrollbarXRail.css({top: scrollbarXTop + scrollTop});
        }
      };

      var updateContentScrollLeft = function (currentLeft, deltaX) {
        var newLeft = currentLeft + deltaX,
            maxLeft = containerWidth - scrollbarXWidth;

        if (newLeft < 0) {
          scrollbarXLeft = 0;
        }
        else if (newLeft > maxLeft) {
          scrollbarXLeft = maxLeft;
        }
        else {
          scrollbarXLeft = newLeft;
        }

        var scrollLeft = parseInt(scrollbarXLeft * (contentWidth - containerWidth) / (containerWidth - scrollbarXWidth), 10);
        $this.scrollLeft(scrollLeft);

        if (isScrollbarYUsingRight) {
          $scrollbarYRail.css({right: scrollbarYRight - scrollLeft});
        } else {
          $scrollbarYRail.css({left: scrollbarYLeft + scrollLeft});
        }
      };

      var getSettingsAdjustedThumbSize = function (thumbSize) {
        if (settings.minScrollbarLength) {
          thumbSize = Math.max(thumbSize, settings.minScrollbarLength);
        }
        return thumbSize;
      };

      var updateScrollbarCss = function () {
        var scrollbarXStyles = {width: containerWidth, display: scrollbarXActive ? "inherit": "none"};
        if (isRtl) {
          scrollbarXStyles.left = $this.scrollLeft() + containerWidth - contentWidth;
        } else {
          scrollbarXStyles.left = $this.scrollLeft();
        }
        if (isScrollbarXUsingBottom) {
          scrollbarXStyles.bottom = scrollbarXBottom - $this.scrollTop();
        } else {
          scrollbarXStyles.top = scrollbarXTop + $this.scrollTop();
        }
        $scrollbarXRail.css(scrollbarXStyles);

        var scrollbarYStyles = {top: $this.scrollTop(), height: containerHeight, display: scrollbarYActive ? "inherit": "none"};

        if (isScrollbarYUsingRight) {
          if (isRtl) {
            scrollbarYStyles.right = contentWidth - $this.scrollLeft() - scrollbarYRight - $scrollbarY.outerWidth();
          } else {
            scrollbarYStyles.right = scrollbarYRight - $this.scrollLeft();
          }
        } else {
          if (isRtl) {
            scrollbarYStyles.left = $this.scrollLeft() + containerWidth * 2 - contentWidth - scrollbarYLeft - $scrollbarY.outerWidth();
          } else {
            scrollbarYStyles.left = scrollbarYLeft + $this.scrollLeft();
          }
        }
        $scrollbarYRail.css(scrollbarYStyles);

        $scrollbarX.css({left: scrollbarXLeft, width: scrollbarXWidth});
        $scrollbarY.css({top: scrollbarYTop, height: scrollbarYHeight});
      };

      var updateBarSizeAndPosition = function () {
        containerWidth = settings.includePadding ? $this.innerWidth() : $this.width();
        containerHeight = settings.includePadding ? $this.innerHeight() : $this.height();
        contentWidth = $this.prop('scrollWidth');
        contentHeight = $this.prop('scrollHeight');

        if (!settings.suppressScrollX && containerWidth + settings.scrollXMarginOffset < contentWidth) {
          scrollbarXActive = true;
          scrollbarXWidth = getSettingsAdjustedThumbSize(parseInt(containerWidth * containerWidth / contentWidth, 10));
          scrollbarXLeft = parseInt($this.scrollLeft() * (containerWidth - scrollbarXWidth) / (contentWidth - containerWidth), 10);
        }
        else {
          scrollbarXActive = false;
          scrollbarXWidth = 0;
          scrollbarXLeft = 0;
          $this.scrollLeft(0);
        }

        if (!settings.suppressScrollY && containerHeight + settings.scrollYMarginOffset < contentHeight) {
          scrollbarYActive = true;
          scrollbarYHeight = getSettingsAdjustedThumbSize(parseInt(containerHeight * containerHeight / contentHeight, 10));
          scrollbarYTop = parseInt($this.scrollTop() * (containerHeight - scrollbarYHeight) / (contentHeight - containerHeight), 10);
        }
        else {
          scrollbarYActive = false;
          scrollbarYHeight = 0;
          scrollbarYTop = 0;
          $this.scrollTop(0);
        }

        if (scrollbarYTop >= containerHeight - scrollbarYHeight) {
          scrollbarYTop = containerHeight - scrollbarYHeight;
        }
        if (scrollbarXLeft >= containerWidth - scrollbarXWidth) {
          scrollbarXLeft = containerWidth - scrollbarXWidth;
        }

        updateScrollbarCss();
      };

      var bindMouseScrollXHandler = function () {
        var currentLeft,
            currentPageX;

        $scrollbarX.bind('mousedown' + eventClassName, function (e) {
          currentPageX = e.pageX;
          currentLeft = $scrollbarX.position().left;
          $scrollbarXRail.addClass('in-scrolling');
          e.stopPropagation();
          e.preventDefault();
        });

        $(document).bind('mousemove' + eventClassName, function (e) {
          if ($scrollbarXRail.hasClass('in-scrolling')) {
            updateContentScrollLeft(currentLeft, e.pageX - currentPageX);
            e.stopPropagation();
            e.preventDefault();
          }
        });

        $(document).bind('mouseup' + eventClassName, function (e) {
          if ($scrollbarXRail.hasClass('in-scrolling')) {
            $scrollbarXRail.removeClass('in-scrolling');
          }
        });

        currentLeft =
        currentPageX = null;
      };

      var bindMouseScrollYHandler = function () {
        var currentTop,
            currentPageY;

        $scrollbarY.bind('mousedown' + eventClassName, function (e) {
          currentPageY = e.pageY;
          currentTop = $scrollbarY.position().top;
          $scrollbarYRail.addClass('in-scrolling');
          e.stopPropagation();
          e.preventDefault();
        });

        $(document).bind('mousemove' + eventClassName, function (e) {
          if ($scrollbarYRail.hasClass('in-scrolling')) {
            updateContentScrollTop(currentTop, e.pageY - currentPageY);
            e.stopPropagation();
            e.preventDefault();
          }
        });

        $(document).bind('mouseup' + eventClassName, function (e) {
          if ($scrollbarYRail.hasClass('in-scrolling')) {
            $scrollbarYRail.removeClass('in-scrolling');
          }
        });

        currentTop =
        currentPageY = null;
      };

      // check if the default scrolling should be prevented.
      var shouldPreventDefault = function (deltaX, deltaY) {
        var scrollTop = $this.scrollTop();
        if (deltaX === 0) {
          if (!scrollbarYActive) {
            return false;
          }
          if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= contentHeight - containerHeight && deltaY < 0)) {
            return !settings.wheelPropagation;
          }
        }

        var scrollLeft = $this.scrollLeft();
        if (deltaY === 0) {
          if (!scrollbarXActive) {
            return false;
          }
          if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= contentWidth - containerWidth && deltaX > 0)) {
            return !settings.wheelPropagation;
          }
        }
        return true;
      };

      // bind handlers
      var bindMouseWheelHandler = function () {
        // FIXME: Backward compatibility.
        // After e.deltaFactor applied, wheelSpeed should have smaller value.
        // Currently, there's no way to change the settings after the scrollbar initialized.
        // But if the way is implemented in the future, wheelSpeed should be reset.
        settings.wheelSpeed /= 10;

        var shouldPrevent = false;
        $this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) {
          var deltaX = e.deltaX * e.deltaFactor || deprecatedDeltaX,
              deltaY = e.deltaY * e.deltaFactor || deprecatedDeltaY;

          shouldPrevent = false;
          if (!settings.useBothWheelAxes) {
            // deltaX will only be used for horizontal scrolling and deltaY will
            // only be used for vertical scrolling - this is the default
            $this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));
            $this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));
          } else if (scrollbarYActive && !scrollbarXActive) {
            // only vertical scrollbar is active and useBothWheelAxes option is
            // active, so let's scroll vertical bar using both mouse wheel axes
            if (deltaY) {
              $this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));
            } else {
              $this.scrollTop($this.scrollTop() + (deltaX * settings.wheelSpeed));
            }
            shouldPrevent = true;
          } else if (scrollbarXActive && !scrollbarYActive) {
            // useBothWheelAxes and only horizontal bar is active, so use both
            // wheel axes for horizontal bar
            if (deltaX) {
              $this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));
            } else {
              $this.scrollLeft($this.scrollLeft() - (deltaY * settings.wheelSpeed));
            }
            shouldPrevent = true;
          }

          // update bar position
          updateBarSizeAndPosition();

          shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY));
          if (shouldPrevent) {
            e.stopPropagation();
            e.preventDefault();
          }
        });

        // fix Firefox scroll problem
        $this.bind('MozMousePixelScroll' + eventClassName, function (e) {
          if (shouldPrevent) {
            e.preventDefault();
          }
        });
      };

      var bindKeyboardHandler = function () {
        var hovered = false;
        $this.bind('mouseenter' + eventClassName, function (e) {
          hovered = true;
        });
        $this.bind('mouseleave' + eventClassName, function (e) {
          hovered = false;
        });

        var shouldPrevent = false;
        $(document).bind('keydown' + eventClassName, function (e) {
          if (!hovered || $(document.activeElement).is(":input,[contenteditable]")) {
            return;
          }

          var deltaX = 0,
              deltaY = 0;

          switch (e.which) {
          case 37: // left
            deltaX = -30;
            break;
          case 38: // up
            deltaY = 30;
            break;
          case 39: // right
            deltaX = 30;
            break;
          case 40: // down
            deltaY = -30;
            break;
          case 33: // page up
            deltaY = 90;
            break;
          case 32: // space bar
          case 34: // page down
            deltaY = -90;
            break;
          case 35: // end
            deltaY = -containerHeight;
            break;
          case 36: // home
            deltaY = containerHeight;
            break;
          default:
            return;
          }

          $this.scrollTop($this.scrollTop() - deltaY);
          $this.scrollLeft($this.scrollLeft() + deltaX);

          shouldPrevent = shouldPreventDefault(deltaX, deltaY);
          if (shouldPrevent) {
            e.preventDefault();
          }
        });
      };

      var bindRailClickHandler = function () {
        var stopPropagation = function (e) { e.stopPropagation(); };

        $scrollbarY.bind('click' + eventClassName, stopPropagation);
        $scrollbarYRail.bind('click' + eventClassName, function (e) {
          var halfOfScrollbarLength = parseInt(scrollbarYHeight / 2, 10),
              positionTop = e.pageY - $scrollbarYRail.offset().top - halfOfScrollbarLength,
              maxPositionTop = containerHeight - scrollbarYHeight,
              positionRatio = positionTop / maxPositionTop;

          if (positionRatio < 0) {
            positionRatio = 0;
          } else if (positionRatio > 1) {
            positionRatio = 1;
          }

          $this.scrollTop((contentHeight - containerHeight) * positionRatio);
        });

        $scrollbarX.bind('click' + eventClassName, stopPropagation);
        $scrollbarXRail.bind('click' + eventClassName, function (e) {
          var halfOfScrollbarLength = parseInt(scrollbarXWidth / 2, 10),
              positionLeft = e.pageX - $scrollbarXRail.offset().left - halfOfScrollbarLength,
              maxPositionLeft = containerWidth - scrollbarXWidth,
              positionRatio = positionLeft / maxPositionLeft;

          if (positionRatio < 0) {
            positionRatio = 0;
          } else if (positionRatio > 1) {
            positionRatio = 1;
          }

          $this.scrollLeft((contentWidth - containerWidth) * positionRatio);
        });
      };

      // bind mobile touch handler
      var bindMobileTouchHandler = function () {
        var applyTouchMove = function (differenceX, differenceY) {
          $this.scrollTop($this.scrollTop() - differenceY);
          $this.scrollLeft($this.scrollLeft() - differenceX);

          // update bar position
          updateBarSizeAndPosition();
        };

        var startCoords = {},
            startTime = 0,
            speed = {},
            breakingProcess = null,
            inGlobalTouch = false;

        $(window).bind("touchstart" + eventClassName, function (e) {
          inGlobalTouch = true;
        });
        $(window).bind("touchend" + eventClassName, function (e) {
          inGlobalTouch = false;
        });

        $this.bind("touchstart" + eventClassName, function (e) {
          var touch = e.originalEvent.targetTouches[0];

          startCoords.pageX = touch.pageX;
          startCoords.pageY = touch.pageY;

          startTime = (new Date()).getTime();

          if (breakingProcess !== null) {
            clearInterval(breakingProcess);
          }

          e.stopPropagation();
        });
        $this.bind("touchmove" + eventClassName, function (e) {
          if (!inGlobalTouch && e.originalEvent.targetTouches.length === 1) {
            var touch = e.originalEvent.targetTouches[0];

            var currentCoords = {};
            currentCoords.pageX = touch.pageX;
            currentCoords.pageY = touch.pageY;

            var differenceX = currentCoords.pageX - startCoords.pageX,
              differenceY = currentCoords.pageY - startCoords.pageY;

            applyTouchMove(differenceX, differenceY);
            startCoords = currentCoords;

            var currentTime = (new Date()).getTime();

            var timeGap = currentTime - startTime;
            if (timeGap > 0) {
              speed.x = differenceX / timeGap;
              speed.y = differenceY / timeGap;
              startTime = currentTime;
            }

            e.preventDefault();
          }
        });
        $this.bind("touchend" + eventClassName, function (e) {
          clearInterval(breakingProcess);
          breakingProcess = setInterval(function () {
            if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
              clearInterval(breakingProcess);
              return;
            }

            applyTouchMove(speed.x * 30, speed.y * 30);

            speed.x *= 0.8;
            speed.y *= 0.8;
          }, 10);
        });
      };

      var bindScrollHandler = function () {
        $this.bind('scroll' + eventClassName, function (e) {
          updateBarSizeAndPosition();
        });
      };

      var destroy = function () {
        $this.unbind(eventClassName);
        $(window).unbind(eventClassName);
        $(document).unbind(eventClassName);
        $this.data('perfect-scrollbar', null);
        $this.data('perfect-scrollbar-update', null);
        $this.data('perfect-scrollbar-destroy', null);
        $scrollbarX.remove();
        $scrollbarY.remove();
        $scrollbarXRail.remove();
        $scrollbarYRail.remove();

        // clean all variables
        $scrollbarXRail =
        $scrollbarYRail =
        $scrollbarX =
        $scrollbarY =
        scrollbarXActive =
        scrollbarYActive =
        containerWidth =
        containerHeight =
        contentWidth =
        contentHeight =
        scrollbarXWidth =
        scrollbarXLeft =
        scrollbarXBottom =
        isScrollbarXUsingBottom =
        scrollbarXTop =
        scrollbarYHeight =
        scrollbarYTop =
        scrollbarYRight =
        isScrollbarYUsingRight =
        scrollbarYLeft =
        isRtl =
        eventClassName = null;
      };

      var ieSupport = function (version) {
        $this.addClass('ie').addClass('ie' + version);

        var bindHoverHandlers = function () {
          var mouseenter = function () {
            $(this).addClass('hover');
          };
          var mouseleave = function () {
            $(this).removeClass('hover');
          };
          $this.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
          $scrollbarXRail.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
          $scrollbarYRail.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
          $scrollbarX.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
          $scrollbarY.bind('mouseenter' + eventClassName, mouseenter).bind('mouseleave' + eventClassName, mouseleave);
        };

        var fixIe6ScrollbarPosition = function () {
          updateScrollbarCss = function () {
            var scrollbarXStyles = {left: scrollbarXLeft + $this.scrollLeft(), width: scrollbarXWidth};
            if (isScrollbarXUsingBottom) {
              scrollbarXStyles.bottom = scrollbarXBottom;
            } else {
              scrollbarXStyles.top = scrollbarXTop;
            }
            $scrollbarX.css(scrollbarXStyles);

            var scrollbarYStyles = {top: scrollbarYTop + $this.scrollTop(), height: scrollbarYHeight};
            if (isScrollbarYUsingRight) {
              scrollbarYStyles.right = scrollbarYRight;
            } else {
              scrollbarYStyles.left = scrollbarYLeft;
            }

            $scrollbarY.css(scrollbarYStyles);
            $scrollbarX.hide().show();
            $scrollbarY.hide().show();
          };
        };

        if (version === 6) {
          bindHoverHandlers();
          fixIe6ScrollbarPosition();
        }
      };

      var supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);

      var initialize = function () {
        var ieMatch = navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);
        if (ieMatch && ieMatch[1] === 'msie') {
          // must be executed at first, because 'ieSupport' may addClass to the container
          ieSupport(parseInt(ieMatch[2], 10));
        }

        updateBarSizeAndPosition();
        bindScrollHandler();
        bindMouseScrollXHandler();
        bindMouseScrollYHandler();
        bindRailClickHandler();
        if (supportsTouch) {
          bindMobileTouchHandler();
        }
        if ($this.mousewheel) {
          bindMouseWheelHandler();
        }
        if (settings.useKeyboard) {
          bindKeyboardHandler();
        }
        $this.data('perfect-scrollbar', $this);
        $this.data('perfect-scrollbar-update', updateBarSizeAndPosition);
        $this.data('perfect-scrollbar-destroy', destroy);
      };

      // initialize
      initialize();

      return $this;
    });
  };
}));

