/*  */
/**
 * @version		$Id: k2.js 1304 2011-10-31 13:16:09Z joomlaworks $
 * @package		K2
 * @author		JoomlaWorks http://www.joomlaworks.gr
 * @copyright	Copyright (c) 2006 - 2011 JoomlaWorks Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

var $K2 = jQuery.noConflict();

$K2(document).ready(function(){

	// Comments
	$K2('#comment-form').submit(function(event){
		event.preventDefault();
		$K2('#formLog').empty().addClass('formLogLoading');
		$K2.ajax({
			url: $K2('#comment-form').attr('action'),
			type: 'post',
			dataType: 'json',
			data: $K2('#comment-form').serialize(),
			success: function(response){
				$K2('#formLog').removeClass('formLogLoading').html(response.message);
				if(typeof(Recaptcha) != "undefined"){
					Recaptcha.reload();
				}
				if (response.refresh) {
					window.location.reload();
				}
			}
		});
	});
	
	$K2('.commentRemoveLink').click(function(event){
		event.preventDefault();
		var element = $K2(this);
		$K2(element).parent().addClass('commentToolbarLoading');
		$K2.ajax({
			url: $K2(element).attr('href'),
			type: 'post',
			data: $K2('#comment-form input:last').serialize(),
			success: function(response){
				$K2(element).parent().removeClass('commentToolbarLoading');
				if(response=='true'){
					$K2(element).parent().parent().remove();
				}
			}
		});
	});
	
	$K2('.commentApproveLink').click(function(event){
		event.preventDefault();
		var element = $K2(this);
		$K2(element).parent().addClass('commentToolbarLoading');
		$K2.ajax({
			url: $K2(element).attr('href'),
			type: 'post',
			data: $K2('#comment-form input:last').serialize(),
			success: function(response){
				$K2(element).parent().removeClass('commentToolbarLoading');
				if(response=='true'){
					$K2(element).parent().parent().removeClass('unpublishedComment');
				}
			}
		});
	});
	
	$K2('#k2ReportCommentForm').submit(function(event){
		event.preventDefault();
		$K2('#formLog').empty().addClass('formLogLoading');
		$K2.ajax({
			url: $K2('#k2ReportCommentForm').attr('action'),
			type: 'post',
			data: $K2('#k2ReportCommentForm').serialize(),
			success: function(response){
				$K2('#formLog').removeClass('formLogLoading').html(response);
				if(typeof(Recaptcha) != "undefined"){
					Recaptcha.reload();
				}
			}
		});
	});

	// Text Resizer
	$K2('#fontDecrease').click(function(event){
		event.preventDefault();
		$K2('.itemFullText').removeClass('largerFontSize');
		$K2('.itemFullText').addClass('smallerFontSize');
	});
	$K2('#fontIncrease').click(function(event){
		event.preventDefault();
		$K2('.itemFullText').removeClass('smallerFontSize');
		$K2('.itemFullText').addClass('largerFontSize');
	});

	// Smooth Scroll
	$K2('.k2Anchor').click(function(event){
		event.preventDefault();
		var target = this.hash;
		$K2('html, body').stop().animate({
			scrollTop: $K2(target).offset().top
		}, 500);
	});

	// Rating
	$K2('.itemRatingForm a').click(function(event){
		event.preventDefault();
		var itemID = $K2(this).attr('rel');
		var log = $K2('#itemRatingLog' + itemID).empty().addClass('formLogLoading');
		var rating = $K2(this).html();
		$K2.ajax({
			url: K2SitePath+"index.php?option=com_k2&view=item&task=vote&format=raw&user_rating=" + rating + "&itemID=" + itemID,
			type: 'get',
			success: function(response){
				log.removeClass('formLogLoading');
				log.html(response);
				$K2.ajax({
					url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesPercentage&format=raw&itemID=" + itemID,
					type: 'get',
					success: function(percentage){
						$K2('#itemCurrentRating' + itemID).css('width', percentage + "%");
						setTimeout(function(){
							$K2.ajax({
								url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesNum&format=raw&itemID=" + itemID,
								type: 'get',
								success: function(response){
									log.html(response);
								}
							});
						}, 2000);
					}
				});
			}
		});
	});

	// Classic popup
	$K2('.classicPopup').click(function(event){
		event.preventDefault();
		if($K2(this).attr('rel')){
			var json = $K2(this).attr('rel');
			json = json.replace(/'/g, '"');
			var options = $K2.parseJSON(json);
		} else {
			var options = {x:900,y:600}; /* use some default values if not defined */
		}
		window.open($K2(this).attr('href'),'K2PopUpWindow','width='+options.x+',height='+options.y+',menubar=yes,resizable=yes');
	});
	
	// Live search
	$K2('div.k2LiveSearchBlock form input[name=searchword]').keyup(function(event){
		var parentElement = $K2(this).parent().parent();
		if($K2(this).val().length>3 && event.key!='enter'){
			$K2(this).addClass('k2SearchLoading');
			parentElement.find('.k2LiveSearchResults').css('display','none').empty();
			parentElement.find('input[name=t]').val($K2.now());
			parentElement.find('input[name=format]').val('raw');
			var url = 'index.php?option=com_k2&view=itemlist&task=search&' + parentElement.find('form').serialize();
			parentElement.find('input[name=format]').val('html');
			$K2.ajax({
				url: url,
				type: 'get',
				success: function(response){
					parentElement.find('.k2LiveSearchResults').html(response);
					parentElement.find('input[name=searchword]').removeClass('k2SearchLoading');
					parentElement.find('.k2LiveSearchResults').css('display', 'block');
				}
			});
		} else {
			parentElement.find('.k2LiveSearchResults').css('display','none').empty();
		}
	});

	// Calendar
	$K2('a.calendarNavLink').live('click', function(event){
		event.preventDefault();
		var parentElement = $K2(this).parent().parent().parent().parent();
		var url = $K2(this).attr('href');
		parentElement.empty().addClass('k2CalendarLoader');
		$K2.ajax({
			url: url,
			type: 'post',
			success: function(response){
				parentElement.html(response);
				parentElement.removeClass('k2CalendarLoader');
			}
		});
	});
	
	// Generic Element Scroller (use .k2Scroller in the container and .k2ScrollerElement for each contained element)
	$K2('.k2Scroller').css('width',($K2('.k2Scroller').find('.k2ScrollerElement:first').outerWidth(true))*$K2('.k2Scroller').children('.k2ScrollerElement').length);

});

// Equal block heights for the "default" view
$K2(window).load(function () {
	var blocks = $K2('.subCategory, .k2EqualHeights');
	var maxHeight = 0;
	blocks.each(function(){
		maxHeight = Math.max(maxHeight, parseInt($K2(this).css('height')));
	});
	blocks.css('height', maxHeight);
});


/*  */
/**
 * ------------------------------------------------------------------------
 * T3V2 Framework
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-20011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */

function switchFontSize (ckname,val){
	var bd = document.getElementsByTagName('body');
	if (!bd || !bd.length) return;
	bd = bd[0];
	var oldclass = 'fs'+CurrentFontSize;
	switch (val) {
		case 'inc':
			if (CurrentFontSize+1 < 7) {
				CurrentFontSize++;
			}		
		break;
		case 'dec':
			if (CurrentFontSize-1 > 0) {
				CurrentFontSize--;
			}		
		break;
		case 'reset':
		default:
			CurrentFontSize = DefaultFontSize;			
	}
	var newclass = 'fs'+CurrentFontSize;
	bd.className = bd.className.replace(new RegExp('fs.?', 'g'), '');
	bd.className = trim(bd.className);
	bd.className += (bd.className?' ':'') + newclass;
	createCookie(ckname, CurrentFontSize, 365);
}

function switchTool (ckname, val) {
	createCookie(ckname, val, 365);
	window.location.reload();
}

function cpanel_reset () {	
	var matches = document.cookie.match(new RegExp('(?:^|;)\\s*' + tmpl_name.escapeRegExp() + '_([^=]*)=([^;]*)', 'g'));
	if (!matches) return;
	for (i=0;i<matches.length;i++) {
		var ck = matches[i].match(new RegExp('(?:^|;)\\s*' + tmpl_name.escapeRegExp() + '_([^=]*)=([^;]*)'));
		if (ck) {
			createCookie (tmpl_name+'_'+ck[1], '', -1);
		}
	}
	
	if (window.location.href.indexOf ('?')>-1) window.location.href = window.location.href.substr(0,window.location.href.indexOf ('?'));
	else window.location.reload();
}

function cpanel_apply () {
	var elems = document.getElementById('ja-cpanel-main').getElementsByTagName ('*');
	
	var usersetting = {};
	for (i=0;i<elems.length;i++) {
		var el = elems[i]; 
	    if (el.name && (match=el.name.match(/^user_(.*)$/))) {
	        var name = match[1];	        
	        var value = '';
	        if (el.tagName.toLowerCase() == 'input' && (el.type.toLowerCase()=='radio' || el.type.toLowerCase()=='checkbox')) {
	        	if (el.checked) value = el.value;
	        } else {
	        	value = el.value;
	        }
	        if (usersetting[name]) {
	        	if (value) usersetting[name] = value + ',' + usersetting[name];
	        } else {
	        	usersetting[name] = value;
	        }
	    }
	}
	
	for (var k in usersetting) {
		name = tmpl_name + '_' + k;
		value = usersetting[k];
		createCookie(name, value, 365);
	}
	
	if (window.location.href.indexOf ('?')>-1) window.location.href = window.location.href.substr(0,window.location.href.indexOf ('?'));
	else window.location.reload();
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function getScreenWidth () {
    var x = 0;
    if (self.innerHeight) {
            x = self.innerWidth;
    } else if (document.documentElement && document.documentElement.clientHeight) {
            x = document.documentElement.clientWidth;
    } else if (document.body) {
            x = document.body.clientWidth;
    }
    return x;		
}

function equalHeight (els) {
	els = $$_(els);	
	if (!els || els.length < 2) return;
	var maxh = 0;
	var els_ = [];
	els.each(function(el, i){
		if (!el) return;
		//els_[i] = getDeepestWrapper (el); 
		els_[i] = el;
		var ch = els_[i].getCoordinates().height;
		maxh = (maxh < ch) ? ch : maxh;		
	},this);
	
	els_.each(function(el, i){
		if (!el) return;
		if (maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt() > 0) el.setStyle('min-height', maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());		
	},this);	
}

function getDeepestWrapper (el) {
	while (el.getChildren().length==1)
	{
		el = el.getChildren()[0];
	}
	return el;
}

function fixHeight (els, group1, group2) {
	els = $$_(els);
	group1 = $$_(group1);
	group2 = $$_(group2);
	if (!els || !group1) return;
	var height = 0;
	group1.each (function (el){
		if (!el) return;
		height += el.getCoordinates().height;
	});
	if (group2) {
		group2.each (function (el){
			if (!el) return;
			height -= el.getCoordinates().height;
		});
	}
	els.each(function(el, i){
		if (!el) return;
		if (height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt() > 0) el.setStyle('min-height', height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());
	});
}

function addFirstLastItem (el) {
	el = $(el);
	if (!el || !el.getChildren() || !el.getChildren().length) return;
	el.getChildren ()[0].addClass ('first-item');
	el.getChildren ()[el.getChildren ().length-1].addClass ('last-item');
}

function $$_ (els) {
	if ($type(els)=='string') return $$(els);
	var els_ = [];
	els.each (function (el){
		el = $(el);
		if (el) els_.push (el);
	});
	return els_;
}

/*  */
/**
 * ------------------------------------------------------------------------
 * T3V2 Framework
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-20011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */

var jaMegaMenuMoo = new Class({

	initialize: function(menu, options){
		this.options = $extend({
			slide:	true, //enable slide
			duration: 300, //slide speed. lower for slower, bigger for faster
			fading: false, //Enable fading
			bgopacity: 0.9, //set the transparent background. 0 to disable, 0<bgopacity<1: the opacity of the background
			delayHide: 500,
			direction: 'down',
			action: 'mouseenter', //mouseenter or click
			hidestyle: 'normal'
		}, options || {});
		//ignore delayHide if no animation
		if (!this.options.slide && !this.options.fading) this.options.delayHide = 10;
		
		this.menu = menu;
		this.childopen = new Array();
		this.imageloaded = false;
		this.loaded = false;
		//window.addEvent('load', this.start.bind(this));
		this.start();
	},
	
	start: function () {
		//do nothing if loaded
		if (this.loaded) return;
		
		this.menu = $(this.menu);
		//preload images
		var images = this.menu.getElements ('img');
		if (images && images.length && !this.imageloaded) {
			var imgs = [];
			images.each (function (image) {imgs.push(image.src)});
			if (imgs.length) {
				new Asset.images(imgs, {			
					onComplete: function(){
						this.start();
					}.bind(this)
				});
				this.imageloaded = true;
				
				//call this start if cannot load image after sometime
				this.start.delay (3000, this);
				return ;
			}
		}
		
		//mark as called
		this.loaded = true;
		
		//get wrapper
		p = this.menu;
		while (p=p.getParent()) {
			if (p.hasClass ('main') || p.hasClass ('wrap')) {this.wrapper = p; break;}
		}
		this.items = this.menu.getElements ('li.mega');
		//this.items.setStyle ('position', 'relative');
		this.items.each (function(li) {
			//link item
			if ((a = li.getElement('a.mega')) && this.isChild (a, li)) li.a = a;
			else li.a = null;
			//parent
			li._parent = this.getParent (li);
			//child content
			if ((childcontent = li.getElement('.childcontent')) && this.isChild (childcontent, li)) {
				li.childcontent = childcontent;
				li.childcontent_inner = li.childcontent.getElement ('.childcontent-inner-wrap');
				var coor = li.childcontent_inner.getCoordinates ();
				li._w = li.getElement('.childcontent-inner').offsetWidth;
				li._h = li.getElement('.childcontent-inner').offsetHeight;

				li.level0 = li.getParent().hasClass('level0');
				//
				li.childcontent.setStyles ({'width':li._w+10, 'height':li._h});
				li.childcontent_inner.setStyles ({'width':li._w});
				//fix for overflow
				li.childcontent_inner1 = li.childcontent.getElement ('.childcontent-inner');
				li.childcontent_inner1.ol = false;
				if (li.childcontent_inner1.getStyle ('overflow') == 'auto' || li.childcontent_inner1.getStyle ('overflow') == 'scroll') {
					li.childcontent_inner1.ol = true;
					//fix for ie6/7
					if (window.ie6 || window.ie7) {
						li.childcontent_inner1.setStyle ('position', 'relative');
					}
					
					if (window.ie6) {
						li.childcontent_inner1.setStyle ('height', li.childcontent_inner1.getStyle ('max-height') || 400);
					}
				}

				//show direction
				if (this.options.direction == 'up') {
					if (li.level0) {
						li.childcontent.setStyle ('top', -li.childcontent.offsetHeight); //ajust top position
					} else {
						li.childcontent.setStyle ('bottom', 0);
					}
				}
			}
			else li.childcontent = null;
			
			if (li.childcontent && this.options.bgopacity) {
				//Make transparent background
				var bg = new Element ('div', {'class':'childcontent-bg'});
				bg.injectTop (li.childcontent_inner);
				bg.setStyles ({'width':'100%', 'height':li._h, 'opacity':this.options.bgopacity,
								'position': 'absolute', 'top': 0, 'left': 0, 'z-index': 1
								});
				if (li.childcontent.getStyle('background')) bg.setStyle ('background', li.childcontent.getStyle('background'));
				if (li.childcontent.getStyle('background-image')) bg.setStyle ('background-image', li.childcontent.getStyle('background-image'));
				if (li.childcontent.getStyle('background-repeat')) bg.setStyle ('background-repeat', li.childcontent.getStyle('background-repeat'));
				if (li.childcontent.getStyle('background-color')) bg.setStyle ('background-color', li.childcontent.getStyle('background-color'));
				li.childcontent.setStyle ('background', 'none');
				li.childcontent_inner.setStyles ({'position':'relative', 'z-index': 2});
			}
			
			if (li.childcontent && (this.options.slide || this.options.fading)) {
				//li.childcontent.setStyles ({'width': li._w});
				li.childcontent.setStyles ({'left':'auto'});
				if (li.childcontent.hasClass ('right')) li.childcontent.setStyle ('right', 0);
				if (this.options.slide) {
					li.childcontent.setStyles ({'left':'auto', 'overflow':'hidden'});
					if (li.level0) {
						if (this.options.direction == 'up') {
							li.childcontent_inner.setStyle ('bottom', -li._h-20);
						} else {
							li.childcontent_inner.setStyle ('margin-top', -li._h-20);
						}
						
					} else {					
						li.childcontent_inner.setStyle ('margin-left', -li._w-20);
					}
				}
				if (this.options.fading) {
					li.childcontent_inner.setStyle ('opacity', 0);
				}
				//Init Fx.Styles for childcontent
				li.fx = new Fx.Styles(li.childcontent_inner, {duration: this.options.duration, transition: Fx.Transitions.linear, onComplete: this.itemAnimDone.bind(this, li)});
				//effect
				li.eff_on = {};
				li.eff_off = {};
				if (this.options.slide) {
					if (li.level0) {
						if (this.options.direction == 'up') {
							li.eff_on ['bottom'] = 0;
							li.eff_off ['bottom'] = -li._h;
						} else {
							li.eff_on ['margin-top'] = 0;
							li.eff_off ['margin-top'] = -li._h;
						}
					} else {						
						li.eff_on['margin-left'] = 0;
						li.eff_off['margin-left'] = -li._w;
					}
				}
				if (this.options.fading) {
					li.eff_on['opacity'] = 1;
					li.eff_off['opacity'] = 0;
					//li.eff_off['margin-top'] = -li._h;
				}
			}
			
			if (this.options.action=='click' && li.childcontent) {
				li.addEvent('click', function(e) {
					var event = new Event (e);
					if (li.hasClass ('group')) return;
					if (li.childcontent) {
						if (li.status == 'open') {
							if (this.cursorIn (li, event)) {
								this.itemHide (li);
							} else {
								this.itemHideOthers(li);
							}
						} else {
							this.itemShow (li);
						}
					} else {
						if (li.a) location.href = li.a.href;
					}
					event.stopPropagation();
				}.bind (this));		
			}

			if (this.options.action == 'mouseover' || this.options.action == 'mouseenter') {
				li.addEvent('mouseenter', function(e) {
					if (li.hasClass ('group')) return;
					$clear (li.timer);
					this.itemShow (li);
					e.stopPropagation();
				}.bind (this));
				
				li.addEvent('mouseleave', function(e) {
					if (li.hasClass ('group')) return;
					$clear (li.timer);
					if (li.childcontent) li.timer = this.itemHide.delay(this.options.delayHide, this, [li, e]);
					else this.itemHide (li, e);
					if (!e.stopped) {
						e.stopPropagation();
						e.stopped = true; //make sure the stop function is call only once
					}
				}.bind (this));
				
				//if has childcontent, don't goto link before open childcontent - fix for touch screen
				if (li.a && li.childcontent) {
					li.clickable = false;
					li.a.addEvent ('click',function (e){
						if (!li.clickable) {
							new Event(e).stop();
						}
					}.bind (this));
				}
				
				//stop if click on menu item - prevent raise event to container => hide all open submenu
				li.addEvent ('click', function (e) {new Event(e).stopPropagation()});
			}
			
			//when click on a link - close all open childcontent
			if (li.a && !li.childcontent) {
				li.a.addEvent ('click',function (e){
					this.itemHideOthers (null);
					//Remove current class
					this.menu.getElements ('.active').removeClass ('active');
					//Add current class
					var p = li;
					while (p) {
						p.addClass ('active');
						p.a.addClass ('active');
						p = p._parent;
					}
					new Event (e).stopPropagation();
				}.bind (this));
			}
			
			if (li.childcontent) this.positionSubmenu (li);
		},this);
		
		//click on windows will close all submenus
		var container = $('ja-wrapper');
		if (!container) container = document.body;
		container.addEvent ('click',function (e) {
			this.itemHideOthers(null);
		}.bind(this));				

		//stop if click on menu
		this.menu.addEvent ('click', function (e) {new Event(e).stopPropagation()});
		
		
		if (this.options.slide || this.options.fading) {
			//hide all content child
			this.menu.getElements('.childcontent').setStyle ('display', 'none');
		}
		
	}, 
	
	getParent: function (li) { 
		var p = li;
		while ((p=p.getParent())) {
			if (this.items.contains (p) && !p.hasClass ('group')) return p;
			if (!p || p == this.menu) return null;
		}
	},
	
	cursorIn: function (el, event) {
		if (!el || !event) return false;
		var pos = $merge (el.getPosition(), {'w':el.offsetWidth, 'h': el.offsetHeight});;
		var cursor = {'x': event.page.x, 'y': event.page.y};
	
		if (cursor.x>pos.x && cursor.x<pos.x+el.offsetWidth
				&& cursor.y>pos.y && cursor.y<pos.y+el.offsetHeight) return true;			
		return false;
	},
	
	isChild: function (child, parent) {
		return !!parent.getChildren().contains (child);
	},
	
	itemOver: function (li) {
		if (li.hasClass ('haschild')) 
			li.removeClass ('haschild').addClass ('haschild-over');
		li.addClass ('over');
		if (li.a) {
			li.a.addClass ('over');
		}
	},
	
	itemOut: function (li) {
		if (li.hasClass ('haschild-over'))
			li.removeClass ('haschild-over').addClass ('haschild');
		li.removeClass ('over');
		if (li.a) {
			li.a.removeClass ('over');
		}
	},

	itemShow: function (li) {
		clearTimeout(li.timer);
		if (li.status == 'open') return; //don't need do anything
		//Setup the class
		this.itemOver (li);
		//push to show queue
		li.status = 'open';
		this.enableclick.delay (100, this, li);
		this.childopen.push (li);
		//hide other
		this.itemHideOthers (li);
		if (li.childcontent) {
			//reposition the submenu
			this.positionSubmenu (li);
		}
		

		if (!$defined(li.fx) || !$defined(li.childcontent)) return;
		
		li.childcontent.setStyle ('display', 'block');
		
		li.childcontent.setStyles ({'overflow': 'hidden'});		
		if (li.childcontent_inner1.ol) li.childcontent_inner1.setStyles ({'overflow': 'hidden'});
		li.fx.stop();
		li.fx.start (li.eff_on);
		//if (li._parent) this.itemShow (li._parent);
	},
	
	itemHide: function (li, e) {
		if (e && e.page) { //if event
			if (this.cursorIn (li, e) || this.cursorIn (li.childcontent, e)) {
				return;
			} //cursor in li
			var p=li._parent;
			if (p && !this.cursorIn (p, e) && !this.cursorIn(p.childcontent, e)) {
				p.fireEvent ('mouseleave', e); //fire mouseleave event
			}
		}
		clearTimeout(li.timer);
		this.itemOut(li);
		li.status = 'close';
		this.childopen.remove (li);
		
		if (!$defined(li.fx) || !$defined(li.childcontent)) return;
		
		if (li.childcontent.getStyle ('opacity') == 0) return;
		li.childcontent.setStyles ({'overflow': 'hidden'});
		if (li.childcontent_inner1.ol) li.childcontent_inner1.setStyles ({'overflow': 'hidden'});
		li.fx.stop();
		switch (this.options.hidestyle) {
		case 'fast': 
			li.fx.options.duration = 100;
			li.fx.start ($merge(li.eff_off,{'opacity':0}));
			break;
		case 'fastwhenshow': //when other show
			if (!e) { //force hide, not because of event => hide fast
				//li.fx.options.duration = 300;
				li.fx.start ($merge(li.eff_off,{'opacity':0}));
			} else {	//hide as normal
				li.fx.start (li.eff_off);
			}
			break;
		case 'normal':
		default:
			li.fx.start (li.eff_off);
			break;
		}
		//li.fx.start (li.eff_off);		
	},
	
	itemAnimDone: function (li) {
		//hide done
		if (li.status == 'close'){
			//reset duration and enable opacity if not fading
			if (this.options.hidestyle.test (/fast/)) {
				li.fx.options.duration = this.options.duration;
				if (!this.options.fading) li.childcontent_inner.setStyle ('opacity', 1);
			}
			//hide
			li.childcontent.setStyles ({'display': 'none'});
			this.disableclick.delay (100, this, li);
		}
		
		//show done
		if (li.status == 'open'){
			li.childcontent.setStyles ({'overflow': ''});
			if (li.childcontent_inner1.ol) li.childcontent_inner1.setStyles ({'overflow-y': 'auto'});
			li.childcontent_inner.setStyle ('opacity', 1);
			li.childcontent.setStyles ({'display': 'block'});
		}
	},
	
	itemHideOthers: function (el) {
		var fakeevent = null
		if (el && !el.childcontent) fakeevent = {};
		var curopen = this.childopen.copy();
		curopen.each (function(li) {
			if (li && typeof (li.status) != 'undefined' && (!el || (li != el && !li.hasChild (el)))) {
				this.itemHide(li, fakeevent);
			}
		},this);
	},

	enableclick: function (li) {
		if (li.a && li.childcontent) li.clickable = true;
	},
	disableclick: function (li) {
		if (li.a && li.childcontent) li.clickable = false;
	},
	
	positionSubmenu: function (li) {
		if (li.level0) {
			if (!window.isRTL) {
				//check position
				var lcor = li.getCoordinates();
				var ccor = li.childcontent.getCoordinates();
				if(!ccor.width)
				{
					li.childcontent.setStyle ('display', 'block');
					ccor = li.childcontent.getCoordinates();
					li.childcontent.setStyle ('display', 'none');
				}

				var ml = 0;
				var l = lcor.left;
				var r = l + ccor.width;
				if (this.wrapper) {
					var wcor = this.wrapper.getCoordinates();
					l = l - wcor.left;
					r = wcor.right - r + 10;
				} else {
					r = window.getWidth() - r + 10;
				}
				if (l < 0 || l+r < 0) {
					ml = - l;
				} else if (r < 0) {
					ml = r;
				}
				if (ml != 0) li.childcontent.setStyle ('margin-left', ml);					
			} else {
				//check position
				var lcor = li.getCoordinates();						
				var ccor = li.childcontent.getCoordinates();
				if(!ccor.width)
				{
					li.childcontent.setStyle ('display', 'block');
					ccor = li.childcontent.getCoordinates();
					li.childcontent.setStyle ('display', 'none');
				}
				var mr = 0;
				var r = lcor.right;
				var l = r - ccor.width;
				if (this.wrapper) {
					var wcor = this.wrapper.getCoordinates();
					l = l - wcor.left;
					r = wcor.right - r + 10;
				} else {
					r = window.getWidth() - r + 10;
				}
				if (r < 0 || l+r < 0) {
					mr = - r;
				} else if (l < 0) {
					mr = l;
				}
				if (mr != 0) li.childcontent.setStyle ('margin-right', mr);
			}
		} else {
			//check if it's out of view-port
			var lcor = li.getCoordinates();
			var ccor = li.childcontent.getCoordinates();
			if(!ccor.width)
			{
				li.childcontent.setStyle ('display', 'block');
				ccor = li.childcontent.getCoordinates();
				li.childcontent.setStyle ('display', 'none');
			}
			var ml = 0;
			var l = ccor.left;
			var r = l + ccor.width;
			if (this.wrapper) {
				var wcor = this.wrapper.getCoordinates();
				l = l - wcor.left;
				r = wcor.right - r + 10;
			} else {
				r = window.getWidth() - r + 10;
			}
			if (r < 0) {
				//change the direction and position for submenu
				li.childcontent.setStyle ('margin-left', -ccor.width + 20);
				if (li.eff_on) li.eff_on['margin-left'] = 0;
				if (li.eff_off) {
					li.eff_off['margin-left'] = li._w + 20;
					li.childcontent_inner.setStyle ('margin-left', li.eff_off['margin-left']);
				}
			}
		}		
	}
});


/*  */
/**
 * ------------------------------------------------------------------------
 * JA Typo plugin
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
var JATypo = new Class ({
	initialize: function(options) {
		this.options = $extend({
			offsets: {x:10, y: 10}
		}, options || {});
		
		this.overlay = new Element ('div', {'id':'jatypo-overlay'}).inject ($(document.body));
		this.overlay.setStyles ({'width':window.getScrollWidth(), 'height': window.getScrollHeight()});
		this.wrapper = $('jatypo-wrap');		
		if (!this.wrapper) return;		
		if (this.isBrowserIE()) {
			this.button = new Element ('div', {'class':'button2-left jatypo-btn'}).adopt(new Element ('div', {'class':'blank'}).setHTML('<a href="#" onclick="IeCursorFix(); return false;"><span>JATypo</span></a>')).injectBefore($('editor-xtd-buttons'));
		}
		else
		{
			this.button = new Element ('div', {'class':'button2-left jatypo-btn'}).adopt(new Element ('div', {'class':'blank'}).setHTML('<span>JATypo</span>')).injectBefore($('editor-xtd-buttons'));
		}
		this.typos = this.wrapper.getElements ('.typo');
		this.typos.addEvents ({
			'mouseenter': function (){
				this.addClass ('typo-over');
				//detect popup position
				var wrapper = $('jatypo-wrap');
				var sample = this.getElement ('.sample');
				var pos_s = findPos (sample);
				var pos_w = findPos (wrapper);
				var scroll_w = {x: wrapper.scrollLeft, y: wrapper.scrollTop};
				
				var x0 = pos_w.x + scroll_w.x;
				var y0 = pos_w.y + scroll_w.y;
				var w0 = wrapper.offsetWidth;
				var h0 = wrapper.offsetHeight;
				var x1 = pos_s.x;
				var y1 = pos_s.y;
				var w1 = sample.offsetWidth;
				var h1 = sample.offsetHeight;
				
				//Detect class need to add to ajdust the position of sample popup
				if (y1<y0) {this.addClass ('typo-top').removeClass ('typo-bottom')}
				if (y1+h1>y0+h0) {this.addClass ('typo-bottom').removeClass ('typo-top')}
				if (x1<x0) {this.addClass ('typo-left').removeClass ('typo-right')}
				if (x1+w1>x0+w0) {this.addClass ('typo-right').removeClass ('typo-left')}
				
			},
			'mouseleave': function (){this.removeClass ('typo-over');},
			'click': function (){
				var sample = this.getElement ('.sample');
				var html = sample.innerHTML;
				if ($('content')) {
					jInsertEditorText(html, 'content');
				}
				else {
					jInsertEditorText(html, 'text');	
				}
				$('jatypo-wrap').setStyle ('display', 'none');
			}
		});
		this.wrapper.remove().injectAfter (this.overlay);
		this.button.addEvent ('click', function (event) {
			event = new Event(event);
			//this.locate (event);
			this.position();
			event.stop();
		}.bind (this));
		this.overlay.addEvent ('click', function () {this.wrapper.setStyle ('display', 'none');this.overlay.setStyle ('display', 'none');}.bind(this));
		
		//Typo css into editor (tinymce)
		var doc = $('text_ifr')?($('text_ifr').contentWindow?$('text_ifr').contentWindow.document:$('text_ifr').contentDocument):null;
		if (doc) {
			var head = doc.getElementsByTagName('head')[0];
			var css = doc.createElement ('link');
			css.rel = 'stylesheet';
			css.type = 'text/css';
			css.href = this.options.typocss;
			head.appendChild (css);		
		}		
	},
	
	locate: function(event){
		var win = {'x': window.getWidth(), 'y': window.getHeight()};
		var scroll = {'x': window.getScrollLeft(), 'y': window.getScrollTop()};
		var pwin = {'x': this.wrapper.offsetWidth, 'y': this.wrapper.offsetHeight};
		var prop = {'x': 'left', 'y': 'top'};
		for (var z in prop){
			var pos = event.page[z] + this.options.offsets[z];
			if ((pos + pwin[z] - scroll[z]) > win[z]) pos = event.page[z] - this.options.offsets[z] - pwin[z];
			this.wrapper.setStyle(prop[z], pos);
		};
		
		this.wrapper.setStyle ('display', 'block');
		this.overlay.setStyle ('display', 'block');
	}, 
	
	position: function () {
		this.wrapper.setStyle ('display', 'block');
		this.overlay.setStyle ('display', 'block');
		var pos = this.button.getPosition();
		var scroll = {'x': window.getScrollLeft(), 'y': window.getScrollTop()};
		var pwin = {'x': this.wrapper.offsetWidth, 'y': this.wrapper.offsetHeight};
		this.wrapper.setStyles({
			'left': pos.x + this.options.offsets.x,
			'top': pos.y + this.options.offsets.y - pwin.y
		});
	},
	
	isBrowserIE: function() {
		return navigator.appName=="Microsoft Internet Explorer";
	}
	
});

function findPos (obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}

	return {x:curleft,y:curtop};
}


/*  */
/**
* @version		$Id: caption.js 5263 2006-10-02 01:25:24Z webImagery $
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

/**
* JCaption javascript behavior
*
* Used for displaying image captions
*
* @package	Joomla
* @since	1.5
* @version	1.0
*/
var JCaption = new Class({
	initialize: function(selector)
	{
		this.selector = selector;

		var images = $$(selector);
		images.each(function(image){ this.createCaption(image); }, this);
	},

	createCaption: function(element)
	{
		var caption   = document.createTextNode(element.title);
		var container = document.createElement("div");
		var text      = document.createElement("p");
		var width     = element.getAttribute("width");
		var align     = element.getAttribute("align");

		if(!width) {
			width = element.width;
		}

		//Windows fix
		if (!align)
			align = element.getStyle("float");  // Rest of the world fix
		if (!align) // IE DOM Fix
			align = element.style.styleFloat;

		if (align=="") {
			align="none";
		}

		text.appendChild(caption);
		text.className = this.selector.replace('.', '_');

		element.parentNode.insertBefore(container, element);
		container.appendChild(element);
		if ( element.title != "" ) {
			container.appendChild(text);
		}
		container.className   = this.selector.replace('.', '_');
		container.className   = container.className + " " + align;
		container.setAttribute("style","float:"+align);

		container.style.width = width + "px";

	}
});

document.caption = null;
window.addEvent('load', function() {
	var caption = new JCaption('img.caption')
	document.caption = caption
});


/*  */
/**
 * ------------------------------------------------------------------------
 * JA Tabs Plugins for Joomla 1.5
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
var wrap_W = 0;
var JATabs = new Class({	
	initialize: function(element, options) {
		this.options = $extend({
			position:			'top',
			width:				'100%',
			height:				'auto',
			skipAnim:			false,
			animType:			'animMoveHor',
			mouseType:			'mouseover',
			changeTransition:	Fx.Transitions.Pow.easeIn,
			duration:			1000,
			mouseOverClass:		'hover',
			activateOnLoad:		'first',
			useAjax: 			false,
			ajaxUrl: 			'',
			ajaxOptions: 		'get',
			ajaxLoadingText: 	'Loading...',
			fixheight :			 1,
			fixwidth :			 1,
			colors: ''
		}, options || {});

		this.el = $(element);
		this.elid = element;				
				
		this._W = this.el.offsetWidth.toInt();
		wrap_W = this._W;
		
		if(this.options.height=='auto'){
			this.options.fixheight = 0;
		}
		//tab colors
		if($type(this.options.colors)=='string'){
			regex = /(\d*):([^,]*)/gi;
			var colors = [];
			while((result = regex.exec (this.options.colors)))
				colors[result[1]]=result[2];
			
			this.options.colors = colors;
		}
		
		//this._H = this.el.getParent().getStyle('height').toInt();
		this._H = this.el.getParent().offsetHeight.toInt();		
		this.panels = $$('#' + this.elid + ' .ja-tab-content');
		this.panelwrap = this.el.getElement('.ja-tab-panels-'+this.options.position);	
				
		this.divtitles = $$('#' + this.elid + ' .ja-tabs-title-'+this.options.position);
		
		this.titles = $$('#' + this.elid + ' div.ja-tabs-title-'+this.options.position+' ul li');		
		
		this.boxTab_H = this.el.getElement('ul.ja-tabs-title').offsetHeight + this.el.getElement('ul.ja-tabs-title').offsetTop;
		
		//add 
		if (this.panels.length <= 1)
		{
			this.panels.setStyle ('position', 'relative');
			return;
		}	
		
		this.titles.each(function(item,i) {
			var color = item.getElement('h3').className;
			if (!color) color=this.options.colors[i];
			item._color = '';
			if (color) {
				item.addClass (color);
				item._color = color;
			}
			
			item.addEvent(this.options.mouseType, function(){
					if (item.className.indexOf('active') != -1)	return;
					
					item.removeClass(this.options.mouseOverClass);
					this.activate(item,  this.options.skipAnim);						
				}.bind(this)
			);
			
			item.addEvent('mouseover', function() {
				if(item != this.activeTitle)
				{
					item.addClass(this.options.mouseOverClass);
				}
			}.bind(this));
			
			item.addEvent('mouseout', function() {
				if(item != this.activeTitle)
				{
					item.removeClass(this.options.mouseOverClass);
					
				}
			}.bind(this));
		}.bind(this));
		

		this.titles[0].addClass('first');
		this.titles[this.titles.length-1].addClass('last');		
		this.titles[0].addClass ('active');
		
		//height of title (for left, right, bottom)
		//this.tabHeight = $E('.ja-tabs-title-'+this.options.position, this.el);
		this.tabHeight = this.el.getElement('.ja-tabs-title-'+this.options.position);
		
		//Panel contents
		this.minHeight = 0;
		/*if((this.options.position=='left') || (this.options.position=='right')){
			
	      	this.minHeight = this.tabHeight.offsetHeight;
		    if (!this.options.fixheight ){
				this.divtitles.setStyle ('height', this.minHeight);														
			}							
	    }	*/	
     
		/* Set height for DIV tabswrap and position Top*/						
		if (!this.options.fixheight )
		{			
			this.panelwrap.setStyle ('height', this.minHeight);
		}	
		else if((this.options.position!='left') && (this.options.position!='right')){
			this.panelwrap.setStyle ('height', this._H - this.titles[0].offsetHeight.toInt());	
		}												

		/* Set set width for left/right tabs*/	
		if((this.options.position=='left') || (this.options.position=='right')){									
			var maxw = eval(this._W - this.divtitles[0].offsetWidth.toInt() -10);
			this.panelwrap.setStyle ('width', maxw);
		}		
				
		this.titles.each(function(el,i){
			el.panel = this.panels[i];
			el.panel._idx = i;
		},this);		
				
		if (this.options.skipAnim) this.options.animType = 'animNone';
		
		//Set default type for animation if needed
		if ((eval('typeof '+this.options.animType) == 'undefined') || (eval('$type ('+this.options.animType+')') != 'class')){
			this.options.animType = 'animFade';
		}
		
		//Create animation object
		this.anim = eval ('new '+this.options.animType + '(this)');

		if(this.options.activateOnLoad != 'none')
		{
			if(this.options.activateOnLoad == 'first')
			{
				this.activate(this.titles[0],  true);				
			}
			else
			{
				this.activate(this.options.activateOnLoad, true);	
			}			
		}		
				
		if (window.ie) this.firstload = true;
		window.addEvent('resize', this.resize.bind(this));
		
	},
	
	resize: function () {
		
		/* Set set width for left/right tabs*/	
		this._W = this.el.offsetWidth;
		
		maxW = this._W;
			
    	if((this.options.position=='left') || (this.options.position=='right')){
	      	this.minHeight = this.boxTab_H;		
		    if (!this.options.fixheight ){				
				//this.divtitles.setStyle ('height', Math.max(this.boxTab_H,this.activeTitle.panel.offsetHeight+10));														
			}
			maxW = this._W - this.divtitles[0].offsetWidth.toInt() -10;	
			this.panelwrap.setStyle('width', maxW);  
	    }		
    	else{
    		this.panelwrap.setStyle('height', Math.max(this.minHeight,this.activeTitle.panel.offsetHeight+10));
    	}
		if(wrap_W!=this._W){this.anim.reposition();};
	},
	
	activate: function(tab, skipAnim){
		if($type(tab) == 'string') 
		{
			myTab = $$('#' + this.elid + ' ul li').filterByAttribute('title', '=', tab)[0];
			tab = myTab;
		} else if ($type(tab) == 'number') {
			if (tab < 0 || tab >= this.titles.length) tab = 0;
			tab = this.titles[parseInt(tab)];
		}		
		if (!tab) tab = this.titles[0];
		
	    if (this.options.useAjax) this.cancelAjax();
		 
		if (this.options.useAjax && !tab.loaded) {			
			this._getContent(tab);
			this.activeTitle = tab;
	        return;	     
	    }

		if(! $defined(skipAnim))
		{
			skipAnim = false;
		}
		
		if($type(tab) == 'element')
		{
			//add 5
			var newTab = tab.panel;
			var curTab = this.activePanel;
			this.activePanel = newTab;
			
			this.anim.move (curTab, newTab, skipAnim);
			
			this.titles.removeClass('active');
			tab.addClass('active');
			if (this.activeTitle && this.activeTitle._color) this.panelwrap.removeClass (this.activeTitle._color);
			if (tab._color) this.panelwrap.addClass (tab._color);
			
			this.activeTitle = tab;
			
			if (!this.options.fixheight) {
				if (skipAnim) {
					this.panelwrap.setStyle('height', Math.max(this.minHeight, this.activePanel.offsetHeight+10));
					if((this.options.position=='left') || (this.options.position=='right')){
						this.tabHeight.setStyle('height', Math.max(this.minHeight, this.panelwrap.offsetHeight, this.boxTab_H));
					}
				} else {
					if (!this.mainfx) this.mainfx = new Fx.Style(this.panelwrap, 'height',{duration:this.options.duration});
					//this.mainfx.start(this.panelwrap.offsetHeight, Math.max(this.minHeight,this.activeTitle.panel.offsetHeight+10));
					this.mainfx.stop();
					this.mainfx.start(Math.max(this.minHeight,this.activePanel.offsetHeight));
	
					if((this.options.position=='left') || (this.options.position=='right')){
						if(!this.changeEffectTitle) this.changeEffectTitle = new Fx.Style(this.tabHeight, 'height', {duration: this.options.duration});						
						this.changeEffectTitle.start(Math.max(this.activePanel.offsetHeight, this.boxTab_H));
					}
				}
			}
			else{
				this.panelwrap.setStyle('height', this.options.height);
				if((this.options.position=='left') || (this.options.position=='right')){
					this.tabHeight.setStyle('height', this.options.height+10);
				}
			}
		}	
		
	},
	cancelAjax: function() {
	  if (this.loadingTab) {
	    	this.tabRequest.cancel();
	      	this.loadingTab.imgLoading.remove();
	  		this.tabRequest = null;
	  		this.loadingTab = null;
	    }
  	},
	
	_getContent: function(tab){
	  
		this.loadingTab = tab;
		var ids = this.options.ids.split(',');
		
		if(!ids.length || ids[tab.panel._idx]==undefined) return '';
		
		var h3 = $(this.loadingTab.getElementsByTagName('H3')[0]);
		var imgloading = new Element('img', {'src': 'plugins/content/ja_tabs/loading.gif','width': 13});
		if (this.options.position=='right') imgloading.inject(h3,'top');
		else imgloading.inject(h3);
		this.loadingTab.imgLoading = imgloading;
		this.tabRequest = new Ajax(this.options.ajaxUrl+ '&tab=' + ids[tab.panel._idx], {method:this.options.ajaxOptions,onComplete:this.update.bind(this)});
		this.tabRequest.request();
		
	},
	update: function (text) {
		if (!this.loadingTab) return;
		this.loadingTab.panel.subpanel = this.loadingTab.panel.getElement('.ja-tab-subcontent');
		this.loadingTab.panel.subpanel.innerHTML = text;
		this.evalScript(text);		
		this.loadingTab.loaded = true;
		this.tabRequest = null;
		var tab = this.loadingTab;
		this.loadingTab = null;	
		
		var images = tab.panel.subpanel.getElements ('img');
		
		tab.switched = false;
		/**/
		if (images && images.length && !tab.imgLoaded) {
			var imgs = [];
			images.each (function (image) {imgs.push(image.src)});
			if (imgs.length) {
				new Asset.images(imgs, {		
					onComplete: function(){
						this.switchTab(tab);
					}.bind(this)
					
				});					
				
				tab.imgLoaded = true;
				
				//call this start if cannot load image after sometime
				//this.switchTab.delay (3000, this, tab);    
				return ;
			}
		}
		this.switchTab.delay(1000, this, tab);
	},
	
	evalScript: function (scripts)
	{	try
		{	if(scripts != '')	
			{	var script = "";
				scripts = scripts.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
										 if (scripts !== null) script += arguments[1] + '\n';
											return '';});
				if(script) (window.execScript) ? window.execScript(script) : window.setTimeout(script, 0);
			}
			return false;
		}
		catch(e)
		{	alert(e)
		}
	},	
	switchTab: function (tab) {
		if (tab.switched) return;
		tab.switched = true;
		tab.imgLoading.remove();
		
		this.anim.reposition();
		this.activate (tab);			
	}
});
var animNone = new Class ({
	initialize: function(tabwrap) {
		this.options = tabwrap.options || {};
		this.tabwrap = tabwrap;

		this.tabwrap.panels.setStyle('position', 'absolute');
		this.tabwrap.panels.setStyle('left', 0);
	},

	move: function (curTab, newTab, skipAnim) {
		this.tabwrap.panels.setStyle('display', 'none');
		newTab.setStyle('display', 'block');
	},
	
	reposition: function() {
		
	}
});

var animFade = new Class ({
	initialize: function(tabwrap) {
		this.options = tabwrap.options || {};
		this.tabwrap = tabwrap;
		this.changeEffect = new Fx.Elements(this.tabwrap.panels, {duration: this.options.duration});
		this.tabwrap.panels.setStyles({'opacity':0,'width':'100%'});
	},

	move: function (curTab, newTab, skipAnim) {
		if(this.options.changeTransition != 'none' && skipAnim==false)
		{
			if (curTab)
			{
				curOpac = curTab.getStyle('opacity');
				var changeEffect = new Fx.Style(curTab, 'opacity', {duration: this.options.duration, transition: this.options.changeTransition});
				changeEffect.stop();
				changeEffect.start(curOpac,0);
			}
			curOpac = newTab.getStyle('opacity');
			var changeEffect = new Fx.Style(newTab, 'opacity', {duration: this.options.duration, transition: this.options.changeTransition});
			changeEffect.stop();
			changeEffect.start(curOpac,1);
		} else {
			if (curTab) curTab.setStyle('opacity', 0);
			newTab.setStyle('opacity', 1);
		}
	},
	reposition: function() {
	    if (this.tabwrap.activePanel) {
			this.changeEffect.stop();

			for (var i=this.tabwrap.activePanel._idx-1;i>=0;i--) {
			    this.tabwrap.panels[i].setStyle('opacity',0);
			}
		    for (i=this.tabwrap.activePanel._idx+1;i<this.tabwrap.panels.length;i++) {
		       this.tabwrap.panels[i].setStyle('opacity',0);
		     }		     		   
	    }
	}
});

var animMoveHor = new Class ({
	initialize: function(tabwrap) {
		this.options = tabwrap.options || {};
		this.tabwrap = tabwrap;
		this.changeEffect = new Fx.Elements(this.tabwrap.panels, {duration: this.options.duration});
	    var left = 0;
	    this.tabwrap.panels.each (function (panel) {
	      panel.setStyle('left', left);
	      left += panel.offsetWidth;
	    });
	    this.tabwrap.panels.setStyle('top', 0);
	},

	move: function (curTab, newTab, skipAnim) {
		if(this.options.changeTransition != 'none' && !skipAnim)
		{
			this.changeEffect.stop();
			var obj = {};
			var offset = newTab.offsetLeft.toInt();
			i=0;			
			
			this.tabwrap.panels.each(function(panel) {
				obj[i++] = {'left':[panel.offsetLeft.toInt(), panel.offsetLeft.toInt() - offset] };			
			});
			
			this.changeEffect.start(obj);
		}
	},
	reposition: function() {
	    if (this.tabwrap.activePanel) {
			this.changeEffect.stop();
	       	var left = this.tabwrap.activePanel.offsetLeft;
		    for (var i=this.tabwrap.activePanel._idx-1;i>=0;i--) {
		       left -= this.tabwrap.panels[i].offsetWidth;
		       this.tabwrap.panels[i].setStyle('left',left);
		     }
	       	var left = this.tabwrap.activePanel.offsetLeft;
		    for (i=this.tabwrap.activePanel._idx+1;i<this.tabwrap.panels.length;i++) {
		       left += this.tabwrap.panels[i-1].offsetWidth;
		       this.tabwrap.panels[i].setStyle('left',left);
		     }
	    }
	}
});

var animMoveVir = new Class ({
	initialize: function(tabwrap) {
		this.options = tabwrap.options || {};
		this.tabwrap = tabwrap;
		this.changeEffect = new Fx.Elements(this.tabwrap.panels, {duration: this.options.duration});
	
	    var top = 0;
	    this.tabwrap.panels.each (function (panel) {
	      panel.setStyle('top', top);     
	      top += Math.max(panel.offsetHeight,  panel.getParent().getParent().offsetHeight);
	    });
	    this.tabwrap.panels.setStyle('left', 0);
	},
	move: function (curTab, newTab, skipAnim) {
		if(this.options.changeTransition != 'none' && skipAnim==false)
		{
      //reposition newTab
      
			this.changeEffect.stop();
			var obj = {}; 
			var offset = newTab.offsetTop.toInt();
			i=0;
			this.tabwrap.panels.each(function(panel) {
				obj[i++] = {'top':[panel.offsetTop.toInt(), panel.offsetTop.toInt() - offset]};			
			});
			this.changeEffect.start(obj);
		}
	},
	reposition: function() {
	    if (this.tabwrap.activePanel) {
				 this.changeEffect.stop();
	       var top = this.tabwrap.activePanel.offsetTop;
		     for (var i=this.tabwrap.activePanel._idx-1;i>=0;i--) {
		       top -= this.tabwrap.panels[i].offsetHeight;
		       this.tabwrap.panels[i].setStyle('top',top);
		     }
	       var top = this.tabwrap.activePanel.offsetTop;
		     for (i=this.tabwrap.activePanel._idx+1;i<this.tabwrap.panels.length;i++) {
			top += this.tabwrap.panels[i-1].offsetHeight;
		     	this.tabwrap.panels[i].setStyle('top',top);
		     }
	    }
	}
});

/*  */
/**
 * JCEMediaBox 		1.1.2
 * @package 		JCEMediaBox
 * @url				http://www.joomlacontenteditor.net
 * @copyright 		Copyright (C) 2006 - 2011 Ryan Demmer. All rights reserved
 * @license 		GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html
 * @date			06 December 2011
 * This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
 (function(window){var support={};support.video=(function(){var el=document.createElement('video');var bool=false;try{if(bool=!!el.canPlayType){bool=new Boolean(bool);bool.ogg=el.canPlayType('video/ogg; codecs="theora"');var h264='video/mp4; codecs="avc1.42E01E';bool.mp4=el.canPlayType(h264+'"')||el.canPlayType(h264+', mp4a.40.2"');bool.webm=el.canPlayType('video/webm; codecs="vp8, vorbis"')}}catch(e){}return bool})();support.audio=(function(){var el=document.createElement('audio');try{if(bool=!!el.canPlayType){bool=new Boolean(bool);bool.ogg=el.canPlayType('audio/ogg; codecs="vorbis"');bool.mp3=el.canPlayType('audio/mpeg;');bool.wav=el.canPlayType('audio/wav; codecs="1"');bool.m4a=el.canPlayType('audio/x-m4a;')||el.canPlayType('audio/aac;');bool.webm=el.canPlayType('audio/webm; codecs="vp8, vorbis"')}}catch(e){}return bool})();window.JCEMediaBox={options:{popup:{width:'',height:'',legacy:0,lightbox:0,shadowbox:0,overlay:1,overlayopacity:0.8,overlaycolor:'#000000',resize:0,icons:1,fadespeed:500,scalespeed:500,hideobjects:1,scrolling:'fixed',close:2,labels:{'close':'Close','next':'Next','previous':'Previous','numbers':'{$current} of {$total}','cancel':'Cancel'}},tooltip:{speed:150,offsets:{x:16,y:16},position:'br',opacity:0.8,background:'#000000',color:'#ffffff'},base:'/',pngfix:false,pngfixclass:'',theme:'standard',imgpath:'plugins/system/jcemediabox/img'},init:function(options){this.extend(this.options,options);if(this.isIE6)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};this.ready()},ready:function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);return JCEMediaBox._init()},false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);return JCEMediaBox._init()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(JCEMediaBox.domLoaded)return;try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}return JCEMediaBox._init()})()}}JCEMediaBox.Event.add(window,"load",function(){return JCEMediaBox._init()})},getSite:function(){var base=this.options.base;if(base){var site=document.location.href;var parts=site.split(':\/\/');var port=parts[0];var url=parts[1];if(url.indexOf(base)!=-1){url=url.substr(0,url.indexOf(base))}else{url=url.substr(0,url.indexOf('/'))||url}return port+'://'+url+base}return null},_init:function(){if(this.domLoaded)return;this.domLoaded=true;var t=this,na=navigator,ua=na.userAgent;t.isOpera=window.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName)&&!!window.ActiveXObject;t.isIE6=t.isIE&&/MSIE [56]/.test(ua)&&!window.XMLHttpRequest;t.isIE7=t.isIE&&/MSIE [7]/.test(ua)&&!!window.XMLHttpRequest&&!document.querySelector;t.isIDevice=/(iPad|iPhone)/.test(ua);this.site=this.getSite();if(!this.site)return false;this.Popup.init();this.ToolTip.init()},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(o.length!==undefined){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0}}}return 1},extend:function(o,e){var t=JCEMediaBox,i,l,a=arguments;for(i=1,l=a.length;i<l;i++){e=a[i];t.each(e,function(v,n){if(v!==undefined)o[n]=v})}return o},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'')},DOM:{get:function(s){if(typeof(s)=='string')return document.getElementById(s);return s},select:function(o,p){var t=this,r=[],s,parts,at,tag,cl,each=JCEMediaBox.each;p=p||document;if(o=='*'){return p.getElementsByTagName(o)}if(p.querySelectorAll){return p.querySelectorAll(o)}function inArray(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return true}}return false}s=o.split(',');each(s,function(selectors){parts=JCEMediaBox.trim(selectors).split('.');tag=parts[0]||'*';cl=parts[1]||'';if(/\[(.*?)\]/.test(tag)){tag=tag.replace(/(.*?)\[(.*?)\]/,function(a,b,c){at=c;return b})}var elements=p.getElementsByTagName(tag);if(cl||at){each(elements,function(el){if(cl){if(t.hasClass(el,cl)){if(!inArray(r,el)){r.push(el)}}}if(at){if(el.getAttribute(at)){if(!inArray(r,el)){r.push(el)}}}})}else{r=elements}});return r},hasClass:function(el,c){return new RegExp(c).test(el.className)},addClass:function(el,c){if(!this.hasClass(el,c)){el.className=JCEMediaBox.trim(el.className+' '+c)}},removeClass:function(el,c){if(this.hasClass(el,c)){var s=el.className;var re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");var v=s.replace(re,' ');v=v.replace(/^\s|\s$/g,'');el.className=v}},show:function(el){el.style.display='block'},hide:function(el){el.style.display='none'},remove:function(el,attrib){if(attrib){el.removeAttribute(attrib)}else{var p=el.parentNode||document.body;p.removeChild(el)}},style:function(n,na,v){var isIE=JCEMediaBox.isIE,r,s;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase()});s=n.style;if(typeof v=='undefined'){if(na=='float')na=isIE?'styleFloat':'cssFloat';r=s[na];if(document.defaultView&&!r){if(/float/i.test(na))na='float';na=na.replace(/[A-Z]/g,function(a){return'-'+a}).toLowerCase();try{r=document.defaultView.getComputedStyle(n,null).getPropertyValue(na)}catch(e){}}if(n.currentStyle&&!r)r=n.currentStyle[na];return r}else{switch(na){case'opacity':v=parseFloat(v);if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block'}s[na]=v;break;case'float':na=isIE?'styleFloat':'cssFloat';break;default:if(v&&/(margin|padding|width|height|top|bottom|left|right)/.test(na)){v=/^[\-0-9\.]+$/.test(v)?v+'px':v}break}s[na]=v}},styles:function(el,props){var t=this;JCEMediaBox.each(props,function(v,s){return t.style(el,s,v)})},attribute:function(el,s,v){if(typeof v=='undefined'){if(s=='class'){return el.className}v=el.getAttribute(s);if(/^on/.test(s)){v=v.toString();v=v.replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1')}if(s=='hspace'&&v==-1){v=''}return v}if(v===''){el.removeAttribute(s)}switch(s){case'style':if(typeof v=='object'){this.styles(el,v)}else{el.style.cssText=v}break;case'class':el.className=v||'';break;default:el.setAttribute(s,v);break}},attributes:function(el,attribs){var t=this;JCEMediaBox.each(attribs,function(v,s){t.attribute(el,s,v)})},create:function(el,attribs,html){var o=document.createElement(el);this.attributes(o,attribs);if(typeof html!='undefined'){o.innerHTML=html}return o},add:function(n,o,a,h){if(typeof o=='string'){a=a||{};o=this.create(o,a,h)}n.appendChild(o);return o},addBefore:function(n,o,c){if(typeof c=='undefined'){c=n.firstChild}n.insertBefore(o,c)},png:function(el){var s;if(el.nodeName=='IMG'){s=el.src;if(/\.png$/i.test(s)){this.attribute(el,'src',JCEMediaBox.site+'plugins/system/jcemediabox/img/blank.gif');this.style(el,'filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+s+"')")}}else{s=this.style(el,'background-image');if(/\.png/i.test(s)){var bg=/url\("(.*)"\)/.exec(s)[1];this.styles(el,{'background-image':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg+"', sizingMethod='image')"})}}}},Event:{events:[],add:function(o,n,f,s){var t=this;cb=function(e){if(t.disabled)return;e=e||window.event;if(e&&JCEMediaBox.isIE){if(!e.target){e.target=e.srcElement||document}if(!e.relatedTarget&&e.fromElement){e.relatedTarget=e.fromElement==e.target?e.toElement:e.fromElement}JCEMediaBox.extend(e,{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}})}if(e&&JCEMediaBox.isWebKit){if(e.target.nodeType==3){e.target=e.target.parentNode}}if(!s)return f(e);return f.call(s,e)};function _add(o,n,f){if(o.attachEvent){o.attachEvent('on'+n,f)}else if(o.addEventListener){o.addEventListener(n,f,false)}else{o['on'+n]=f}}t.events.push({obj:o,name:n,func:f,cfunc:cb,scope:s});_add(o,n,cb)},remove:function(o,n,f){var t=this,a=t.events,s=false;JCEMediaBox.each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false}});return s},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null}catch(ex){}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e)},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false},destroy:function(){var t=this;JCEMediaBox.each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null});t.events=[];t=null},addUnload:function(f,s){var t=this;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1)}if(window.detachEvent){window.detachEvent('onbeforeunload',fakeUnload);window.detachEvent('onunload',unload)}else if(window.removeEventListener)window.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=0;if(window.CollectGarbage)CollectGarbage()}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);if(unload)unload();d=0};if(d)d.attachEvent('onstop',stop);window.setTimeout(function(){if(d)d.detachEvent('onstop',stop)},0)}};if(window.attachEvent){window.attachEvent('onunload',unload);window.attachEvent('onbeforeunload',fakeUnload)}else if(window.addEventListener)window.addEventListener('unload',unload,false);t.unloads=[f]}else t.unloads.push(f);return f},removeUnload:function(f){var u=this.unloads,r=null;JCEMediaBox.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false}});return r}},Dimensions:{getWidth:function(){return document.documentElement.clientWidth||document.body.clientWidth||window.innerWidth||0},getHeight:function(){return document.documentElement.clientHeight||document.body.clientHeight||window.innerHeight||0},getScrollHeight:function(){return document.documentElement.scrollHeight||document.body.scrollHeight||0},getScrollWidth:function(){return document.documentElement.scrollWidth||document.body.scrollWidth||0},getScrollTop:function(){return document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0},getScrollbarWidth:function(){var DOM=JCEMediaBox.DOM;if(this.scrollbarWidth){return this.scrollbarWidth}var outer=DOM.add(document.body,'div',{'style':{position:'absolute',visibility:'hidden',width:200,height:200,border:0,margin:0,padding:0,overflow:'hidden'}});var inner=DOM.add(outer,'div',{'style':{width:'100%',height:200,border:0,margin:0,padding:0}});var w1=parseInt(inner.offsetWidth);outer.style.overflow='scroll';var w2=parseInt(inner.offsetWidth);if(w1==w2){w2=parseInt(outer.clientWidth)}document.body.removeChild(outer);this.scrollbarWidth=(w1-w2);return this.scrollbarWidth},outerWidth:function(n){var v=0,x=0;x=n.offsetWidth;if(!x){JCEMediaBox.each(['padding-left','padding-right','border-left','border-right','width'],function(s){v=parseFloat(JCEMediaBox.DOM.style(n,s));v=/[0-9]/.test(v)?v:0;x=x+v})}return x},outerHeight:function(n){var v=0,x=0;x=n.offsetHeight;if(!x){JCEMediaBox.each(['padding-top','padding-bottom','border-top','border-bottom','height'],function(s){v=parseFloat(JCEMediaBox.DOM.style(n,s));v=/[0-9]/.test(v)?v:0;x=x+v})}return x}},FX:{animate:function(el,props,speed,cb){var DOM=JCEMediaBox.DOM;var options={speed:speed||100,callback:cb||function(){}};var styles={};JCEMediaBox.each(props,function(v,s){sv=parseFloat(DOM.style(el,s));styles[s]=[sv,v]});new JCEMediaBox.fx(el,options).custom(styles);return true}}};JCEMediaBox.XHR=function(options,scope){this.options={async:true,headers:{'X-Requested-With':'XMLHttpRequest','Accept':'text/javascript, text/html, application/xml, text/xml, */*'},data:null,encoding:'UTF-8',success:function(){},error:function(){}};JCEMediaBox.extend(this.options,options);this.scope=scope||this};JCEMediaBox.XHR.prototype={setTransport:function(){function get(s){x=0;try{x=new ActiveXObject(s)}catch(ex){}return x};this.transport=window.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP')},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return}this.running=false;if((this.transport.status>=200)&&(this.transport.status<300)){var s=this.transport.responseText;var x=this.transport.responseXML;this.options.success.call(this.scope,s,x)}else{this.options.error.call(this.scope,this.transport,this.options)}this.transport.onreadystatechange=function(){};this.transport=null},send:function(url){var t=this,extend=JCEMediaBox.extend;if(this.running){return this}this.running=true;this.setTransport();var method=this.options.data?'POST':'GET';if(this.options.data){var encoding=(this.options.encoding)?'; charset='+this.options.encoding:'';extend(this.options.headers,{'Content-type':'application/x-www-form-urlencoded'+encoding.toUpperCase()})}this.transport.open(method,url,this.options.async);this.transport.onreadystatechange=function(){return t.onStateChange()};for(var type in this.options.headers){try{this.transport.setRequestHeader(type,this.options.headers[type])}catch(e){}}this.transport.send(this.options.data)}},JCEMediaBox.fx=function(el,options){this.element=el;this.callback=options.callback;this.speed=options.speed;this.wait=true;this.fps=50;this.now={}};JCEMediaBox.fx.prototype={step:function(){var time=new Date().getTime();if(time<this.time+this.speed){this.cTime=time-this.time;this.setNow()}else{var t=this;this.clearTimer();this.now=this.to;setTimeout(function(){t.callback.call(t.element,t)},10)}this.increase()},setNow:function(){for(p in this.from){this.now[p]=this.compute(this.from[p],this.to[p])}},compute:function(from,to){var change=to-from;return this.transition(this.cTime,from,change,this.speed)},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this},start:function(from,to){var t=this;if(!this.wait)this.clearTimer();if(this.timer)return;this.from=from;this.to=to;this.time=new Date().getTime();this.timer=setInterval(function(){return t.step()},Math.round(1000/this.fps));return this},custom:function(o){if(this.timer&&this.wait)return;var from={};var to={};for(property in o){from[property]=o[property][0];to[property]=o[property][1]}return this.start(from,to)},increase:function(){for(var p in this.now){this.setStyle(this.element,p,this.now[p])}},transition:function(t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},setStyle:function(e,p,v){JCEMediaBox.DOM.style(e,p,v)}},JCEMediaBox.ToolTip={init:function(){var t=this;var theme=JCEMediaBox.options.theme=='custom'?JCEMediaBox.options.themecustom:JCEMediaBox.options.theme;this.tooltiptheme='';new JCEMediaBox.XHR({success:function(text,xml){var re=/<!-- THEME START -->([\s\S]*?)<!-- THEME END -->/;if(re.test(text)){text=re.exec(text)[1]}t.tooltiptheme=text;t.create()}}).send(JCEMediaBox.site+JCEMediaBox.options.themepath+'/'+theme+'/tooltip.html')},create:function(o){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;function _withinElement(el,e,fn){var p=e.relatedTarget;while(p&&p!=el){try{p=p.parentNode}catch(e){p=el}}if(p!=el){return fn.call(this)}return false}each(DOM.select('.jcetooltip, .jce_tooltip',o),function(el){el.tmpTitle=el.title;DOM.remove(el,'title');var n=el;if(el.nodeName=='IMG'&&el.parentNode.className=='jcemediabox-zoom-span'){n=el.parentNode}Event.add(n,'mouseover',function(e){_withinElement(el,e,function(){return t.start(el)})});Event.add(n,'mouseout',function(e){_withinElement(el,e,function(){return t.end(el)})});Event.add(n,'mousemove',function(e){return t.locate(e)})})},build:function(){if(!this.toolTip){var DOM=JCEMediaBox.DOM;this.toolTip=DOM.add(document.body,'div',{'style':{'opacity':0},'class':'jcemediabox-tooltip'},this.tooltiptheme);if(JCEMediaBox.isIE6){DOM.addClass(this.toolTip,'ie6')}}},start:function(el){var t=this,DOM=JCEMediaBox.DOM;if(!this.tooltiptheme)return false;this.build();var text=el.tmpTitle||'',title='';if(/::/.test(text)){var parts=text.split('::');title=JCEMediaBox.trim(parts[0]);text=JCEMediaBox.trim(parts[1])}var h='';if(title){h+='<h4>'+title+'</h4>'}if(text){h+='<p>'+text+'</p>'}var tn=DOM.get('jcemediabox-tooltip-text');if(typeof tn=='undefined'){this.toolTip.className='jcemediabox-tooltip-simple';this.toolTip.innerHTML=h}else{tn.innerHTML=h}DOM.style(t.toolTip,'visibility','visible');JCEMediaBox.FX.animate(t.toolTip,{'opacity':JCEMediaBox.options.tooltip.opacity},JCEMediaBox.options.tooltip.speed)},end:function(el){if(!this.tooltiptheme)return false;JCEMediaBox.DOM.styles(this.toolTip,{'visibility':'hidden','opacity':0})},locate:function(e){if(!this.tooltiptheme)return false;this.build();var o=JCEMediaBox.options.tooltip.offsets;var page={'x':e.pageX||e.clientX+document.documentElement.scrollLeft,'y':e.pageY||e.clientY+document.documentElement.scrollTop};var tip={'x':this.toolTip.offsetWidth,'y':this.toolTip.offsetHeight};var pos={'x':page.x+o.x,'y':page.y+o.y};var ah=0;switch(JCEMediaBox.options.tooltip.position){case'tl':pos.x=(page.x-tip.x)-o.x;pos.y=(page.y-tip.y)-(ah+o.y);break;case'tr':pos.x=page.x+o.x;pos.y=(page.y-tip.y)-(ah+o.y);break;case'tc':pos.x=(page.x-Math.round((tip.x/2)))+o.x;pos.y=(page.y-tip.y)-(ah+o.y);break;case'bl':pos.x=(page.x-tip.x)-o.x;pos.y=(page.y+Math.round((tip.y/2)))-(ah+o.y);break;case'br':pos.x=page.x+o.x;pos.y=page.y+o.y;break;case'bc':pos.x=(page.x-(tip.x/2))+o.x;pos.y=page.y+ah+o.y;break}JCEMediaBox.DOM.styles(this.toolTip,{top:pos.y,left:pos.x})},position:function(element){}},JCEMediaBox.Popup={addons:{'flash':{},'image':{},'iframe':{},'html':{}},setAddons:function(n,o){JCEMediaBox.extend(this.addons[n],o)},getAddons:function(n){if(n){return this.addons[n]}return this.addons},getAddon:function(v,n){var cp=false,r,each=JCEMediaBox.each;addons=this.getAddons(n);each(this.addons,function(o,s){each(o,function(fn){r=fn.call(this,v);if(typeof r!='undefined'){cp=r}})});return cp},cleanEvent:function(s){return s.replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1')},parseJSON:function(data){if(typeof data!=="string"||!data){return null}if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))()}},params:function(s){var a=[],x=[];if(typeof s=='string'){if(new RegExp('^{[\w\W]+}$').test(s)){return this.parseJSON(s)}if(/\w\[[^\]]+\]/.test(s)){s=s.replace(/([\w]+)\[([^\]]+)\](;)?/g,function(a,b,c,d){return'"'+b+'":"'+c+'"'+(d?',':'')});return this.parseJSON('{'+s+'}')}if(s.indexOf('&')!=-1){x=s.split(/&(amp;)?/g)}}if(typeof s=='object'&&s instanceof Array){x=s}JCEMediaBox.each(x,function(n,i){if(n){n=n.replace(/^([^\[]+)(\[|=|:)([^\]]*)(\]?)$/,function(a,b,c,d){if(d){if(!/[^0-9]/.test(d)){return'"'+b+'":'+parseInt(d)}return'"'+b+'":"'+d+'"'}return''});if(n){a.push(n)}}});return this.parseJSON('{'+a.join(',')+'}')},getCookie:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null}else{b+=2}e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e))},setCookie:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"")},convertLegacy:function(){var self=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(DOM.select('a[href]'),function(el){if(/com_jce/.test(el.href)){var p,s;var oc=DOM.attribute(el,'onclick');s=oc.replace(/&#39;/g,"'").split("'");p=self.params(s[1]);var img=p.img||'';var title=p.title||'';if(img){if(!/http:\/\//.test(img)){if(img.charAt(0)=='/'){img=img.substr(1)}img=JCEMediaBox.site.replace(/http:\/\/([^\/]+)/,'')+img}DOM.attributes(el,{'href':img,'title':title.replace(/_/,' '),'onclick':''});DOM.addClass(el,'jcepopup')}}})},convertLightbox:function(){var each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(DOM.select('a[rel*=lightbox]'),function(el){DOM.addClass(el,'jcepopup');r=el.rel.replace(/lightbox\[?([^\]]*)\]?/,function(a,b){if(b){return'group['+b+']'}return''});DOM.attribute(el,'rel',r)})},convertShadowbox:function(){var each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(DOM.select('a[rel*=shadowbox]'),function(el){DOM.addClass(el,'jcepopup');r=el.rel.replace(/shadowbox\[?([^\]]*)\]?/,function(a,b){var attribs='',group='';if(b){group='group['+b+']'}if(/;=/.test(a)){attribs=a.replace(/=([^;"]+)/g,function(x,z){return'['+z+']'})}if(group&&attribs){return group+';'+attribs}return group||attribs||''});DOM.attribute(el,'rel',r)})},translate:function(s){if(!s){s=this.popup.theme}s=s.replace(/\{#(\w+?)\}/g,function(a,b){return JCEMediaBox.options.popup.labels[b]});return s},styles:function(o){var x=[];if(!o)return{};JCEMediaBox.each(o.split(';'),function(s,i){s=s.replace(/(.*):(.*)/,function(a,b,c){return'"'+b+'":"'+c+'"'});x.push(s)});return this.parseJSON('{'+x.join(',')+'}')},getType:function(el){var o={},type='';if(/(director|windowsmedia|mplayer|quicktime|real|divx|flash|pdf)/.test(el.type)){type=/(director|windowsmedia|mplayer|quicktime|real|divx|flash|pdf)/.exec(el.type)[1]}o=this.getAddon(el.src);if(o&&o.type){type=o.type}return type||el.type||'iframe'},mediatype:function(c){var ci,cb,mt;c=/(director|windowsmedia|mplayer|quicktime|real|divx|flash|pdf)/.exec(c);switch(c[1]){case'director':case'application/x-director':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'windowsmedia':case'mplayer':case'application/x-mplayer2':ci='6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'quicktime':case'video/quicktime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'real':case'realaudio':case'audio/x-pn-realaudio-plugin':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='';mt='audio/x-pn-realaudio-plugin';break;case'divx':case'video/divx':ci='67dabfbf-d0ab-41fa-9c46-cc0f21721616';cb='http://go.divx.com/plugin/DivXBrowserPlugin.cab';mt='video/divx';break;case'pdf':case'application/pdf':ci='ca8a9780-280d-11cf-a24d-444553540000';cb='';mt='application/pdf';break;default:case'flash':case'application/x-shockwave-flash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0';mt='application/x-shockwave-flash';break}return{'classid':ci,'codebase':cb,'mediatype':mt}},islocal:function(s){if(/^(\w+):\/\//.test(s)){return new RegExp('^('+JCEMediaBox.site+')').test(s)}else{return true}},frameWidth:function(){var w=0,el=this.frame;JCEMediaBox.each(['left','right'],function(s){w=w+parseFloat(JCEMediaBox.DOM.style(el,'padding-'+s))});return parseFloat(this.frame.clientWidth-w)},frameHeight:function(){var h=0,el=this.frame,DIM=JCEMediaBox.Dimensions;JCEMediaBox.each(['top','bottom'],function(s){h=h+parseFloat(JCEMediaBox.DOM.style(el,'padding-'+s))});h=h+((JCEMediaBox.isIE6||JCEMediaBox.isIE7)?DIM.getScrollbarWidth():0);return parseInt(DIM.getHeight())-h},width:function(){return this.frameWidth()-JCEMediaBox.Dimensions.getScrollbarWidth()},height:function(){var h=0,t=this,each=JCEMediaBox.each,DIM=JCEMediaBox.Dimensions;each(['top','bottom'],function(s){var el=t['info-'+s];if(el){h=h+parseInt(DIM.outerHeight(el))}});return this.frameHeight()-h},printPage:function(){return false},zoom:function(el){var DOM=JCEMediaBox.DOM,extend=JCEMediaBox.extend,each=JCEMediaBox.each;var child=el.firstChild;var zoom=DOM.create('span');if(JCEMediaBox.isIE6){DOM.addClass(el,'ie6')}if(child&&child.nodeName=='IMG'){var align=child.getAttribute('align');var vspace=child.getAttribute('vspace');var hspace=child.getAttribute('hspace');var styles={};each(['top','right','bottom','left'],function(pos){styles['margin-'+pos]=DOM.style(child,'margin-'+pos);styles['padding-'+pos]=DOM.style(child,'padding-'+pos);each(['width','style','color'],function(prop){styles['border-'+pos+'-'+prop]=DOM.style(child,'border-'+pos+'-'+prop)})});if(/\w+/.test(align)){extend(styles,{'float':/left|right/.test(align)?align:'','text-align':/top|middle|bottom/.test(align)?align:''})}if(vspace>0){extend(styles,{'margin-top':parseInt(vspace),'margin-bottom':parseInt(vspace)})}if(hspace>0){extend(styles,{'margin-left':parseInt(hspace),'margin-right':parseInt(hspace)})}var w=child.getAttribute('width');var h=child.getAttribute('height');var ws=DOM.style(child,'width');var rh=child.height,rw=child.width;if(!w&&h){w=h/rh*rw}if(!w&&ws){if(/([0-9]+)(px)?$/.test(ws)){w=parseFloat(ws)}else{w=child.width}child.setAttribute('width',w)}extend(styles,{'float':DOM.style(child,'float'),'text-align':child.style.textAlign,'width':w});function _buildIcon(el,zoom,child,styles){var span=DOM.add(el,'span',{'class':'jcemediabox-zoom-span','style':child.style.cssText,'title':child.title||child.alt||''});DOM.styles(span,styles);DOM.add(span,child);DOM.add(span,zoom);each(['style','align','border','hspace','vspace'],function(v,i){child.removeAttribute(v)});DOM.addClass(zoom,'jcemediabox-zoom-image');if(JCEMediaBox.isIE6&&/\.png/i.test(DOM.style(zoom,'background-image'))){DOM.png(zoom)}DOM.styles(child,{'margin':0,'padding':0,'float':'none','border':'none'})}_buildIcon(el,zoom,child,styles)}else{DOM.addClass(zoom,'jcemediabox-zoom-link');if(DOM.hasClass(el,'icon-left')){DOM.addBefore(el,zoom)}else{DOM.add(el,zoom)}if(JCEMediaBox.isIE7){DOM.style(zoom,'display','inline-block')}}return zoom},auto:function(){var t=this;JCEMediaBox.each(this.popups,function(el,i){if(el.auto){if(el.auto=='single'){var cookie=t.getCookie('jcemediabox_autopopup_'+el.id);if(!cookie){t.setCookie('jcemediabox_autopopup_'+el.id,1);t.start(el)}}else if(el.auto=='multiple'){t.start(el)}}})},init:function(){window.jcepopup=this;this.create()},getPopups:function(s,p){var selector='a.jcebox, a.jcelightbox, a.jcepopup, area.jcebox, area.jcelightbox, area.jcepopup';return JCEMediaBox.DOM.select(s||selector,p)},getData:function(n){var DOM=JCEMediaBox.DOM,o={},data;var re=/\w+\[[^\]]+\]/;data=DOM.attribute(n,'data-mediabox')||DOM.attribute(n,'data-json');if(!data){var title=DOM.attribute(n,'title');var rel=DOM.attribute(n,'rel');if(re.test(title)){o=this.params(title);DOM.attribute(n,'title',o.title||'');return o}if(re.test(rel)){var args=[];rel=rel.replace(/\b((\w+)\[(.*?)\])(;?)/g,function(a,b,c){args.push(b);return''});o=this.params(args);DOM.attribute(n,'rel',rel||o.rel||'');return o}}else{n.removeAttribute('data-json');n.removeAttribute('data-mediabox');return this.params(data)}return o},process:function(el){var DOM=JCEMediaBox.DOM,data,o={},group='',auto=false;if(/(jcelightbox|jcebox)/.test(el.className)){DOM.removeClass(el,'jcelightbox');DOM.removeClass(el,'jcebox');DOM.addClass(el,'jcepopup')}if(JCEMediaBox.options.popup.icons==1&&el.nodeName=='A'&&!/(noicon|icon-none|noshow)/.test(el.className)&&el.style.display!='none'){var zoom=this.zoom(el)}if(DOM.hasClass(el,'noshow')){DOM.hide(el)}var title=el.title||'';var rel=el.rel||'';var src=el.href;src=src.replace(/b(w|h)=([0-9]+)/g,function(s,k,v){k=(k=='w')?'width':'height';return k+'='+v});data=this.getData(el)||{};if(!/\w+\[[^\]]+\]/.test(rel)){var rx='alternate|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark|nofollow|licence|tag|friend';var lb='(lightbox(\[(.*?)\])?)';var lt='(lyte(box|frame|show)(\[(.*?)\])?)';group=JCEMediaBox.trim(rel.replace(new RegExp('\s*('+rx+'|'+lb+'|'+lt+')\s*'),'','gi'))}if(el.nodeName=='AREA'){if(!data){data=this.params(src)}group=group||'AREA_ELEMENT'}if(el.id){if(/autopopup-(single|multiple)/.test(el.className)){auto=/(multiple)/.test(el.className)?'multiple':'single'}}group=group||data.group||'';JCEMediaBox.extend(o,{'src':src,'title':data.title||title,'group':DOM.hasClass(el,'nogroup')?'':group,'type':data.type||el.type||'','params':data,'id':el.id||'','auto':auto});el.href=el.href.replace(/&type=(ajax|text\/html|text\/xml)/,'');return o},create:function(elements){var t=this,each=JCEMediaBox.each,Event=JCEMediaBox.Event,pageload=false,auto=false;if(!elements){pageload=true;this.popups=[];if(JCEMediaBox.options.popup.legacy==1){t.convertLegacy()}if(JCEMediaBox.options.popup.lightbox==1){t.convertLightbox()}if(JCEMediaBox.options.popup.shadowbox==1){t.convertShadowbox()}}elements=elements||this.getPopups();each(elements,function(el,i){var o=t.process(el);t.popups.push(o);if(!pageload){i=t.popups.length-1}Event.add(el,'click',function(e){Event.cancel(e);return t.start(o,i)})});if(pageload){this.popuptheme='';var theme=JCEMediaBox.options.theme;new JCEMediaBox.XHR({success:function(text,xml){var re=/<!-- THEME START -->([\s\S]*?)<!-- THEME END -->/;if(re.test(text)){text=re.exec(text)[1]}t.popuptheme=text;if(!auto){t.auto();auto=true}}}).send(JCEMediaBox.site+'plugins/system/jcemediabox/themes/'+theme+'/popup.html')}},open:function(data,title,group,type,params){if(typeof data=='string'){data={'src':data,'title':title,'group':group,'type':type,'params':params}}return this.start(data)},start:function(p,i){var n=0,items=[],each=JCEMediaBox.each;if(this.build()){if(p.group){each(this.popups,function(o,x){if(o.group==p.group){len=items.push(o);if(i&&x==i){n=len-1}}});if(!p.auto&&typeof i=='undefined'){items.push(p);n=items.length-1}}else{items.push(p)}return this.show(items,n)}},build:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;if(!this.page){this.page=DOM.add(document.body,'div',{id:'jcemediabox-popup-page'});if(JCEMediaBox.isIE6){DOM.addClass(this.page,'ie6')}if(JCEMediaBox.isIE7){DOM.addClass(this.page,'ie7')}if(JCEMediaBox.isIDevice){DOM.addClass(this.page,'idevice')}if(JCEMediaBox.options.popup.overlay==1){this.overlay=DOM.add(this.page,'div',{id:'jcemediabox-popup-overlay',style:{'opacity':0,'background-color':JCEMediaBox.options.popup.overlaycolor}})}if(!this.popuptheme){return false}this.popuptheme=this.popuptheme.replace(/<!--(.*?)-->/g,'');this.popuptheme=this.translate(this.popuptheme);this.frame=DOM.add(this.page,'div',{id:'jcemediabox-popup-frame'},'<div id="jcemediabox-popup-body">'+this.popuptheme+'</div>');each(DOM.select('*[id]',this.frame),function(el){var s=el.id.replace('jcemediabox-popup-','');t[s]=el;DOM.hide(el)});if(JCEMediaBox.options.popup.close==2){Event.add(this.frame,'click',function(e){if(e.target&&e.target==t.frame){t.close()}})}if(this.closelink){Event.add(this.closelink,'click',function(){return t.close()})}if(this.cancellink){Event.add(this.cancellink,'click',function(){return t.close()})}if(this.next){Event.add(this.next,'click',function(){return t.nextItem()})}if(this.prev){Event.add(this.prev,'click',function(){return t.previousItem()})}if(this.numbers){this.numbers.tmpHTML=this.numbers.innerHTML}if(this.print){Event.add(this.print,'click',function(){return t.printPage()})}if(JCEMediaBox.isIE6){DOM.png(this.body);each(DOM.select('*',this.body),function(el){if(DOM.attribute(el,'id')=='jcemediabox-popup-content'){return}DOM.png(el)})}}return true},show:function(items,n){var DOM=JCEMediaBox.DOM,DIM=JCEMediaBox.Dimensions;this.items=items;this.bind(true);DOM.show(this.body);var top=(DIM.getHeight()-DIM.outerHeight(this.body))/2;DOM.style(this.body,'top',top);if(JCEMediaBox.isIE6||JCEMediaBox.isIDevice||JCEMediaBox.options.popup.scrolling=='scroll'){DOM.style(this.page,'position','absolute');DOM.style(this.overlay,'height',DIM.getScrollHeight());DOM.style(this.body,'top',DIM.getScrollTop()+top)}if(JCEMediaBox.options.popup.overlay==1&&this.overlay){DOM.show(this.overlay);JCEMediaBox.FX.animate(this.overlay,{'opacity':JCEMediaBox.options.popup.overlayopacity},JCEMediaBox.options.popup.fadespeed)}return this.change(n)},bind:function(open){var t=this,isIE6=JCEMediaBox.isIE6,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;if(isIE6){each(DOM.select('select'),function(el){if(open){el.tmpStyle=el.style.visibility||''}el.style.visibility=open?'hidden':el.tmpStyle})}if(JCEMediaBox.options.popup.hideobjects){each(DOM.select('object, embed'),function(el){if(el.id=='jcemediabox-popup-object')return;if(open){el.tmpStyle=el.style.visibility||''}el.style.visibility=open?'hidden':el.tmpStyle})}var scroll=JCEMediaBox.options.popup.scrollpopup;if(open){Event.add(document,'keydown',function(e){t.listener(e)});if(isIE6){Event.add(window,'scroll',function(e){DOM.style(t.overlay,'height',JCEMediaBox.Dimensions.getScrollHeight())});Event.add(window,'scroll',function(e){DOM.style(t.overlay,'width',JCEMediaBox.Dimensions.getScrollWidth())})}}else{if(isIE6||!scroll){Event.remove(window,'scroll');Event.remove(window,'resize')}Event.remove(document,'keydown')}},listener:function(e){switch(e.keyCode){case 27:this.close();break;case 37:this.previousItem();break;case 39:this.nextItem();break}},queue:function(n){var t=this;var changed=false;JCEMediaBox.each(['top','bottom'],function(s){var el=t['info-'+s];if(el){var v=JCEMediaBox.Dimensions.outerHeight(el);var style={};style['top']=(s=='top')?v:-v;JCEMediaBox.FX.animate(el,style,JCEMediaBox.options.popup.scalespeed,function(){if(!changed){changed=true;JCEMediaBox.FX.animate(t.content,{'opacity':0},JCEMediaBox.options.popup.fadespeed,function(){return t.change(n)})}})}})},nextItem:function(){if(this.items.length==1)return false;var n=this.index+1;if(n<0||n>=this.items.length){return false}return this.queue(n)},previousItem:function(){if(this.items.length==1)return false;var n=this.index-1;if(n<0||n>=this.items.length){return false}return this.queue(n)},info:function(){var each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event;if(this.caption){var title=this.active.caption||this.active.title||'',text='';var ex='([-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+)';var ux='((news|telnet|nttp|file|http|ftp|https)://[-!#$%&\'\*\+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'\*\+\\./0-9=?A-Z^_`a-z{|}~]+)';function processRe(h){h=h.replace(new RegExp(ex,'g'),'<a href="mailto:$1" target="_blank" title="$1">$1</a>');h=h.replace(new RegExp(ux,'g'),'<a href="$1" target="_blank" title="$1">$1</a>');return h}if(/::/.test(title)){var parts=title.split('::');title=JCEMediaBox.trim(parts[0]);text=JCEMediaBox.trim(parts[1])}var h='';if(title){h+='<h4>'+title+'</h4>'}if(text){h+='<p>'+text+'</p>'}this.caption.innerHTML=h||'&nbsp;';each(DOM.select('*',this.caption),function(el){if(el.nodeName!='A'){each(el.childNodes,function(n,i){if(n.nodeType==3){var s=n.innerText||n.textContent||n.data||null;if(s&&/(@|:\/\/)/.test(s)){if(s=processRe(s)){n.parentNode.innerHTML=s}}}})}})}var t=this,len=this.items.length;if(this.numbers&&len>1){var html=this.numbers.tmpHTML||'{$numbers}';if(/\{\$numbers\}/.test(html)){this.numbers.innerHTML='';for(var i=0;i<len;i++){var n=i+1;var link=DOM.add(this.numbers,'a',{'href':'javascript:;','title':this.items[i].title||n,'class':(this.index==i)?'active':''},n);Event.add(link,'click',function(e){var x=parseInt(e.target.innerHTML)-1;if(t.index==x){return false}return t.queue(x)})}}if(/\{\$(current|total)\}/.test(html)){this.numbers.innerHTML=html.replace('{$current}',this.index+1).replace('{$total}',len)}}else{if(this.numbers){this.numbers.innerHTML=''}}each(['top','bottom'],function(v,i){var el=t['info-'+v];if(el){DOM.show(el);each(DOM.select('*[id]',el),function(s){DOM.show(s)})}});DOM.hide(this.next);DOM.hide(this.prev);if(len>1){if(this.prev){if(this.index>0){DOM.show(this.prev)}else{DOM.hide(this.prev)}}if(this.next){if(this.index<len-1){DOM.show(this.next)}else{DOM.hide(this.next)}}}},change:function(n){var t=this,extend=JCEMediaBox.extend,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,Event=JCEMediaBox.Event,isIE=JCEMediaBox.isIE,DIM=JCEMediaBox.Dimensions;var p={},o,w,h;if(n<0||n>=this.items.length){return false}this.index=n;this.active={};DOM.show(this.container);if(this.loader){DOM.show(this.loader)}if(this.cancellink){DOM.show(this.cancellink)}if(this.object){this.object=null}this.content.innerHTML='';o=this.items[n];extend(p,this.getAddon(o.src,o.type));delete o.params.src;extend(p,o.params);var width=p.width||JCEMediaBox.options.popup.width||0;var height=p.height||JCEMediaBox.options.popup.height||0;if(/%/.test(width)){width=DIM.getWidth()*parseInt(width)/100}if(/%/.test(height)){height=DIM.getHeight()*parseInt(height)/100}extend(this.active,{'src':p.src||o.src,'title':o.title,'caption':p.caption||'','type':p.type||this.getType(o),'params':p||{},'width':width,'height':height});this.info();switch(this.active.type){case'image':case'image/jpeg':case'image/png':case'image/gif':case'image/bmp':if(this.print&&this.options.print){this.print.style.visibility='visible'}this.img=new Image();this.img.onload=function(){return t.setup()};this.img.onerror=function(){t.img.error=true;return t.setup()};this.img.src=this.active.src;if(isIE){DOM.style(this.content,'background-color',DOM.style(this.content,'background-color'))}break;case'flash':case'director':case'shockwave':case'mplayer':case'windowsmedia':case'quicktime':case'realaudio':case'real':case'divx':case'pdf':if(this.print){this.print.style.visibility='hidden'}p.src=this.active.src;var base=/:\/\//.test(p.src)?'':this.site;this.object='';w=this.width();h=this.height();var mt=this.mediatype(this.active.type);if(this.active.type=='flash'){p.wmode='transparent';p.base=base}if(/(mplayer|windowsmedia)/i.test(this.active.type)){p.baseurl=base;if(isIE){p.url=p.src;delete p.src}}delete p.title;delete p.group;p.width=this.active.width||this.width();p.height=this.active.height||this.height();var flash=/flash/i.test(this.active.type);if(flash||isIE){this.object='<object id="jcemediabox-popup-object"';if(flash&&!isIE){this.object+=' type="'+mt.mediatype+'" data="'+p.src+'"'}else{this.object+=' classid="clsid:'+mt.classid+'"';if(mt.codebase){this.object+=' codebase="'+mt.codebase+'"'}}for(n in p){if(p[n]!==''){if(/(id|name|width|height|style)$/.test(n)){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}}}this.object+='>';for(n in p){if(p[n]!==''&&!/(id|name|width|height|style|type)/.test(n)){t.object+='<param name="'+n+'" value="'+decodeURIComponent(p[n])+'" />'}}this.object+='</object>'}else{this.object='<embed type="'+mt.mediatype+'"';for(n in p){if(p[n]!==''){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}}this.object+='></embed>'}this.active.type='media';this.setup();break;case'video/x-flv':this.object='<object type="application/x-shockwave-flash" data="'+JCEMediaBox.site+'plugins/system/jcemediabox/mediaplayer/mediaplayer.swf"';var src=this.active.src;if(!/:\/\//.test(src)){src=JCEMediaBox.site+src}var map={'loop':'loop','autoplay':'autoPlay','controls':'controlBarAutoHide'};var v,flashvars=['src='+src],params={wmode:'opaque',allowfullscreen:true};for(n in p){if(p[n]!==''){if(/(id|width|height|style)$/.test(n)){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}else if(/^(wmode|allowfullscreen|play|menu|quality|scale|salign|wmode|bgcolor|base|fullScreenAspectRatio)$/i.test(n)){params[n]=p[n]}else{if(/(loop|autoplay|controls)$/.test(n)){if(map[n]){v=(n=='controls')?!p[n]:!!p[n];n=map[n]}}else{v=p[n]}flashvars.push(n+'='+v)}}}this.object+='>';this.object+='<param name="movie" value="'+JCEMediaBox.site+'plugins/system/jcemediabox/mediaplayer/mediaplayer.swf" />';this.object+='<param name="flashvars" value="'+flashvars.join('&')+'" />';for(n in params){this.object+='<param name="'+n+'" value="'+params[n]+'" />'}this.object+='</object>';this.active.type='media';this.setup();break;case'video/mp4':case'audio/mp3':case'video/webm':case'audio/webm':var type=this.active.type;var hasSupport=(type=='video/mp4'&&support.video.mp4)||(type=='video/webm'&&support.video.webm)||(type=='audio/mp3'&&support.audio.mp3)||(type=='audio/webm'&&support.audio.webm);var tag=/video/.test(type)?'video':'audio';if(hasSupport){this.object='<'+tag;for(n in p){if(p[n]!==''){if(/(loop|autoplay|controls|preload)$/.test(n)){t.object+=' '+n+'="'+n+'"'}if(/(id|width|height|style|poster|audio)$/.test(n)){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}}}this.object+='>';this.object+='<source src="'+this.active.src+'" type="'+type+'" />';this.object+='</'+tag+'>'}else{if(type=='video/mp4'||type=='audio/mp3'){this.object='<object type="application/x-shockwave-flash" data="'+JCEMediaBox.site+'plugins/system/jcemediabox/mediaplayer/mediaplayer.swf"';var src=this.active.src;if(!/:\/\//.test(src)){src=JCEMediaBox.site+src}var map={'loop':'loop','autoplay':'autoPlay','controls':'controlBarAutoHide'};var flashvars=['src='+src];for(n in p){if(p[n]!==''){if(/(loop|autoplay|controls|preload)$/.test(n)){if(map[n]){var v=(n=='controls')?!p[n]:!!p[n];flashvars.push(map[n]+'='+v)}}if(/(id|width|height|style)$/.test(n)){t.object+=' '+n+'="'+decodeURIComponent(p[n])+'"'}}}this.object+='>';this.object+='<param name="movie" value="'+JCEMediaBox.site+'plugins/system/jcemediabox/mediaplayer/mediaplayer.swf" />';this.object+='<param name="flashvars" value="'+flashvars.join('&')+'" />';this.object+='<param name="allowfullscreen" value="true" />';this.object+='<param name="wmode" value="transparent" />';this.object+='</object>'}else{DOM.addClass(this.content,'broken-media')}}this.active.type='media';this.setup();break;case'ajax':case'text/html':case'text/xml':if(this.print&&this.options.print){this.print.style.visibility='visible'}this.active.width=this.active.width||this.width();this.active.height=this.active.height||this.height();if(this.islocal(this.active.src)){if(!/tmpl=component/i.test(this.active.src)){this.active.src+=/\?/.test(this.active.src)?'&tmpl=component':'?tmpl=component'}this.active.type='ajax'}else{this.active.type='iframe';this.setup()}styles=extend(this.styles(p.styles),{display:'none'});this.ajax=DOM.add(this.content,'div',{id:'jcemediabox-popup-ajax','style':styles});if(JCEMediaBox.isIE6){DOM.style(this.ajax,'margin-right',JCEMediaBox.Dimensions.getScrollbarWidth())}if(JCEMediaBox.isIE7){DOM.style(this.ajax,'padding-right',JCEMediaBox.Dimensions.getScrollbarWidth())}this.active.src=this.active.src.replace(/\&type=(ajax|text\/html|text\/xml)/,'');if(this.loader){DOM.show(this.loader)}var iframe=DOM.add(document.body,'iframe',{src:this.active.src,style:'display:none;'});Event.add(iframe,'load',function(){t.ajax.innerHTML=iframe.contentWindow.document.body.innerHTML;window.setTimeout(function(){DOM.remove(iframe)},10);t.create(t.getPopups('',t.content));JCEMediaBox.ToolTip.create(t.content);each(DOM.select('a, area',t.content),function(el){JCEMediaBox.Event.add(el,'click',function(e){if(el.href&&el.href.indexOf('#')==-1){if(/jce(popup|box|lightbox)/.test(el.className)){Event.cancel(e);t.close(true)}else{t.close();if(isIE){if(/http(s)?:\/\//.test(el.href)){document.location.href=el.href}}}}})});return t.setup()});iframe.onerror=function(){DOM.addClass(this.content,'broken-page');return t.setup()};break;case'iframe':default:if(this.print){this.print.style.visibility='hidden'}if(this.islocal(this.active.src)){if(!/tmpl=component/i.test(this.active.src)){this.active.src+=/\?/.test(this.active.src)?'&tmpl=component':'?tmpl=component'}}this.active.width=this.active.width||this.width();this.active.height=this.active.height||this.height();this.active.type='iframe';this.setup();break}return false},resize:function(w,h,x,y){if(w>x){h=h*(x/w);w=x;if(h>y){w=w*(y/h);h=y}}else if(h>y){w=w*(y/h);h=y;if(w>x){h=h*(x/w);w=x}}w=Math.round(w);h=Math.round(h);return{width:Math.round(w),height:Math.round(h)}},setup:function(){var t=this,DOM=JCEMediaBox.DOM,w,h;w=this.active.width;h=this.active.height;if(this.active.type=='image'){if(t.img.error){w=300;h=300}var x=this.img.width;var y=this.img.height;if(w&&!h){h=y*(w/x)}else if(!w&&h){w=x*(h/y)}w=w||x;h=h||y}if(JCEMediaBox.options.popup.resize==1||JCEMediaBox.options.popup.scrolling=='fixed'){var x=this.width();var y=this.height();var dim=this.resize(w,h,x,y);w=dim.width;h=dim.height}DOM.styles(this.content,{width:w,height:h});DOM.hide(this.content);if(this.active.type=='image'){if(this.img.error){DOM.addClass(this.content,'broken-image')}else{this.content.innerHTML='<img id="jcemediabox-popup-img" src="'+this.active.src+'" title="'+this.active.title+'" width="'+w+'" height="'+h+'" />'}if(JCEMediaBox.isIE){var img=DOM.get('jcemediabox-popup-img');if(img){DOM.style(img,'-ms-interpolation-mode','bicubic')}}}return this.animate()},animate:function(){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM,FX=JCEMediaBox.FX,DIM=JCEMediaBox.Dimensions,Event=JCEMediaBox.Event;var ss=JCEMediaBox.options.popup.scalespeed,fs=JCEMediaBox.options.popup.fadespeed;var cw=DIM.outerWidth(this.content);var ch=DIM.outerHeight(this.content);var ih=0;each(['top','bottom'],function(v,i){var el=t['info-'+v];if(el){ih=ih+DIM.outerHeight(el)}});var st=DOM.style(this.page,'position')=='fixed'?0:DIM.getScrollTop();var top=st+(this.frameHeight()/2)-((ch+ih)/2);if(top<0){top=0}DOM.style(this.content,'opacity',0);FX.animate(this.body,{'height':ch,'top':top,'width':cw},ss,function(){if(t.active.type=='iframe'){var iframe=DOM.add(t.content,'iframe',{id:'jcemediabox-popup-iframe',frameborder:0,allowTransparency:true,scrolling:t.active.params.scrolling||'auto','style':{width:'100%',height:'100%'},seamless:"seamless"});Event.add(iframe,'load',function(){if(t.loader){DOM.hide(t.loader)}});iframe.setAttribute('src',t.active.src);t.iframe=iframe}else{if(t.loader){DOM.hide(t.loader)}if(t.active.type=='media'&&t.object){t.content.innerHTML=t.object}if(t.active.type=='ajax'){DOM.show(t.ajax)}}DOM.show(t.content);t.content.focus();function showInfo(){var itop=t['info-top'];if(itop){each(DOM.select('*[id]',itop),function(el){if(/jcemediabox-popup-(next|prev)/.test(DOM.attribute(el,'id'))){return}DOM.show(el)});var h=DIM.outerHeight(itop);DOM.styles(itop,{'z-index':-1,'top':h,'visibility':'visible'});FX.animate(itop,{'top':0},ss)}if(t.closelink){DOM.show(t.closelink)}var ibottom=t['info-bottom'];if(ibottom){each(DOM.select('*[id]',ibottom),function(el){if(/jcemediabox-popup-(next|prev)/.test(DOM.attribute(el,'id'))){return}DOM.show(el)});var h=DIM.outerHeight(ibottom);DOM.styles(ibottom,{'z-index':-1,'top':-h,'visibility':'visible'});FX.animate(ibottom,{'top':0},ss)}}if(t.active.type=='image'&&!JCEMediaBox.isIE6){FX.animate(t.content,{'opacity':1},fs,function(){showInfo()})}else{DOM.style(t.content,'opacity',1);showInfo()}})},close:function(keepopen){var t=this,each=JCEMediaBox.each,DOM=JCEMediaBox.DOM;each(['img','object','iframe','ajax'],function(i,v){t[v]=null});if(this.closelink){DOM.hide(this.closelink)}this.content.innerHTML='';each(['top','bottom'],function(i,v){if(t['info-'+v]){DOM.hide(t['info-'+v])}});if(!keepopen){var popups=this.getPopups();while(this.popups.length>popups.length){this.popups.pop()}DOM.remove(this.frame);if(this.overlay){if(JCEMediaBox.isIE6){this.bind();DOM.remove(this.page);this.page=null}else{JCEMediaBox.FX.animate(this.overlay,{'opacity':0},JCEMediaBox.options.popup.fadespeed,function(){t.bind();DOM.remove(t.page);t.page=null})}}else{DOM.remove(this.page);this.page=null}}return false}}})(window);JCEMediaBox.Event.addUnload(function(){JCEMediaBox.Event.destroy()});(function(mediabox){if(typeof mediabox==='undefined'){return}var popup=mediabox.Popup,trim=mediabox.trim;popup.setAddons('flash',{flash:function(v){if(/\.swf\b/.test(v)){return{type:'flash'}}},flv:function(v){if(/\.flv\b/.test(v)){return{type:'video/x-flv'}}},metacafe:function(v){if(/metacafe(.+)\/(watch|fplayer)\/(.+)/.test(v)){var s=trim(v);if(!/\.swf/i.test(s)){if(s.charAt(s.length-1)=='/'){s=s.substring(0,s.length-1)}s=s+'.swf'}return{width:400,height:345,type:'flash',attributes:{'wmode':'opaque','src':s.replace(/watch/i,'fplayer')}}}},dailymotion:function(v){if(/dailymotion(.+)\/(swf|video)\//.test(v)){var s=trim(v);s=s.replace(/_(.*)/,'');return{width:420,height:339,type:'flash','wmode':'opaque','src':s.replace(/video/i,'swf')}}},googlevideo:function(v){if(/google(.+)\/(videoplay|googleplayer\.swf)\?docid=(.+)/.test(v)){return{width:425,height:326,type:'flash','id':'VideoPlayback','wmode':'opaque','src':v.replace(/videoplay/g,'googleplayer.swf')}}}});popup.setAddons('iframe',{youtube:function(v){if(/youtu(\.)?be([^\/]+)?\/(.+)/.test(v)){return{width:425,height:350,type:'iframe','src':v.replace(/youtu(\.)?be([^\/]+)?\/(.+)/,function(a,b,c,d){d=d.replace(/(watch\?v=|v\/|embed\/)/,'');if(b&&!c){c='.com'}return'youtube'+c+'/embed/'+d+(/\?/.test(d)?'&':'?')+'wmode=opaque'})}}},vimeo:function(v){if(/vimeo\.com\/(video\/)?([0-9]+)/.test(v)){return{width:400,height:225,type:'iframe','src':v.replace(/(player\.)?vimeo\.com\/(video\/)?([0-9]+)/,function(a,b,c,d){if(b){return a}return'player.vimeo.com/video/'+d})}}},twitvid:function(v){if(/twitvid(.+)\/(.+)/.test(v)){var s='http://www.twitvid.com/embed.php?guid=';return{width:480,height:360,type:'iframe','src':v.replace(/(.+)twitvid([^\/]+)\/(.+)/,function(a,b,c,d){if(/embed\.php/.test(d)){return a}return s+d})}}}});popup.setAddons('image',{image:function(v){if(/\.(jpg|jpeg|png|gif|bmp|tif)$/i.test(v)){return{type:'image'}}},twitpic:function(v){if(/twitpic(.+)\/(.+)/.test(v)){return{type:'image'}}}})})(JCEMediaBox);var JCEMediaObject={version:{'flash':'10,0,22,87','windowsmedia':'5,1,52,701','quicktime':'6,0,2,0','realmedia':'7,0,0,0','shockwave':'8,5,1,0'},init:function(base,v){var t=this;this.base=base;for(n in v){t.version[n]=v[n]}},getSite:function(){var base=this.base;if(base){var site=document.location.href;var parts=site.split(':\/\/');var port=parts[0];var url=parts[1];if(url.indexOf(base)!=-1){url=url.substr(0,url.indexOf(base))}else{url=url.substr(0,url.indexOf('/'))||url}return port+'://'+url+base}return''},writeObject:function(cls,cb,mt,p){var h='',n;var msie=/msie/i.test(navigator.userAgent);var webkit=/webkit/i.test(navigator.userAgent);if(!/:\/\//.test(p.src)){p.src=this.getSite()+p.src;if(mt=='video/x-ms-wmv'){p.url=p.src}}h+='<object ';if(mt=='application/x-shockwave-flash'&&!msie){h+='type="'+mt+'" data="'+p.src+'" '}else{h+='classid="clsid:'+cls+'" ';if(cb){h+='codebase="'+cb+'" '}}for(n in p){if(p[n]!==''){if(/(id|name|width|height|style)$/.test(n)){h+=n+'="'+p[n]+'"'}}}h+='>';for(n in p){if(p[n]!==''){if(!/(id|name|width|height|style)$/.test(n)){h+='<param name="'+n+'" value="'+p[n]+'">'}}}if(!msie&&mt!='application/x-shockwave-flash'){h+='<embed type="'+mt+'" src="'+p.src+'"';for(n in p){if(p[n]!==''){h+=n+'="'+p[n]+'"'}}h+='></embed>'}h+='</object>';document.write(h)},video:function(p){var h='<video src="'+p.src+'"';for(n in p){if(p[n]!==''){h+=n+'="'+p[n]+'"'}}h+='>Your browser does not yet support the video element</video>';document.write(h)},audio:function(p){var h='<audio src="'+p.src+'"';for(n in p){if(p[n]!==''){h+=n+'="'+p[n]+'"'}}h+='>Your browser does not yet support the audio element</audio>';document.write(h)},flash:function(p){if(typeof p.wmode=='undefined'){p['wmode']='opaque'}this.writeObject('D27CDB6E-AE6D-11cf-96B8-444553540000','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version['flash'],'application/x-shockwave-flash',p)},shockwave:function(p){this.writeObject('166B1BCA-3F9C-11CF-8075-444553540000','http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version='+this.version['shockwave'],'application/x-director',p)},quicktime:function(p){this.writeObject('02BF25D5-8C17-4B23-BC80-D3488ABDDC6B','http://www.apple.com/qtactivex/qtplugin.cab#version='+this.version['quicktime'],'video/quicktime',p)},realmedia:function(p){this.writeObject('CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA','','audio/x-pn-realaudio-plugin',p)},windowsmedia:function(p){p.url=p.src;this.writeObject('6BF52A52-394A-11D3-B153-00C04F79FAA6','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version='+this.version['windowsmedia'],'video/x-ms-wmv',p)},divx:function(p){this.writeObject('67DABFBF-D0AB-41FA-9C46-CC0F21721616','http://go.divx.com/plugin/DivXBrowserPlugin.cab','video/divx',p)}};function writeFlash(p){JCEMediaObject.flash(p)};function writeShockWave(p){JCEMediaObject.shockwave(p)};function writeQuickTime(p){JCEMediaObject.quicktime(p)};function writeRealMedia(p){JCEMediaObject.realmedia(p)};function writeWindowsMedia(p){JCEMediaObject.windowsmedia(p)};function writeDivX(p){JCEMediaObject.divx(p)};

/*  */
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();

/*  */
if(typeof jwplayer=="undefined"){var jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="5.6.1768";(function(b){b.utils=function(){};b.utils.typeOf=function(d){var c=typeof d;if(c==="object"){if(d){if(d instanceof Array){c="array"}}else{c="null"}}return c};b.utils.extend=function(){var c=b.utils.extend["arguments"];if(c.length>1){for(var e=1;e<c.length;e++){for(var d in c[e]){c[0][d]=c[e][d]}}return c[0]}return null};b.utils.clone=function(f){var c;var d=b.utils.clone["arguments"];if(d.length==1){switch(b.utils.typeOf(d[0])){case"object":c={};for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;case"array":c=[];for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;default:return d[0];break}}return c};b.utils.extension=function(c){c=c.substring(c.lastIndexOf("/")+1,c.length);c=c.split("?")[0];if(c.lastIndexOf(".")>-1){return c.substr(c.lastIndexOf(".")+1,c.length).toLowerCase()}return};b.utils.html=function(c,d){c.innerHTML=d};b.utils.wrap=function(c,d){c.parentNode.replaceChild(d,c);d.appendChild(c)};b.utils.ajax=function(g,f,c){var e;if(window.XMLHttpRequest){e=new XMLHttpRequest()}else{e=new ActiveXObject("Microsoft.XMLHTTP")}e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){if(f){f(e)}}else{if(c){c(g)}}}};try{e.open("GET",g,true);e.send(null)}catch(d){if(c){c(g)}}return e};b.utils.load=function(d,e,c){d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){if(e){e()}}else{if(c){c()}}}}};b.utils.find=function(d,c){return d.getElementsByTagName(c)};b.utils.append=function(c,d){c.appendChild(d)};b.utils.isIE=function(){return((!+"\v1")||(typeof window.ActiveXObject!="undefined"))};b.utils.isLegacyAndroid=function(){var c=navigator.userAgent.toLowerCase();return(c.match(/android 2.[012]/i)!==null)};b.utils.isIOS=function(){var c=navigator.userAgent.toLowerCase();return(c.match(/iP(hone|ad)/i)!==null)};b.utils.getFirstPlaylistItemFromConfig=function(c){var d={};var e;if(c.playlist&&c.playlist.length){e=c.playlist[0]}else{e=c}d.file=e.file;d.levels=e.levels;d.streamer=e.streamer;d.playlistfile=e.playlistfile;d.provider=e.provider;if(!d.provider){if(d.file&&(d.file.toLowerCase().indexOf("youtube.com")>-1||d.file.toLowerCase().indexOf("youtu.be")>-1)){d.provider="youtube"}if(d.streamer&&d.streamer.toLowerCase().indexOf("rtmp://")==0){d.provider="rtmp"}if(e.type){d.provider=e.type.toLowerCase()}}return d};b.utils.getOuterHTML=function(d){if(d.outerHTML){return d.outerHTML}else{var e=d.parentNode;var c=document.createElement(e.tagName);var g=document.createElement(d.tagName);e.replaceChild(g,d);c.appendChild(d);var f=c.innerHTML;e.replaceChild(d,g);return f}};b.utils.setOuterHTML=function(f,e){if(f.outerHTML){f.outerHTML=e}else{var g=document.createElement("div");g.innerHTML=e;var c=document.createRange();c.selectNodeContents(g);var d=c.extractContents();f.parentNode.insertBefore(d,f);f.parentNode.removeChild(f)}};b.utils.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof window.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(c){}}return false};b.utils.getPluginName=function(c){if(c.lastIndexOf("/")>=0){c=c.substring(c.lastIndexOf("/")+1,c.length)}if(c.lastIndexOf("-")>=0){c=c.substring(0,c.lastIndexOf("-"))}if(c.lastIndexOf(".swf")>=0){c=c.substring(0,c.lastIndexOf(".swf"))}if(c.lastIndexOf(".js")>=0){c=c.substring(0,c.lastIndexOf(".js"))}return c};b.utils.getPluginVersion=function(c){if(c.lastIndexOf("-")>=0){if(c.lastIndexOf(".js")>=0){return c.substring(c.lastIndexOf("-")+1,c.lastIndexOf(".js"))}else{if(c.lastIndexOf(".swf")>=0){return c.substring(c.lastIndexOf("-")+1,c.lastIndexOf(".swf"))}else{return c.substring(c.lastIndexOf("-")+1)}}}return""};b.utils.getAbsolutePath=function(j,h){if(h===undefined){h=document.location.href}if(j===undefined){return undefined}if(a(j)){return j}var k=h.substring(0,h.indexOf("://")+3);var g=h.substring(k.length,h.indexOf("/",k.length+1));var d;if(j.indexOf("/")===0){d=j.split("/")}else{var e=h.split("?")[0];e=e.substring(k.length+g.length+1,e.lastIndexOf("/"));d=e.split("/").concat(j.split("/"))}var c=[];for(var f=0;f<d.length;f++){if(!d[f]||d[f]===undefined||d[f]=="."){continue}else{if(d[f]==".."){c.pop()}else{c.push(d[f])}}}return k+g+"/"+c.join("/")};function a(d){if(d===null){return}var e=d.indexOf("://");var c=d.indexOf("?");return(e>0&&(c<0||(c>e)))}b.utils.pluginPathType={ABSOLUTE:"ABSOLUTE",RELATIVE:"RELATIVE",CDN:"CDN"};b.utils.getPluginPathType=function(d){if(typeof d!="string"){return}d=d.split("?")[0];var e=d.indexOf("://");if(e>0){return b.utils.pluginPathType.ABSOLUTE}var c=d.indexOf("/");var f=b.utils.extension(d);if(e<0&&c<0&&(!f||!isNaN(f))){return b.utils.pluginPathType.CDN}return b.utils.pluginPathType.RELATIVE};b.utils.mapEmpty=function(c){for(var d in c){return false}return true};b.utils.mapLength=function(d){var c=0;for(var e in d){c++}return c};b.utils.log=function(d,c){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(c){console.log(d,c)}else{console.log(d)}}};b.utils.css=function(d,g,c){if(d!==undefined){for(var e in g){try{if(typeof g[e]==="undefined"){continue}else{if(typeof g[e]=="number"&&!(e=="zIndex"||e=="opacity")){if(isNaN(g[e])){continue}if(e.match(/color/i)){g[e]="#"+b.utils.strings.pad(g[e].toString(16),6)}else{g[e]=Math.ceil(g[e])+"px"}}}d.style[e]=g[e]}catch(f){}}}};b.utils.isYouTube=function(c){return(c.indexOf("youtube.com")>-1||c.indexOf("youtu.be")>-1)};b.utils.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d};b.utils.stretch=function(h,m,l,f,k,g){if(typeof l=="undefined"||typeof f=="undefined"||typeof k=="undefined"||typeof g=="undefined"){return}var d=l/k;var e=f/g;var j=0;var i=0;m.style.overflow="hidden";b.utils.transform(m,"");var c={};switch(h.toUpperCase()){case b.utils.stretching.NONE:c.width=k;c.height=g;break;case b.utils.stretching.UNIFORM:if(d>e){c.width=k*e;c.height=g*e}else{c.width=k*d;c.height=g*d}break;case b.utils.stretching.FILL:if(d>e){c.width=k*d;c.height=g*d}else{c.width=k*e;c.height=g*e}break;case b.utils.stretching.EXACTFIT:b.utils.transform(m,["scale(",d,",",e,")"," translate(0px,0px)"].join(""));c.width=k;c.height=g;break;default:break}c.top=(f-c.height)/2;c.left=(l-c.width)/2;b.utils.css(m,c)};b.utils.stretching={NONE:"NONE",FILL:"FILL",UNIFORM:"UNIFORM",EXACTFIT:"EXACTFIT"};b.utils.deepReplaceKeyName=function(h,e,c){switch(b.utils.typeOf(h)){case"array":for(var g=0;g<h.length;g++){h[g]=b.utils.deepReplaceKeyName(h[g],e,c)}break;case"object":for(var f in h){var d=f.replace(new RegExp(e,"g"),c);h[d]=b.utils.deepReplaceKeyName(h[f],e,c);if(f!=d){delete h[f]}}break}return h};b.utils.isInArray=function(e,d){if(!(e)||!(e instanceof Array)){return false}for(var c=0;c<e.length;c++){if(d===e[c]){return true}}return false}})(jwplayer);(function(a){a.events=function(){};a.events.COMPLETE="COMPLETE";a.events.ERROR="ERROR"})(jwplayer);(function(jwplayer){jwplayer.events.eventdispatcher=function(debug){var _debug=debug;var _listeners;var _globallisteners;this.resetEventListeners=function(){_listeners={};_globallisteners=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{if(_listeners[type]===undefined){_listeners[type]=[]}if(typeof(listener)=="string"){eval("listener = "+listener)}_listeners[type].push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeEventListener=function(type,listener){try{for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){if(_listeners[type][lisenterIndex].toString()==listener.toString()){_listeners[type].slice(lisenterIndex,lisenterIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.addGlobalListener=function(listener,count){try{if(typeof(listener)=="string"){eval("listener = "+listener)}_globallisteners.push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeGlobalListener=function(listener){try{for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){if(_globallisteners[globalListenerIndex].toString()==listener.toString()){_globallisteners.slice(globalListenerIndex,globalListenerIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.sendEvent=function(type,data){if(data===undefined){data={}}if(_debug){jwplayer.utils.log(type,data)}if(typeof _listeners[type]!="undefined"){for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){try{_listeners[type][listenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_listeners[type][listenerIndex].listener)}if(_listeners[type][listenerIndex]){if(_listeners[type][listenerIndex].count===1){delete _listeners[type][listenerIndex]}else{if(_listeners[type][listenerIndex].count>0){_listeners[type][listenerIndex].count=_listeners[type][listenerIndex].count-1}}}}}for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){try{_globallisteners[globalListenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_globallisteners[globalListenerIndex].listener)}if(_globallisteners[globalListenerIndex]){if(_globallisteners[globalListenerIndex].count===1){delete _globallisteners[globalListenerIndex]}else{if(_globallisteners[globalListenerIndex].count>0){_globallisteners[globalListenerIndex].count=_globallisteners[globalListenerIndex].count-1}}}}}}})(jwplayer);(function(a){var b={};a.utils.animations=function(){};a.utils.animations.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d;c.style.msTransform=d};a.utils.animations.transformOrigin=function(c,d){c.style.webkitTransformOrigin=d;c.style.MozTransformOrigin=d;c.style.OTransformOrigin=d;c.style.msTransformOrigin=d};a.utils.animations.rotate=function(c,d){a.utils.animations.transform(c,["rotate(",d,"deg)"].join(""))};a.utils.cancelAnimation=function(c){delete b[c.id]};a.utils.fadeTo=function(l,f,e,i,h,d){if(b[l.id]!=d&&d!==undefined){return}var c=new Date().getTime();if(d>c){setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},d-c)}l.style.display="block";if(i===undefined){i=l.style.opacity===""?1:l.style.opacity}if(l.style.opacity==f&&l.style.opacity!==""&&d!==undefined){if(f===0){l.style.display="none"}return}if(d===undefined){d=c;b[l.id]=d}if(h===undefined){h=0}var j=(c-d)/(e*1000);j=j>1?1:j;var k=f-i;var g=i+(j*k);if(g>1){g=1}else{if(g<0){g=0}}l.style.opacity=g;if(h>0){b[l.id]=d+h*1000;a.utils.fadeTo(l,f,e,i,0,b[l.id]);return}setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},10)}})(jwplayer);(function(a){a.utils.arrays=function(){};a.utils.arrays.indexOf=function(c,d){for(var b=0;b<c.length;b++){if(c[b]==d){return b}}return -1};a.utils.arrays.remove=function(c,d){var b=a.utils.arrays.indexOf(c,d);if(b>-1){c.splice(b,1)}}})(jwplayer);(function(a){a.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},aac:{html5:"audio/aac",flash:"video"},mp3:{html5:"audio/mp3",flash:"sound"},ogg:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"},wav:{html5:"audio/x-wav"}}})(jwplayer);(function(e){e.utils.mediaparser=function(){};var g={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}};var f={};e.utils.mediaparser.parseMedia=function(i){return d(i)};function c(j,i){if(i===undefined){i=g[j]}else{e.utils.extend(i,g[j])}return i}function d(m,i){if(f[m.tagName.toLowerCase()]&&(i===undefined)){return f[m.tagName.toLowerCase()](m)}else{i=c("element",i);var n={};for(var j in i){if(j!="length"){var l=m.getAttribute(j);if(!(l===""||l===undefined||l===null)){n[i[j]]=m.getAttribute(j)}}}var k=m.style["#background-color"];if(k&&!(k=="transparent"||k=="rgba(0, 0, 0, 0)")){n.screencolor=k}return n}}function h(n,k){k=c("media",k);var l=[];var j=e.utils.selectors("source",n);for(var m in j){if(!isNaN(m)){l.push(a(j[m]))}}var o=d(n,k);if(o.file!==undefined){l[0]={file:o.file}}o.levels=l;return o}function a(k,j){j=c("source",j);var i=d(k,j);i.width=i.width?i.width:0;i.bitrate=i.bitrate?i.bitrate:0;return i}function b(k,j){j=c("video",j);var i=h(k,j);return i}f.media=h;f.audio=h;f.source=a;f.video=b})(jwplayer);(function(a){a.utils.loaderstatus={NEW:"NEW",LOADING:"LOADING",ERROR:"ERROR",COMPLETE:"COMPLETE"};a.utils.scriptloader=function(c){var d=a.utils.loaderstatus.NEW;var b=new a.events.eventdispatcher();a.utils.extend(this,b);this.load=function(){if(d==a.utils.loaderstatus.NEW){d=a.utils.loaderstatus.LOADING;var e=document.createElement("script");e.onload=function(f){d=a.utils.loaderstatus.COMPLETE;b.sendEvent(a.events.COMPLETE)};e.onerror=function(f){d=a.utils.loaderstatus.ERROR;b.sendEvent(a.events.ERROR)};e.onreadystatechange=function(){if(e.readyState=="loaded"||e.readyState=="complete"){d=a.utils.loaderstatus.COMPLETE;b.sendEvent(a.events.COMPLETE)}};document.getElementsByTagName("head")[0].appendChild(e);e.src=c}};this.getStatus=function(){return d}}})(jwplayer);(function(a){a.utils.selectors=function(b,d){if(d===undefined){d=document}b=a.utils.strings.trim(b);var c=b.charAt(0);if(c=="#"){return d.getElementById(b.substr(1))}else{if(c=="."){if(d.getElementsByClassName){return d.getElementsByClassName(b.substr(1))}else{return a.utils.selectors.getElementsByTagAndClass("*",b.substr(1))}}else{if(b.indexOf(".")>0){selectors=b.split(".");return a.utils.selectors.getElementsByTagAndClass(selectors[0],selectors[1])}else{return d.getElementsByTagName(b)}}}return null};a.utils.selectors.getElementsByTagAndClass=function(e,h,g){elements=[];if(g===undefined){g=document}var f=g.getElementsByTagName(e);for(var d=0;d<f.length;d++){if(f[d].className!==undefined){var c=f[d].className.split(" ");for(var b=0;b<c.length;b++){if(c[b]==h){elements.push(f[d])}}}}return elements}})(jwplayer);(function(a){a.utils.strings=function(){};a.utils.strings.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.utils.strings.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.utils.strings.serialize=function(b){if(b==null){return null}else{if(b=="true"){return true}else{if(b=="false"){return false}else{if(isNaN(Number(b))||b.length>5||b.length==0){return b}else{return Number(b)}}}}};a.utils.strings.seconds=function(d){d=d.replace(",",".");var b=d.split(":");var c=0;if(d.substr(-1)=="s"){c=Number(d.substr(0,d.length-1))}else{if(d.substr(-1)=="m"){c=Number(d.substr(0,d.length-1))*60}else{if(d.substr(-1)=="h"){c=Number(d.substr(0,d.length-1))*3600}else{if(b.length>1){c=Number(b[b.length-1]);c+=Number(b[b.length-2])*60;if(b.length==3){c+=Number(b[b.length-3])*3600}}else{c=Number(d)}}}}return c};a.utils.strings.xmlAttribute=function(b,c){for(var d in b.attributes){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.utils.strings.jsonToString=function(f){var h=h||{};if(h&&h.stringify){return h.stringify(f)}var c=typeof(f);if(c!="object"||f===null){if(c=="string"){f='"'+f+'"'}else{return String(f)}}else{var g=[],b=(f&&f.constructor==Array);for(var d in f){var e=f[d];switch(typeof(e)){case"string":e='"'+e+'"';break;case"object":if(e!==null){e=a.utils.strings.jsonToString(e)}break}if(b){if(typeof(e)!="function"){g.push(String(e))}}else{if(typeof(e)!="function"){g.push('"'+d+'":'+String(e))}}}if(b){return"["+String(g)+"]"}else{return"{"+String(g)+"}"}}}})(jwplayer);(function(c){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);c.utils.typechecker=function(g,f){f=f===null?b(g):f;return e(g,f)};function b(f){var g=["true","false","t","f"];if(g.toString().indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(f===null){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){switch(f.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,16)}return parseInt("000000",16)}})(jwplayer);(function(a){var c={};var b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,f,e){var d=a.utils.getPluginName(h);if(c[d]){c[d].registerPlugin(h,f,e)}else{a.utils.log("A plugin ("+h+") was registered with the player that was not loaded. Please check your configuration.");for(var g in b){b[g].pluginFailed()}}}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]}}})(jwplayer);(function(a){a.plugins.pluginmodes={FLASH:"FLASH",JAVASCRIPT:"JAVASCRIPT",HYBRID:"HYBRID"};a.plugins.plugin=function(b){var d="http://plugins.longtailvideo.com";var i=a.utils.loaderstatus.NEW;var j;var h;var k;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function e(){switch(a.utils.getPluginPathType(b)){case a.utils.pluginPathType.ABSOLUTE:return b;case a.utils.pluginPathType.RELATIVE:return a.utils.getAbsolutePath(b,window.location.href);case a.utils.pluginPathType.CDN:var m=a.utils.getPluginName(b);var l=a.utils.getPluginVersion(b);return d+"/"+a.version.split(".")[0]+"/"+m+"/"+m+(l!==""?("-"+l):"")+".js"}}function g(l){k=setTimeout(function(){i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)},1000)}function f(l){i=a.utils.loaderstatus.ERROR;c.sendEvent(a.events.ERROR)}this.load=function(){if(i==a.utils.loaderstatus.NEW){if(b.lastIndexOf(".swf")>0){j=b;i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE);return}i=a.utils.loaderstatus.LOADING;var l=new a.utils.scriptloader(e());l.addEventListener(a.events.COMPLETE,g);l.addEventListener(a.events.ERROR,f);l.load()}};this.registerPlugin=function(n,m,l){if(k){clearTimeout(k);k=undefined}if(m&&l){j=l;h=m}else{if(typeof m=="string"){j=m}else{if(typeof m=="function"){h=m}else{if(!m&&!l){j=n}}}}i=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)};this.getStatus=function(){return i};this.getPluginName=function(){return a.utils.getPluginName(b)};this.getFlashPath=function(){if(j){switch(a.utils.getPluginPathType(j)){case a.utils.pluginPathType.ABSOLUTE:return j;case a.utils.pluginPathType.RELATIVE:if(b.lastIndexOf(".swf")>0){return a.utils.getAbsolutePath(j,window.location.href)}return a.utils.getAbsolutePath(j,e());case a.utils.pluginPathType.CDN:if(j.indexOf("-")>-1){return j+"h"}return j+"-h"}}return null};this.getJS=function(){return h};this.getPluginmode=function(){if(typeof j!="undefined"&&typeof h!="undefined"){return a.plugins.pluginmodes.HYBRID}else{if(typeof j!="undefined"){return a.plugins.pluginmodes.FLASH}else{if(typeof h!="undefined"){return a.plugins.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(m,l,n){return new h(m,l,n)};this.getURL=function(){return b}}})(jwplayer);(function(a){a.plugins.pluginloader=function(h,e){var g={};var j=a.utils.loaderstatus.NEW;var d=false;var b=false;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function f(){if(!b){b=true;j=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)}}function i(){if(!b){var l=0;for(plugin in g){var k=g[plugin].getStatus();if(k==a.utils.loaderstatus.LOADING||k==a.utils.loaderstatus.NEW){l++}}if(l==0){f()}}}this.setupPlugins=function(m,k,r){var l={length:0,plugins:{}};var o={length:0,plugins:{}};for(var n in g){var p=g[n].getPluginName();if(g[n].getFlashPath()){l.plugins[g[n].getFlashPath()]=k.plugins[n];l.plugins[g[n].getFlashPath()].pluginmode=g[n].getPluginmode();l.length++}if(g[n].getJS()){var q=document.createElement("div");q.id=m.id+"_"+p;q.style.position="absolute";q.style.zIndex=o.length+10;o.plugins[p]=g[n].getNewInstance(m,k.plugins[n],q);o.length++;if(typeof o.plugins[p].resize!="undefined"){m.onReady(r(o.plugins[p],q,true));m.onResize(r(o.plugins[p],q))}}}m.plugins=o.plugins;return l};this.load=function(){j=a.utils.loaderstatus.LOADING;d=true;for(var k in e){g[k]=h.addPlugin(k);g[k].addEventListener(a.events.COMPLETE,i);g[k].addEventListener(a.events.ERROR,i)}for(k in e){g[k].load()}d=false;i()};this.pluginFailed=function(){f()};this.getStatus=function(){return j}}})(jwplayer);(function(b){var a=[];b.api=function(d){this.container=d;this.id=d.id;var l={};var p={};var c=[];var h=undefined;var k=false;var i=[];var n=b.utils.getOuterHTML(d);var o={};var j={};this.getBuffer=function(){return this.callInternal("jwGetBuffer")};this.getContainer=function(){return this.container};function e(q){return function(v,r,s,t){var u;if(r){j[v]=r;u="jwplayer('"+q+"').callback('"+v+"')"}else{if(!r&&j[v]){delete j[v]}}h.jwDockSetButton(v,u,s,t)}}this.getPlugin=function(r){var q=this.callInternal;if(r=="dock"){return{setButton:e(this.id),show:function(){return q("jwShowDock")},hide:function(){return q("jwHideDock")}}}else{if(r=="controlbar"){return{show:function(){return q("jwShowControlbar")},hide:function(){return q("jwHideControlbar")}}}else{if(r=="display"){return{show:function(){return q("jwShowDisplay")},hide:function(){return q("jwHideDisplay")}}}}}return this.plugins[r]};this.callback=function(q){if(j[q]){return j[q]()}};this.getDuration=function(){return this.callInternal("jwGetDuration")};this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")};this.getHeight=function(){return this.callInternal("jwGetHeight")};this.getLockState=function(){return this.callInternal("jwGetLockState")};this.getMeta=function(){return this.getItemMeta()};this.getMute=function(){return this.callInternal("jwGetMute")};this.getPlaylist=function(){var r=this.callInternal("jwGetPlaylist");if(this.renderingMode=="flash"){b.utils.deepReplaceKeyName(r,"__dot__",".")}for(var q=0;q<r.length;q++){if(r[q].index===undefined){r[q].index=q}}return r};this.getPlaylistItem=function(q){if(q===undefined){q=this.getCurrentItem()}return this.getPlaylist()[q]};this.getPosition=function(){return this.callInternal("jwGetPosition")};this.getRenderingMode=function(){return this.renderingMode};this.getState=function(){return this.callInternal("jwGetState")};this.getVolume=function(){return this.callInternal("jwGetVolume")};this.getWidth=function(){return this.callInternal("jwGetWidth")};this.setFullscreen=function(q){if(q===undefined){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",q)}return this};this.setMute=function(q){if(q===undefined){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",q)}return this};this.lock=function(){return this};this.unlock=function(){return this};this.load=function(q){this.callInternal("jwLoad",q);return this};this.playlistItem=function(q){this.callInternal("jwPlaylistItem",q);return this};this.playlistPrev=function(){this.callInternal("jwPlaylistPrev");return this};this.playlistNext=function(){this.callInternal("jwPlaylistNext");return this};this.resize=function(r,q){if(this.renderingMode=="html5"){h.jwResize(r,q)}else{this.container.width=r;this.container.height=q}return this};this.play=function(q){if(typeof q=="undefined"){q=this.getState();if(q==b.api.events.state.PLAYING||q==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",q)}return this};this.pause=function(q){if(typeof q=="undefined"){q=this.getState();if(q==b.api.events.state.PLAYING||q==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",q)}return this};this.stop=function(){this.callInternal("jwStop");return this};this.seek=function(q){this.callInternal("jwSeek",q);return this};this.setVolume=function(q){this.callInternal("jwSetVolume",q);return this};this.onBufferChange=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER,q)};this.onBufferFull=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,q)};this.onError=function(q){return this.eventListener(b.api.events.JWPLAYER_ERROR,q)};this.onFullscreen=function(q){return this.eventListener(b.api.events.JWPLAYER_FULLSCREEN,q)};this.onMeta=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_META,q)};this.onMute=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_MUTE,q)};this.onPlaylist=function(q){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,q)};this.onPlaylistItem=function(q){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,q)};this.onReady=function(q){return this.eventListener(b.api.events.API_READY,q)};this.onResize=function(q){return this.eventListener(b.api.events.JWPLAYER_RESIZE,q)};this.onComplete=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,q)};this.onSeek=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_SEEK,q)};this.onTime=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_TIME,q)};this.onVolume=function(q){return this.eventListener(b.api.events.JWPLAYER_MEDIA_VOLUME,q)};this.onBuffer=function(q){return this.stateListener(b.api.events.state.BUFFERING,q)};this.onPause=function(q){return this.stateListener(b.api.events.state.PAUSED,q)};this.onPlay=function(q){return this.stateListener(b.api.events.state.PLAYING,q)};this.onIdle=function(q){return this.stateListener(b.api.events.state.IDLE,q)};this.remove=function(){l={};i=[];if(b.utils.getOuterHTML(this.container)!=n){b.api.destroyPlayer(this.id,n)}};this.setup=function(r){if(b.embed){var q=this.id;this.remove();var s=b(q);s.config=r;return new b.embed(s)}return this};this.registerPlugin=function(s,r,q){b.plugins.registerPlugin(s,r,q)};this.setPlayer=function(q,r){h=q;this.renderingMode=r};this.stateListener=function(q,r){if(!p[q]){p[q]=[];this.eventListener(b.api.events.JWPLAYER_PLAYER_STATE,g(q))}p[q].push(r);return this};function g(q){return function(s){var r=s.newstate,u=s.oldstate;if(r==q){var t=p[r];if(t){for(var v=0;v<t.length;v++){if(typeof t[v]=="function"){t[v].call(this,{oldstate:u,newstate:r})}}}}}}this.addInternalListener=function(q,r){q.jwAddEventListener(r,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+r+'", dat); }')};this.eventListener=function(q,r){if(!l[q]){l[q]=[];if(h&&k){this.addInternalListener(h,q)}}l[q].push(r);return this};this.dispatchEvent=function(s){if(l[s]){var r=f(s,arguments[1]);for(var q=0;q<l[s].length;q++){if(typeof l[s][q]=="function"){l[s][q].call(this,r)}}}};function f(s,q){var u=b.utils.extend({},q);if(s==b.api.events.JWPLAYER_FULLSCREEN&&!u.fullscreen){u.fullscreen=u.message=="true"?true:false;delete u.message}else{if(typeof u.data=="object"){u=b.utils.extend(u,u.data);delete u.data}}var r=["position","duration","offset"];for(var t in r){if(u[r[t]]){u[r[t]]=Math.round(u[r[t]]*1000)/1000}}return u}this.callInternal=function(r,q){if(k){if(typeof h!="undefined"&&typeof h[r]=="function"){if(q!==undefined){return(h[r])(q)}else{return(h[r])()}}return null}else{i.push({method:r,parameters:q})}};this.playerReady=function(s){k=true;if(!h){this.setPlayer(document.getElementById(s.id))}this.container=document.getElementById(this.id);for(var q in l){this.addInternalListener(h,q)}this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,function(t){o={}});this.eventListener(b.api.events.JWPLAYER_MEDIA_META,function(t){b.utils.extend(o,t.metadata)});this.dispatchEvent(b.api.events.API_READY);while(i.length>0){var r=i.shift();this.callInternal(r.method,r.parameters)}};this.getItemMeta=function(){return o};this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")};function m(s,u,t){var q=[];if(!u){u=0}if(!t){t=s.length-1}for(var r=u;r<=t;r++){q.push(s[r])}return q}return this};b.api.selectPlayer=function(d){var c;if(d===undefined){d=0}if(d.nodeType){c=d}else{if(typeof d=="string"){c=document.getElementById(d)}}if(c){var e=b.api.playerById(c.id);if(e){return e}else{return b.api.addPlayer(new b.api(c))}}else{if(typeof d=="number"){return b.getPlayers()[d]}}return null};b.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem"};b.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};b.api.playerById=function(d){for(var c=0;c<a.length;c++){if(a[c].id==d){return a[c]}}return null};b.api.addPlayer=function(c){for(var d=0;d<a.length;d++){if(a[d]==c){return c}}a.push(c);return c};b.api.destroyPlayer=function(g,d){var f=-1;for(var i=0;i<a.length;i++){if(a[i].id==g){f=i;continue}}if(f>=0){var c=document.getElementById(a[f].id);if(document.getElementById(a[f].id+"_wrapper")){c=document.getElementById(a[f].id+"_wrapper")}if(c){if(d){b.utils.setOuterHTML(c,d)}else{var h=document.createElement("div");var e=c.id;if(c.id.indexOf("_wrapper")==c.id.length-8){newID=c.id.substring(0,c.id.length-8)}h.setAttribute("id",e);c.parentNode.replaceChild(h,c)}}a.splice(f,1)}return null};b.getPlayers=function(){return a.slice(0)}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(a){a.embed=function(g){var i={width:400,height:300,components:{controlbar:{position:"over"}}};var f=a.utils.mediaparser.parseMedia(g.container);var e=new a.embed.config(a.utils.extend(i,f,g.config),this);var h=a.plugins.loadPlugins(g.id,e.plugins);function c(l,k){for(var j in k){if(typeof l[j]=="function"){(l[j]).call(l,k[j])}}}function d(){if(h.getStatus()==a.utils.loaderstatus.COMPLETE){for(var l=0;l<e.modes.length;l++){if(e.modes[l].type&&a.embed[e.modes[l].type]){var j=e;if(e.modes[l].config){j=a.utils.extend(a.utils.clone(e),e.modes[l].config)}var k=new a.embed[e.modes[l].type](document.getElementById(g.id),e.modes[l],j,h,g);if(k.supportsConfig()){k.embed();c(g,e.events);return g}}}a.utils.log("No suitable players found");new a.embed.logo(a.utils.extend({hide:true},e.components.logo),"none",g.id)}}h.addEventListener(a.events.COMPLETE,d);h.addEventListener(a.events.ERROR,d);h.load();return g};function b(){if(!document.body){return setTimeout(b,15)}var c=a.utils.selectors.getElementsByTagAndClass("video","jwplayer");for(var d=0;d<c.length;d++){var e=c[d];a(e.id).setup({})}}b()})(jwplayer);(function(a){function c(){return[{type:"flash",src:"/jwplayer/player.swf"},{type:"html5"},{type:"download"}]}function e(l){var k=l.toLowerCase();var j=["left","right","top","bottom"];for(var i=0;i<j.length;i++){if(k==j[i]){return true}}return false}function d(j){var i=false;i=(j instanceof Array)||(typeof j=="object"&&!j.position&&!j.size);return i}function h(i){if(typeof i=="string"){if(parseInt(i).toString()==i||i.toLowerCase().indexOf("px")>-1){return parseInt(i)}}return i}var f=["playlist","dock","controlbar","logo"];function g(j){var m={};switch(a.utils.typeOf(j.plugins)){case"object":for(var l in j.plugins){m[a.utils.getPluginName(l)]=l}break;case"string":var n=j.plugins.split(",");for(var k=0;k<n.length;k++){m[a.utils.getPluginName(n[k])]=n[k]}break}return m}function b(m,l,k,i){if(a.utils.typeOf(m[l])!="object"){m[l]={}}var j=m[l][k];if(a.utils.typeOf(j)!="object"){m[l][k]=j={}}if(l=="plugins"){var n=a.utils.getPluginName(k);j[i]=m[n+"."+i];delete m[n+"."+i]}else{j[i]=m[k+"."+i];delete m[k+"."+i]}}a.embed.deserialize=function(i){var j=g(i);for(var m in i){if(m.indexOf(".")>-1){var l=m.split(".");var k=l[0];var m=l[1];if(a.utils.isInArray(f,k)){b(i,"components",k,m)}else{if(j[k]){b(i,"plugins",j[k],m)}}}}return i};a.embed.config=function(i,q){var p=a.utils.extend({},i);var n;if(d(p.playlist)){n=p.playlist;delete p.playlist}p=a.embed.deserialize(p);p.height=h(p.height);p.width=h(p.width);if(typeof p.plugins=="string"){var j=p.plugins.split(",");if(typeof p.plugins!="object"){p.plugins={}}for(var l=0;l<j.length;l++){var m=a.utils.getPluginName(j[l]);if(typeof p[m]=="object"){p.plugins[j[l]]=p[m];delete p[m]}else{p.plugins[j[l]]={}}}}for(var o=0;o<f.length;o++){if(typeof p[f[o]]=="string"){if(!p.components[f[o]]){p.components[f[o]]={}}if(f[o]=="logo"){p.components[f[o]].file=p[f[o]]}else{p.components[f[o]].position=p[f[o]]}delete p[f[o]]}else{if(typeof p[f[o]]!="undefined"){if(!p.components[f[o]]){p.components[f[o]]={}}a.utils.extend(p.components[f[o]],p[f[o]]);delete p[f[o]]}}if(typeof p[f[o]+"size"]!="undefined"){if(!p.components[f[o]]){p.components[f[o]]={}}p.components[f[o]].size=p[f[o]+"size"];delete p[f[o]+"size"]}}if(typeof p.icons!="undefined"){if(!p.components.display){p.components.display={}}p.components.display.icons=p.icons;delete p.icons}if(p.players){p.modes=p.players;delete p.players}var k;if(p.flashplayer&&!p.modes){k=c();k[0].src=p.flashplayer;delete p.flashplayer}else{if(p.modes){if(typeof p.modes=="string"){k=c();k[0].src=p.modes}else{if(p.modes instanceof Array){k=p.modes}else{if(typeof p.modes=="object"&&p.modes.type){k=[p.modes]}}}delete p.modes}else{k=c()}}p.modes=k;if(n){p.playlist=n}return p}})(jwplayer);(function(a){a.embed.download=function(c,g,b,d,f){this.embed=function(){var j=a.utils.extend({},b);var p={};var i=b.width?b.width:480;if(typeof i!="number"){i=parseInt(i,10)}var l=b.height?b.height:320;if(typeof l!="number"){l=parseInt(l,10)}var t,n,m;var r={};if(b.playlist&&b.playlist.length){r.file=b.playlist[0].file;n=b.playlist[0].image;r.levels=b.playlist[0].levels}else{r.file=b.file;n=b.image;r.levels=b.levels}if(r.file){t=r.file}else{if(r.levels&&r.levels.length){t=r.levels[0].file}}m=t?"pointer":"auto";var k={display:{style:{cursor:m,width:i,height:l,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:m,position:"absolute",display:t?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:m,position:"absolute",display:t?"block":"none",top:((l-50)/2),left:((i-50)/2),border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:i,height:l,display:n?"block":"none",position:"absolute",cursor:m,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};var h=function(u,w,x){var v=document.createElement(u);if(x){v.id=x}else{v.id=c.id+"_jwplayer_"+w}a.utils.css(v,k[w].style);return v};p.display=h("a","display",c.id);if(t){p.display.setAttribute("href",a.utils.getAbsolutePath(t))}p.display_image=h("img","display_image");p.display_image.setAttribute("alt","Click to download...");if(n){p.display_image.setAttribute("src",a.utils.getAbsolutePath(n))}if(true){p.display_icon=h("div","display_icon");p.display_iconBackground=h("div","display_iconBackground");p.display.appendChild(p.display_image);p.display_iconBackground.appendChild(p.display_icon);p.display.appendChild(p.display_iconBackground)}_css=a.utils.css;_hide=function(u){_css(u,{display:"none"})};function q(u){_imageWidth=p.display_image.naturalWidth;_imageHeight=p.display_image.naturalHeight;s()}function s(){a.utils.stretch(a.utils.stretching.UNIFORM,p.display_image,i,l,_imageWidth,_imageHeight)}p.display_image.onerror=function(u){_hide(p.display_image)};p.display_image.onload=q;c.parentNode.replaceChild(p.display,c);var o=(b.plugins&&b.plugins.logo)?b.plugins.logo:{};p.display.appendChild(new a.embed.logo(b.components.logo,"download",c.id));f.container=document.getElementById(f.id);f.setPlayer(p.display,"download")};this.supportsConfig=function(){if(b){var j=a.utils.getFirstPlaylistItemFromConfig(b);if(typeof j.file=="undefined"&&typeof j.levels=="undefined"){return true}else{if(j.file){return e(j.file,j.provider,j.playlistfile)}else{if(j.levels&&j.levels.length){for(var h=0;h<j.levels.length;h++){if(j.levels[h].file&&e(j.levels[h].file,j.provider,j.playlistfile)){return true}}}}}}else{return true}};function e(i,k,h){if(h){return false}var j=["image","sound","youtube","http"];if(k&&(j.toString().indexOf(k)>-1)){return true}if(!k||(k&&k=="video")){var l=a.utils.extension(i);if(l&&a.utils.extensionmap[l]){return true}}return false}}})(jwplayer);(function(a){a.embed.flash=function(f,g,k,e,i){function l(n,m,o){var p=document.createElement("param");p.setAttribute("name",m);p.setAttribute("value",o);n.appendChild(p)}function j(n,o,m){return function(p){if(m){document.getElementById(i.id+"_wrapper").appendChild(o)}var r=document.getElementById(i.id).getPluginConfig("display");n.resize(r.width,r.height);var q={left:r.x,top:r.y};a.utils.css(o,q)}}function d(o){if(!o){return{}}var q={};for(var n in o){var m=o[n];for(var p in m){q[n+"."+p]=m[p]}}return q}function h(p,o){if(p[o]){var r=p[o];for(var n in r){var m=r[n];if(typeof m=="string"){if(!p[n]){p[n]=m}}else{for(var q in m){if(!p[n+"."+q]){p[n+"."+q]=m[q]}}}}delete p[o]}}function b(p){if(!p){return{}}var s={},r=[];for(var m in p){var o=a.utils.getPluginName(m);var n=p[m];r.push(m);for(var q in n){s[o+"."+q]=n[q]}}s.plugins=r.join(",");return s}function c(o){var m=o.netstreambasepath?"":"netstreambasepath="+encodeURIComponent(window.location.href)+"&";for(var n in o){if(typeof(o[n])=="object"){m+=n+"="+encodeURIComponent("[[JSON]]"+a.utils.strings.jsonToString(o[n]))+"&"}else{m+=n+"="+encodeURIComponent(o[n])+"&"}}return m.substring(0,m.length-1)}this.embed=function(){k.id=i.id;var x;var p=a.utils.extend({},k);var m=p.width;var v=p.height;if(f.id+"_wrapper"==f.parentNode.id){x=document.getElementById(f.id+"_wrapper")}else{x=document.createElement("div");x.id=f.id+"_wrapper";a.utils.wrap(f,x);a.utils.css(x,{position:"relative",width:m,height:v})}var n=e.setupPlugins(i,p,j);if(n.length>0){a.utils.extend(p,b(n.plugins))}else{delete p.plugins}var q=["height","width","modes","events"];for(var t=0;t<q.length;t++){delete p[q[t]]}var o="opaque";if(p.wmode){o=p.wmode}h(p,"components");h(p,"providers");if(typeof p["dock.position"]!="undefined"){if(p["dock.position"].toString().toLowerCase()=="false"){p.dock=p["dock.position"];delete p["dock.position"]}}var w="#000000";var s;if(a.utils.isIE()){var u='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+w+'" width="100%" height="100%" id="'+f.id+'" name="'+f.id+'" tabindex=0"">';u+='<param name="movie" value="'+g.src+'">';u+='<param name="allowfullscreen" value="true">';u+='<param name="allowscriptaccess" value="always">';u+='<param name="seamlesstabbing" value="true">';u+='<param name="wmode" value="'+o+'">';u+='<param name="flashvars" value="'+c(p)+'">';u+="</object>";a.utils.setOuterHTML(f,u);s=document.getElementById(f.id)}else{var r=document.createElement("object");r.setAttribute("type","application/x-shockwave-flash");r.setAttribute("data",g.src);r.setAttribute("width","100%");r.setAttribute("height","100%");r.setAttribute("bgcolor","#000000");r.setAttribute("id",f.id);r.setAttribute("name",f.id);r.setAttribute("tabindex",0);l(r,"allowfullscreen","true");l(r,"allowscriptaccess","always");l(r,"seamlesstabbing","true");l(r,"wmode",o);l(r,"flashvars",c(p));f.parentNode.replaceChild(r,f);s=r}i.container=s;i.setPlayer(s,"flash")};this.supportsConfig=function(){if(a.utils.hasFlash()){if(k){var n=a.utils.getFirstPlaylistItemFromConfig(k);if(typeof n.file=="undefined"&&typeof n.levels=="undefined"){return true}else{if(n.file){return flashCanPlay(n.file,n.provider)}else{if(n.levels&&n.levels.length){for(var m=0;m<n.levels.length;m++){if(n.levels[m].file&&flashCanPlay(n.levels[m].file,n.provider)){return true}}}}}}else{return true}}return false};flashCanPlay=function(m,o){var n=["video","http","sound","image"];if(o&&(n.toString().indexOf(o<0))){return true}var p=a.utils.extension(m);if(!p){return true}if(a.utils.extensionmap[p]!==undefined&&a.utils.extensionmap[p].flash===undefined){return false}return true}}})(jwplayer);(function(a){a.embed.html5=function(c,g,b,d,f){function e(i,j,h){return function(k){var l=document.getElementById(c.id+"_displayarea");if(h){l.appendChild(j)}var m=l.style;i.resize(parseInt(m.width.replace("px","")),parseInt(m.height.replace("px","")));j.left=m.left;j.top=m.top}}this.embed=function(){if(a.html5){d.setupPlugins(f,b,e);c.innerHTML="";var j=a.utils.extend({screencolor:"0x000000"},b);var h=["plugins","modes","events"];for(var k=0;k<h.length;k++){delete j[h[k]]}if(j.levels&&!j.sources){j.sources=b.levels}if(j.skin&&j.skin.toLowerCase().indexOf(".zip")>0){j.skin=j.skin.replace(/\.zip/i,".xml")}var l=new (a.html5(c)).setup(j);f.container=document.getElementById(f.id);f.setPlayer(l,"html5")}else{return null}};this.supportsConfig=function(){var h=document.createElement("video");if(!!h.canPlayType){if(b){var k=a.utils.getFirstPlaylistItemFromConfig(b);if(typeof k.file=="undefined"&&typeof k.levels=="undefined"){return true}else{if(k.file){return html5CanPlay(h,k.file,k.provider,k.playlistfile)}else{if(k.levels&&k.levels.length){for(var j=0;j<k.levels.length;j++){if(k.levels[j].file&&html5CanPlay(h,k.levels[j].file,k.provider,k.playlistfile)){return true}}}}}}else{return true}}return false};html5CanPlay=function(j,i,k,h){if(h){return false}if(k&&k=="youtube"){return true}if(k&&k!="video"&&k!="http"&&k!="sound"){return false}var l=a.utils.extension(i);if(!l||a.utils.extensionmap[l]===undefined){return true}if(a.utils.extensionmap[l].html5===undefined){return false}if(a.utils.isLegacyAndroid()&&l.match(/m4v|mp4/)){return true}return browserCanPlay(j,a.utils.extensionmap[l].html5)};browserCanPlay=function(i,h){if(!h){return true}return i.canPlayType(h)}}})(jwplayer);(function(a){a.embed.logo=function(l,k,d){var i={prefix:"http://l.longtailvideo.com/"+k+"/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:0.5,over:1,timeout:3,hide:false,position:"bottom-left"};_css=a.utils.css;var b;var h;j();function j(){n();c();f()}function n(){if(i.prefix){var p=a.version.split(/\W/).splice(0,2).join("/");if(i.prefix.indexOf(p)<0){i.prefix+=p+"/"}}h=a.utils.extend({},i)}function o(){var r={border:"none",textDecoration:"none",position:"absolute",cursor:"pointer",zIndex:10};r.display=h.hide?"none":"block";var q=h.position.toLowerCase().split("-");for(var p in q){r[q[p]]=h.margin}return r}function c(){b=document.createElement("img");b.id=d+"_jwplayer_logo";b.style.display="none";b.onload=function(p){_css(b,o());e()};if(!h.file){return}if(h.file.indexOf("http://")===0){b.src=h.file}else{b.src=h.prefix+h.file}}if(!h.file){return}function f(){if(h.link){b.onmouseover=g;b.onmouseout=e;b.onclick=m}else{this.mouseEnabled=false}}function m(p){if(typeof p!="undefined"){p.preventDefault();p.stopPropagation()}if(h.link){window.open(h.link,"_blank")}return}function e(p){if(h.link){b.style.opacity=h.out}return}function g(p){if(h.hide){b.style.opacity=h.over}return}return b}})(jwplayer);(function(a){a.html5=function(b){var c=b;this.setup=function(d){a.utils.extend(this,new a.html5.api(c,d));return this};return this}})(jwplayer);(function(b){var c=b.utils.css;b.html5.view=function(p,o,e){var s=p;var l=o;var v=e;var u;var f;var z;var q;var A;var n;function x(){u=document.createElement("div");u.id=l.id;u.className=l.className;_videowrapper=document.createElement("div");_videowrapper.id=u.id+"_video_wrapper";l.id=u.id+"_video";c(u,{position:"relative",height:v.height,width:v.width,padding:0,backgroundColor:B(),zIndex:0});function B(){if(s.skin.getComponentSettings("display")&&s.skin.getComponentSettings("display").backgroundcolor){return s.skin.getComponentSettings("display").backgroundcolor}return parseInt("000000",16)}c(l,{width:v.width,height:v.height,top:0,left:0,zIndex:1,margin:"auto",display:"block"});c(_videowrapper,{overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0});b.utils.wrap(l,u);b.utils.wrap(l,_videowrapper);q=document.createElement("div");q.id=u.id+"_displayarea";u.appendChild(q)}function j(){for(var B=0;B<v.plugins.order.length;B++){var C=v.plugins.order[B];if(v.plugins.object[C].getDisplayElement!==undefined){v.plugins.object[C].height=h(v.plugins.object[C].getDisplayElement().style.height);v.plugins.object[C].width=h(v.plugins.object[C].getDisplayElement().style.width);v.plugins.config[C].currentPosition=v.plugins.config[C].position}}t()}function t(C){if(v.getMedia()!==undefined){for(var B=0;B<v.plugins.order.length;B++){var D=v.plugins.order[B];if(v.plugins.object[D].getDisplayElement!==undefined){if(v.getMedia().hasChrome()){v.plugins.config[D].currentPosition=b.html5.view.positions.NONE}else{v.plugins.config[D].currentPosition=v.plugins.config[D].position}}}}i(v.width,v.height)}function h(B){if(typeof B=="string"){if(B===""){return 0}else{if(B.lastIndexOf("%")>-1){return B}else{return parseInt(B.replace("px",""),10)}}}return B}this.setup=function(B){l=B;x();j();s.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_LOADED,t);s.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_META,function(){w()});var C;if(window.onresize!==null){C=window.onresize}window.onresize=function(D){if(C!==undefined){try{C(D)}catch(F){}}if(s.jwGetFullscreen()){var E=document.body.getBoundingClientRect();v.width=Math.abs(E.left)+Math.abs(E.right);v.height=window.innerHeight}i(v.width,v.height)}};function g(B){switch(B.keyCode){case 27:if(s.jwGetFullscreen()){s.jwSetFullscreen(false)}break;case 32:if(s.jwGetState()!=b.api.events.state.IDLE&&s.jwGetState()!=b.api.events.state.PAUSED){s.jwPause()}else{s.jwPlay()}break}}function i(E,B){if(u.style.display=="none"){return}var D=[].concat(v.plugins.order);D.reverse();A=D.length+2;if(!v.fullscreen){v.width=E;v.height=B;f=E;z=B;c(q,{top:0,bottom:0,left:0,right:0,width:E,height:B});c(u,{height:z,width:f});var C=m(r,D);if(C.length>0){A+=C.length;m(k,C,true)}}else{if(navigator.vendor.indexOf("Apple")!==0){m(y,D,true)}}w()}function m(G,D,E){var C=[];for(var B=0;B<D.length;B++){var H=D[B];if(v.plugins.object[H].getDisplayElement!==undefined){if(v.plugins.config[H].currentPosition!=b.html5.view.positions.NONE){var F=G(H,A--);if(!F){C.push(H)}else{v.plugins.object[H].resize(F.width,F.height);if(E){delete F.width;delete F.height}c(v.plugins.object[H].getDisplayElement(),F)}}else{c(v.plugins.object[H].getDisplayElement(),{display:"none"})}}}return C}function r(C,D){if(v.plugins.object[C].getDisplayElement!==undefined){if(v.plugins.config[C].position&&a(v.plugins.config[C].position)){if(v.plugins.object[C].getDisplayElement().parentNode===null){u.appendChild(v.plugins.object[C].getDisplayElement())}var B=d(C);B.zIndex=D;return B}}return false}function k(D,E){if(v.plugins.object[D].getDisplayElement().parentNode===null){q.appendChild(v.plugins.object[D].getDisplayElement())}var B=v.width,C=v.height;if(typeof v.width=="string"&&v.width.lastIndexOf("%")>-1){percentage=parseFloat(v.width.substring(0,v.width.lastIndexOf("%")))/100;B=Math.round(window.innerWidth*percentage)}if(typeof v.height=="string"&&v.height.lastIndexOf("%")>-1){percentage=parseFloat(v.height.substring(0,v.height.lastIndexOf("%")))/100;C=Math.round(window.innerHeight*percentage)}return{position:"absolute",width:(B-h(q.style.left)-h(q.style.right)),height:(C-h(q.style.top)-h(q.style.bottom)),zIndex:E}}function y(B,C){return{position:"fixed",width:v.width,height:v.height,zIndex:C}}function w(){q.style.position="absolute";v.getMedia().getDisplayElement().style.position="absolute";if(v.getMedia().getDisplayElement().videoWidth==0||v.getMedia().getDisplayElement().videoHeight==0){return}var B,D;if(q.style.width.toString().lastIndexOf("%")>-1||q.style.width.toString().lastIndexOf("%")>-1){var C=q.getBoundingClientRect();B=Math.abs(C.left)+Math.abs(C.right);D=Math.abs(C.top)+Math.abs(C.bottom)}else{B=h(q.style.width);D=h(q.style.height)}b.utils.stretch(s.jwGetStretching(),v.getMedia().getDisplayElement(),B,D,v.getMedia().getDisplayElement().videoWidth,v.getMedia().getDisplayElement().videoHeight)}function d(C){var D={position:"absolute",margin:0,padding:0,top:null};var B=v.plugins.config[C].currentPosition.toLowerCase();switch(B.toUpperCase()){case b.html5.view.positions.TOP:D.top=h(q.style.top);D.left=h(q.style.left);D.width=f-h(q.style.left)-h(q.style.right);D.height=v.plugins.object[C].height;q.style[B]=h(q.style[B])+v.plugins.object[C].height+"px";q.style.height=h(q.style.height)-D.height+"px";break;case b.html5.view.positions.RIGHT:D.top=h(q.style.top);D.right=h(q.style.right);D.width=D.width=v.plugins.object[C].width;D.height=z-h(q.style.top)-h(q.style.bottom);q.style[B]=h(q.style[B])+v.plugins.object[C].width+"px";q.style.width=h(q.style.width)-D.width+"px";break;case b.html5.view.positions.BOTTOM:D.bottom=h(q.style.bottom);D.left=h(q.style.left);D.width=f-h(q.style.left)-h(q.style.right);D.height=v.plugins.object[C].height;q.style[B]=h(q.style[B])+v.plugins.object[C].height+"px";q.style.height=h(q.style.height)-D.height+"px";break;case b.html5.view.positions.LEFT:D.top=h(q.style.top);D.left=h(q.style.left);D.width=v.plugins.object[C].width;D.height=z-h(q.style.top)-h(q.style.bottom);q.style[B]=h(q.style[B])+v.plugins.object[C].width+"px";q.style.width=h(q.style.width)-D.width+"px";break;default:break}return D}this.resize=i;this.fullscreen=function(E){if(navigator.vendor.indexOf("Apple")===0){if(v.getMedia().getDisplayElement().webkitSupportsFullscreen){if(E){try{v.getMedia().getDisplayElement().webkitEnterFullscreen()}catch(D){}}else{try{v.getMedia().getDisplayElement().webkitExitFullscreen()}catch(D){}}}}else{if(E){document.onkeydown=g;clearInterval(n);var C=document.body.getBoundingClientRect();v.width=Math.abs(C.left)+Math.abs(C.right);v.height=window.innerHeight;var B={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483000};c(u,B);B.zIndex=1;c(v.getMedia().getDisplayElement(),B);B.zIndex=2;c(q,B)}else{document.onkeydown="";v.width=f;v.height=z;c(u,{position:"relative",height:v.height,width:v.width,zIndex:0})}i(v.width,v.height)}}};function a(d){return([b.html5.view.positions.TOP,b.html5.view.positions.RIGHT,b.html5.view.positions.BOTTOM,b.html5.view.positions.LEFT].toString().indexOf(d.toUpperCase())>-1)}b.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}})(jwplayer);(function(a){var b={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:a.html5.view.positions.BOTTOM,idlehide:false,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_css=a.utils.css;_hide=function(c){_css(c,{display:"none"})};_show=function(c){_css(c,{display:"block"})};a.html5.controlbar=function(k,M){var j=k;var A=a.utils.extend({},b,j.skin.getComponentSettings("controlbar"),M);if(A.position==a.html5.view.positions.NONE||typeof a.html5.view.positions[A.position]=="undefined"){return}if(a.utils.mapLength(j.skin.getComponentLayout("controlbar"))>0){A.layout=j.skin.getComponentLayout("controlbar")}var R;var J;var Q;var B;var t="none";var f;var i;var S;var e;var d;var w;var K={};var o=false;var c={};var O;var h=false;function E(){if(!O){O=j.skin.getSkinElement("controlbar","background");if(!O){O={width:0,height:0,src:null}}}return O}function I(){Q=0;B=0;J=0;if(!o){var Z={height:E().height,backgroundColor:A.backgroundcolor};R=document.createElement("div");R.id=j.id+"_jwplayer_controlbar";_css(R,Z)}var Y=(j.skin.getSkinElement("controlbar","capLeft"));var X=(j.skin.getSkinElement("controlbar","capRight"));if(Y){v("capLeft","left",false,R)}var aa={position:"absolute",height:E().height,left:(Y?Y.width:0),zIndex:0};P("background",R,aa,"img");if(E().src){K.background.src=E().src}aa.zIndex=1;P("elements",R,aa);if(X){v("capRight","right",false,R)}}this.getDisplayElement=function(){return R};this.resize=function(Z,X){a.utils.cancelAnimation(R);document.getElementById(j.id).onmousemove=x;d=Z;w=X;x();var Y=u();D({id:j.id,duration:S,position:i});s({id:j.id,bufferPercent:e});return Y};this.show=function(){h=false;_show(R)};this.hide=function(){h=true;_hide(R)};function p(){var Y=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"];for(var Z in Y){var X=Y[Z];if(typeof K[X]!="undefined"){c[X]=K[X].getBoundingClientRect()}}}function x(){if(h){return}a.utils.cancelAnimation(R);if(g()){a.utils.fadeTo(R,1,0,1,0)}else{a.utils.fadeTo(R,0,0.1,1,2)}}function g(){if(h){return false}if(j.jwGetState()==a.api.events.state.IDLE||j.jwGetState()==a.api.events.state.PAUSED){if(A.idlehide){return false}return true}if(j.jwGetFullscreen()){return false}if(A.position==a.html5.view.positions.OVER){return false}return true}function P(ab,aa,Z,X){var Y;if(!o){if(!X){X="div"}Y=document.createElement(X);K[ab]=Y;Y.id=R.id+"_"+ab;aa.appendChild(Y)}else{Y=document.getElementById(R.id+"_"+ab)}if(Z!==undefined){_css(Y,Z)}return Y}function H(){W(A.layout.left);W(A.layout.right,-1);W(A.layout.center)}function W(aa,X){var ab=aa.position=="right"?"right":"left";var Z=a.utils.extend([],aa.elements);if(X!==undefined){Z.reverse()}for(var Y=0;Y<Z.length;Y++){z(Z[Y],ab)}}function F(){return J++}function z(ab,ad){var aa,Y,Z,X,af;if(ab.type=="divider"){v("divider"+F(),ad,true,undefined,undefined,ab.width,ab.element);return}switch(ab.name){case"play":v("playButton",ad,false);v("pauseButton",ad,true);L("playButton","jwPlay");L("pauseButton","jwPause");break;case"prev":v("prevButton",ad,true);L("prevButton","jwPlaylistPrev");break;case"next":v("nextButton",ad,true);L("nextButton","jwPlaylistNext");break;case"elapsed":v("elapsedText",ad,true);break;case"time":Y=j.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:j.skin.getSkinElement("controlbar","timeSliderCapLeft").width;Z=j.skin.getSkinElement("controlbar","timeSliderCapRight")===undefined?0:j.skin.getSkinElement("controlbar","timeSliderCapRight").width;aa=ad=="left"?Y:Z;X=j.skin.getSkinElement("controlbar","timeSliderRail").width+Y+Z;af={height:E().height,position:"absolute",top:0,width:X};af[ad]=ad=="left"?Q:B;var ac=P("timeSlider",K.elements,af);v("timeSliderCapLeft",ad,true,ac,ad=="left"?0:aa);v("timeSliderRail",ad,false,ac,aa);v("timeSliderBuffer",ad,false,ac,aa);v("timeSliderProgress",ad,false,ac,aa);v("timeSliderThumb",ad,false,ac,aa);v("timeSliderCapRight",ad,true,ac,ad=="right"?0:aa);N("time");break;case"fullscreen":v("fullscreenButton",ad,false);v("normalscreenButton",ad,true);L("fullscreenButton","jwSetFullscreen",true);L("normalscreenButton","jwSetFullscreen",false);break;case"volume":Y=j.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:j.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;Z=j.skin.getSkinElement("controlbar","volumeSliderCapRight")===undefined?0:j.skin.getSkinElement("controlbar","volumeSliderCapRight").width;aa=ad=="left"?Y:Z;X=j.skin.getSkinElement("controlbar","volumeSliderRail").width+Y+Z;af={height:E().height,position:"absolute",top:0,width:X};af[ad]=ad=="left"?Q:B;var ae=P("volumeSlider",K.elements,af);v("volumeSliderCapLeft",ad,true,ae,ad=="left"?0:aa);v("volumeSliderRail",ad,true,ae,aa);v("volumeSliderProgress",ad,false,ae,aa);v("volumeSliderCapRight",ad,true,ae,ad=="right"?0:aa);N("volume");break;case"mute":v("muteButton",ad,false);v("unmuteButton",ad,true);L("muteButton","jwSetMute",true);L("unmuteButton","jwSetMute",false);break;case"duration":v("durationText",ad,true);break}}function v(aa,ad,Y,ag,ab,X,Z){if(j.skin.getSkinElement("controlbar",aa)!==undefined||aa.indexOf("Text")>0||aa.indexOf("divider")===0){var ac={height:E().height,position:"absolute",display:"block",top:0};if((aa.indexOf("next")===0||aa.indexOf("prev")===0)&&j.jwGetPlaylist().length<2){Y=false;ac.display="none"}var ah;if(aa.indexOf("Text")>0){aa.innerhtml="00:00";ac.font=A.fontsize+"px/"+(E().height+1)+"px "+A.font;ac.color=A.fontcolor;ac.textAlign="center";ac.fontWeight=A.fontweight;ac.fontStyle=A.fontstyle;ac.cursor="default";ah=14+3*A.fontsize}else{if(aa.indexOf("divider")===0){if(X){if(!isNaN(parseInt(X))){ah=parseInt(X)}}else{if(Z){var ae=j.skin.getSkinElement("controlbar",Z);if(ae){ac.background="url("+ae.src+") repeat-x center left";ah=ae.width}}else{ac.background="url("+j.skin.getSkinElement("controlbar","divider").src+") repeat-x center left";ah=j.skin.getSkinElement("controlbar","divider").width}}}else{ac.background="url("+j.skin.getSkinElement("controlbar",aa).src+") repeat-x center left";ah=j.skin.getSkinElement("controlbar",aa).width}}if(ad=="left"){ac.left=isNaN(ab)?Q:ab;if(Y){Q+=ah}}else{if(ad=="right"){ac.right=isNaN(ab)?B:ab;if(Y){B+=ah}}}if(a.utils.typeOf(ag)=="undefined"){ag=K.elements}ac.width=ah;if(o){_css(K[aa],ac)}else{var af=P(aa,ag,ac);if(j.skin.getSkinElement("controlbar",aa+"Over")!==undefined){af.onmouseover=function(ai){af.style.backgroundImage=["url(",j.skin.getSkinElement("controlbar",aa+"Over").src,")"].join("")};af.onmouseout=function(ai){af.style.backgroundImage=["url(",j.skin.getSkinElement("controlbar",aa).src,")"].join("")}}}}}function C(){j.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,y);j.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_BUFFER,s);j.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,q);j.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_TIME,D);j.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,V);j.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_VOLUME,l);j.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_COMPLETE,G)}function y(){I();H();u();T()}function T(){D({id:j.id,duration:j.jwGetDuration(),position:0});s({id:j.id,bufferProgress:0});V({id:j.id,mute:j.jwGetMute()});q({id:j.id,newstate:a.api.events.state.IDLE});l({id:j.id,volume:j.jwGetVolume()})}function L(Z,aa,Y){if(o){return}if(j.skin.getSkinElement("controlbar",Z)!==undefined){var X=K[Z];if(X!==null){_css(X,{cursor:"pointer"});if(aa=="fullscreen"){X.onmouseup=function(ab){ab.stopPropagation();j.jwSetFullscreen(!j.jwGetFullscreen())}}else{X.onmouseup=function(ab){ab.stopPropagation();if(Y!==null){j[aa](Y)}else{j[aa]()}}}}}}function N(X){if(o){return}var Y=K[X+"Slider"];_css(K.elements,{cursor:"pointer"});_css(Y,{cursor:"pointer"});Y.onmousedown=function(Z){t=X};Y.onmouseup=function(Z){Z.stopPropagation();U(Z.pageX)};Y.onmousemove=function(Z){if(t=="time"){f=true;var aa=Z.pageX-c[X+"Slider"].left-window.pageXOffset;_css(K.timeSliderThumb,{left:aa})}}}function U(Y){f=false;var X;if(t=="time"){X=Y-c.timeSliderRail.left+window.pageXOffset;var aa=X/c.timeSliderRail.width*S;if(aa<0){aa=0}else{if(aa>S){aa=S-3}}if(j.jwGetState()==a.api.events.state.PAUSED||j.jwGetState()==a.api.events.state.IDLE){j.jwPlay()}j.jwSeek(aa)}else{if(t=="volume"){X=Y-c.volumeSliderRail.left-window.pageXOffset;var Z=Math.round(X/c.volumeSliderRail.width*100);if(Z<0){Z=0}else{if(Z>100){Z=100}}if(j.jwGetMute()){j.jwSetMute(false)}j.jwSetVolume(Z)}}t="none"}function s(Y){if(Y.bufferPercent!==null){e=Y.bufferPercent}if(c.timeSliderRail){var Z=c.timeSliderRail.width;var X=isNaN(Math.round(Z*e/100))?0:Math.round(Z*e/100);_css(K.timeSliderBuffer,{width:X})}}function V(X){if(X.mute){_hide(K.muteButton);_show(K.unmuteButton);_hide(K.volumeSliderProgress)}else{_show(K.muteButton);_hide(K.unmuteButton);_show(K.volumeSliderProgress)}}function q(X){if(X.newstate==a.api.events.state.BUFFERING||X.newstate==a.api.events.state.PLAYING){_show(K.pauseButton);_hide(K.playButton)}else{_hide(K.pauseButton);_show(K.playButton)}x();if(X.newstate==a.api.events.state.IDLE){_hide(K.timeSliderBuffer);_hide(K.timeSliderProgress);_hide(K.timeSliderThumb);D({id:j.id,duration:j.jwGetDuration(),position:0})}else{_show(K.timeSliderBuffer);if(X.newstate!=a.api.events.state.BUFFERING){_show(K.timeSliderProgress);_show(K.timeSliderThumb)}}}function G(X){s({bufferPercent:0});D(a.utils.extend(X,{position:0,duration:S}))}function D(aa){if(aa.position!==null){i=aa.position}if(aa.duration!==null){S=aa.duration}var Y=(i===S===0)?0:i/S;var ab=c.timeSliderRail;if(ab){var X=isNaN(Math.round(ab.width*Y))?0:Math.round(ab.width*Y);var Z=X;if(K.timeSliderProgress){K.timeSliderProgress.style.width=X+"px";if(!f){if(K.timeSliderThumb){K.timeSliderThumb.style.left=Z+"px"}}}}if(K.durationText){K.durationText.innerHTML=n(S)}if(K.elapsedText){K.elapsedText.innerHTML=n(i)}}function n(X){str="00:00";if(X>0){str=Math.floor(X/60)<10?"0"+Math.floor(X/60)+":":Math.floor(X/60)+":";str+=Math.floor(X%60)<10?"0"+Math.floor(X%60):Math.floor(X%60)}return str}function m(){var aa,Y;var Z=document.getElementById(R.id+"_elements").childNodes;for(var X in document.getElementById(R.id+"_elements").childNodes){if(isNaN(parseInt(X,10))){continue}if(Z[X].id.indexOf(R.id+"_divider")===0&&Y&&Y.id.indexOf(R.id+"_divider")===0&&Z[X].style.backgroundImage==Y.style.backgroundImage){Z[X].style.display="none"}else{if(Z[X].id.indexOf(R.id+"_divider")===0&&aa&&aa.style.display!="none"){Z[X].style.display="block"}}if(Z[X].style.display!="none"){Y=Z[X]}aa=Z[X]}}function u(){m();if(j.jwGetFullscreen()){_show(K.normalscreenButton);_hide(K.fullscreenButton)}else{_hide(K.normalscreenButton);_show(K.fullscreenButton)}var Y={width:d};var X={};if(A.position==a.html5.view.positions.OVER||j.jwGetFullscreen()){Y.left=A.margin;Y.width-=2*A.margin;Y.top=w-E().height-A.margin;Y.height=E().height}else{Y.left=0}var aa=j.skin.getSkinElement("controlbar","capLeft");var Z=j.skin.getSkinElement("controlbar","capRight");X.left=aa?aa.width:0;X.width=Y.width-X.left-(Z?Z.width:0);var ab=j.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:j.skin.getSkinElement("controlbar","timeSliderCapLeft").width;_css(K.timeSliderRail,{width:(X.width-Q-B),left:ab});if(K.timeSliderCapRight!==undefined){_css(K.timeSliderCapRight,{left:ab+(X.width-Q-B)})}_css(R,Y);_css(K.elements,X);_css(K.background,X);p();return Y}function l(ab){if(K.volumeSliderRail!==undefined){var Z=isNaN(ab.volume/100)?1:ab.volume/100;var aa=parseInt(K.volumeSliderRail.style.width.replace("px",""),10);var X=isNaN(Math.round(aa*Z))?0:Math.round(aa*Z);var ac=parseInt(K.volumeSliderRail.style.right.replace("px",""),10);var Y=j.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:j.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;_css(K.volumeSliderProgress,{width:X,left:Y});if(K.volumeSliderCapLeft!==undefined){_css(K.volumeSliderCapLeft,{left:0})}}}function r(){I();H();p();o=true;C();T();R.style.opacity=A.idlehide?0:1}r();return this}})(jwplayer);(function(b){var a=["width","height","state","playlist","item","position","buffer","duration","volume","mute","fullscreen"];b.html5.controller=function(t,r,e,q){var w=t;var y=e;var d=q;var k=r;var A=true;var c=-1;var u=(y.config.debug!==undefined)&&(y.config.debug.toString().toLowerCase()=="console");var i=new b.html5.eventdispatcher(k.id,u);b.utils.extend(this,i);function m(D){i.sendEvent(D.type,D)}y.addGlobalListener(m);function p(){try{if(y.playlist[y.item].levels[0].file.length>0){if(A||y.state==b.api.events.state.IDLE){y.addEventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){y.getMedia().play()});y.addEventListener(b.api.events.JWPLAYER_MEDIA_TIME,function(E){if(E.position>=y.playlist[y.item].start&&c>=0){y.playlist[y.item].start=c;c=-1}});if(y.config.repeat){y.addEventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,function(E){setTimeout(n,25)})}y.getMedia().load(y.playlist[y.item]);A=false}else{if(y.state==b.api.events.state.PAUSED){y.getMedia().play()}}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function B(){try{if(y.playlist[y.item].levels[0].file.length>0){switch(y.state){case b.api.events.state.PLAYING:case b.api.events.state.BUFFERING:y.getMedia().pause();break}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function x(D){try{if(y.playlist[y.item].levels[0].file.length>0){if(typeof D!="number"){D=parseFloat(D)}switch(y.state){case b.api.events.state.IDLE:if(c<0){c=y.playlist[y.item].start;y.playlist[y.item].start=D}p();break;case b.api.events.state.PLAYING:case b.api.events.state.PAUSED:case b.api.events.state.BUFFERING:y.seek(D);break}}return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}function j(){try{if(y.playlist[y.item].levels[0].file.length>0&&y.state!=b.api.events.state.IDLE){y.getMedia().stop()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function g(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item+1==y.playlist.length){o(0)}else{o(y.item+1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function f(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item===0){o(y.playlist.length-1)}else{o(y.item-1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function s(){var D=null;if(y.playlist.length>1){while(D===null){D=Math.floor(Math.random()*y.playlist.length);if(D==y.item){D=null}}}else{D=0}return D}function o(E){y.resetEventListeners();y.addGlobalListener(m);try{if(y.playlist[E].levels[0].file.length>0){var F=y.state;if(F!==b.api.events.state.IDLE){j()}y.item=E;A=true;y.setActiveMediaProvider(y.playlist[y.item]);i.sendEvent(b.api.events.JWPLAYER_PLAYLIST_ITEM,{index:E});if(F==b.api.events.state.PLAYING||F==b.api.events.state.BUFFERING||y.config.chromeless||e.config.autostart===true){p()}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function z(E){try{switch(typeof(E)){case"number":y.getMedia().volume(E);break;case"string":y.getMedia().volume(parseInt(E,10));break}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function l(E){try{if(typeof E=="undefined"){y.getMedia().mute(!y.mute)}else{if(E.toString().toLowerCase()=="true"){y.getMedia().mute(true)}else{y.getMedia().mute(false)}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function h(E,D){try{y.width=E;y.height=D;d.resize(E,D);i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});return true}catch(F){i.sendEvent(b.api.events.JWPLAYER_ERROR,F)}return false}function v(E){try{if(typeof E=="undefined"){y.fullscreen=!y.fullscreen;d.fullscreen(!y.fullscreen)}else{if(E.toString().toLowerCase()=="true"){y.fullscreen=true;d.fullscreen(true)}else{y.fullscreen=false;d.fullscreen(false)}}i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});i.sendEvent(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:E});return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function C(D){try{j();y.loadPlaylist(D);o(y.item);return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}b.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};function n(){y.resetEventListeners();y.addGlobalListener(m);switch(y.config.repeat.toUpperCase()){case b.html5.controller.repeatoptions.SINGLE:p();break;case b.html5.controller.repeatoptions.ALWAYS:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0);p()}else{g()}break;case b.html5.controller.repeatoptions.LIST:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0)}else{g()}break}}this.play=p;this.pause=B;this.seek=x;this.stop=j;this.next=g;this.prev=f;this.item=o;this.setVolume=z;this.setMute=l;this.resize=h;this.setFullscreen=v;this.load=C}})(jwplayer);(function(a){a.html5.defaultSkin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.0"><settings><setting name="backcolor" value="0xFFFFFF"/><setting name="frontcolor" value="0x000000"/><setting name="lightcolor" value="0x000000"/><setting name="screencolor" value="0x000000"/></settings><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFJJREFUeNrslLENwAAIwxLU/09j5AiOgD5hVQzNAVY8JK4qEfHMIKBnd2+BQlBINaiRtL/aV2rdzYBsM6CIONbI1NZENTr3RwdB2PlnJgJ6BRgA4hwu5Qg5iswAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNpiYqABYBo1dNRQ+hr6H4jvA3E8NS39j4SpZvh/LJig4YxEGEqy3kET+w+AOGFQRhTJhrEQkGcczfujhg4CQwECDADpTRWU/B3wHQAAAABJRU5ErkJggg=="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAChJREFUeNpiYBgFo2DwA0YC8v/R1P4nRu+ooaOGUtnQUTAKhgIACDAAFCwQCfAJ4gwAAAAASUVORK5CYII="/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEtJREFUeNpiYBgFo2Dog/9QDAPyQHweTYwiQ/2B+D0Wi8g2tB+JTdBQRiIMJVkvEy0iglhDF9Aq9uOpHVEwoE+NJDUKRsFgAAABBgDe2hqZcNNL0AAAAABJRU5ErkJggg=="/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUeNpiYBgFo2Dog/9AfB6I5dHE/lNqKAi/B2J/ahsKw/3EGMpIhKEk66WJoaR6fz61IyqemhEFSlL61ExSo2AUDAYAEGAAiG4hj+5t7M8AAAAASUVORK5CYII="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADxJREFUeNpiYBgFo2AU0Bwwzluw+D8tLWARFhKiqQ9YuLg4aWsBGxs7bS1gZ6e5BWyjSX0UjIKhDgACDABlYQOGh5pYywAAAABJRU5ErkJggg=="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFo2AU0Bww1jc0/aelBSz8/Pw09QELOzs7bS1gY2OjrQWsrKy09gHraFIfBaNgqAOAAAMAvy0DChXHsZMAAAAASUVORK5CYII="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiYBgFo2AU0BwwAvF/WlrARGsfjFow8BaMglEwCugAAAIMAOHfAQunR+XzAAAAAElFTkSuQmCC"/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAICAYAAAA870V8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpiZICA/yCCiQEJUJcDEGAAY0gBD1/m7Q0AAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiYBgFIw3MB+L/5Gj8j6yRiRTFyICJXHfTXyMLAXlGati4YDRFDj8AEGAABk8GSqqS4CoAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFgxz8p7bm+cQa+h8LHy7GhEcjIz4bmAjYykiun/8j0fakGPIfTfPgiSr6aB4FVAcAAQYAWdwR1G1Wd2gAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGpJREFUeNpi/P//PwM9ABMDncCoRYPfIqqDZcuW1UPp/6AUDcNM1DQYKtRAlaAj1mCSLSLXYIIWUctgDItoZfDA5aOoqKhGEANIM9LVR7SymGDQUctikuOIXkFNdhHEOFrDjlpEd4sAAgwAriRMub95fu8AAAAASUVORK5CYII="/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFtJREFUeNpi/P//PwM9ABMDncCoRYPfIlqAeij9H5SiYZiqBqPTlFqE02BKLSLaYFItIttgQhZRzWB8FjENiuRJ7aAbsMQwYMl7wDIsWUUQ42gNO2oR3S0CCDAAKhKq6MLLn8oAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE5JREFUeNpiYBgFo2DQA0YC8v/xqP1PjDlMRDrEgUgxkgHIlfZoriVGjmzLsLFHAW2D6D8eA/9Tw7L/BAwgJE90PvhPpNgoGAVDEQAEGAAMdhTyXcPKcAAAAABJRU5ErkJggg=="/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEZJREFUeNpiYBgFo2DIg/9UUkOUAf8JiFFsyX88fJyAkcQgYMQjNkzBoAgiezyRbE+tFGSPxQJ7auYBmma0UTAKBhgABBgAJAEY6zON61sAAAAASUVORK5CYII="/></elements></component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC"/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg=="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNrs1jEOgCAMBVAg7t5/8qaoIy4uoobyXsLCxA+0NCUAAADGUWvdQoQ41x4ixNBB2hBvBskdD3w5ZCkl3+33VqI0kjBBlh9rp+uTcyOP33TnolfsU85XX3yIRpQph8ZQY3wTZtU5AACASA4BBgDHoVuY1/fvOQAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWlJREFUeNrsl+1twjAQhsHq/7BBYQLYIBmBDcoGMAIjtBPQTcII2SDtBDBBwrU6pGsUO7YbO470PtKJkz9iH++d4ywWAAAAAABgljRNsyWr2bZzDuJG1rLdZhcMbTjrBCGDyUKsqQLFciJb9bSvuG/WagRVRUVUI6gqy5HVeKWfSgRyJruKIU//TrZTSn2nmlaXThrloi/v9F2STC1W4+Aw5cBzkquRc09bofFNc6YLxEON0VUZS5FPTftO49vMjRsIF3RhOGr7/D/pJw+FKU+q0vDyq8W42jCunDqI3LC5XxNj2wHLU1XjaRnb0Lhykhqhhd8MtSF5J9tbjCv4mXGvKJz/65FF/qJryyaaIvzP2QRxZTX2nTuXjvV/VPFSwyLnW7mpH99yTh1FEVro6JBSd40/pMrRdV8vPtcKl28T2pT8TnFZ4yNosct3Q0io6JfBiz1FlGdqVQH3VHnepAEAAAAAADDzEGAAcTwB10jWgxcAAAAASUVORK5CYII="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuhJREFUeNrsWr9rU1EUznuNGqvFQh1ULOhiBx0KDtIuioO4pJuik3FxFfUPaAV1FTdx0Q5d2g4FFxehTnEpZHFoBy20tCIWtGq0TZP4HfkeHB5N8m6Sl/sa74XDybvv3vvOd8/Pe4lXrVZT3dD8VJc0B8QBcUAcEAfESktHGeR5XtMfqFQq/f92zPe/NbtGlKTdCY30kuxrpMGO94BlQCXs+rbh3ONgA6BlzP1p20d80gEI5hmA2A92Qua1Q2PtAFISM+bvjMG8U+Q7oA3rQGASwrYCU6WpNdLGYbA+Pq5jjXIiwi8EEa2UDbQSaKOIuV+SlkcCrfjY8XTI9EpKGwP0C2kru2hLtHqa4zoXtZRWyvi4CLwv9Opr6Hkn6A9HKgEANsQ1iqC3Ub/vRUk2JgmRkatK36kVrnt0qObunwUdUUMXMWYpakJsO5Am8tAw2GBIgwWA+G2S2dMpiw0gDioQRQJoKhRb1QiDwlHZUABYbaXWsm5ae6loTE4ZDxN4CZar8foVzOJ2iyZ2kWF3t7YIevffaMT5yJ70kQb2fQ1sE5SHr2wazs2wgMxgbsEKEAgxAvZUJbQLBGTSBMgNrncJbA6AljtS/eKDJ0Ez+DmrQEzXS2h1Ck25kAg0IZcUOaydCy4sYnN2fOA+2AP16gNoHALlQ+fwH7XO4CxLenUpgj4xr6ugY2roPMbMx+Xs18m/E8CVEIhxsNeg83XWOAN6grG3lGbk8uE5fr4B/WH3cJw+co/l9nTYsSGYCJ/lY5/qv0thn6nrIWmjeJcPSnWOeY++AkF8tpJHIMAUs/MaBBpj3znZfQo5psY+ZrG4gv5HickjEOymKjEeRpgyST6IuZcTcWbnjcgdPi5ghxciRKsl1lDSsgwA1i8fssonJgzmTSqfGUkCENndNdAL7PS6QQ7ZYISTo+1qq0LEWjTWcvY4isa4z+yfQB+7ooyHVg5RI7/i1Ijn/vnggDggDogD4oC00P4KMACd/juEHOrS4AAAAABJRU5ErkJggg=="/></elements></component><component name="dock"><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFBJREFUeNrs0cEJACAQA8Eofu0fu/W6EM5ZSAFDRpKTBs00CQQEBAQEBAQEBAQEBAQEBATkK8iqbY+AgICAgICAgICAgICAgICAgIC86QowAG5PAQzEJ0lKAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNrs2NEJwCAMBcBYuv/CFuIE9VN47WWCR7iocXR3pdWdGPqqwIoMjYfQeAiNh9B4JHc6MHQVHnjggQceeOCBBx77TifyeOY0iHi8DqIdEY8dD5cL094eePzINB5CO/LwcOTptNB4CP25L4TIbZzpU7UEGAA5wz1uF5rF9AAAAABJRU5ErkJggg=="/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUeNrsy6ENACAMAMHClp2wYxZLAg5Fcu9e3OjuOKqqfTMzbs14CIZhGIZhGIZhGP4VLwEGAK/BBnVFpB0oAAAAAElFTkSuQmCC"/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNrsy7ENACAMBLE8++8caFFKKiRffU53112SGs3ttOohGIZhGIZhGIZh+Fe8BRgAiaUGde6NOSEAAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(a){_css=a.utils.css;_hide=function(b){_css(b,{display:"none"})};_show=function(b){_css(b,{display:"block"})};a.html5.display=function(o,z){var r={icons:true};var j=a.utils.extend({},r,z);var w=o;var d={};var f;var A;var k;var x;var y;var p;var i;var n=w.skin.getComponentSettings("display").bufferrotation===undefined?15:parseInt(w.skin.getComponentSettings("display").bufferrotation,10);var e=w.skin.getComponentSettings("display").bufferinterval===undefined?100:parseInt(w.skin.getComponentSettings("display").bufferinterval,10);var c={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:u},display_icon:{style:{cursor:"pointer",position:"absolute",top:((w.skin.getSkinElement("display","background").height-w.skin.getSkinElement("display","playIcon").height)/2),left:((w.skin.getSkinElement("display","background").width-w.skin.getSkinElement("display","playIcon").width)/2),border:0,margin:0,padding:0,zIndex:3}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:((A-w.skin.getSkinElement("display","background").height)/2),left:((f-w.skin.getSkinElement("display","background").width)/2),border:0,backgroundImage:(["url(",w.skin.getSkinElement("display","background").src,")"]).join(""),width:w.skin.getSkinElement("display","background").width,height:w.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2}},display_image:{style:{display:"none",width:f,height:A,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:0.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}};w.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,l);w.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,l);w.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,l);w.jwAddEventListener(a.api.events.JWPLAYER_ERROR,t);B();function B(){d.display=s("div","display");d.display_text=s("div","display_text");d.display.appendChild(d.display_text);d.display_image=s("img","display_image");d.display_image.onerror=function(C){_hide(d.display_image)};d.display_image.onload=m;d.display_icon=s("div","display_icon");d.display_iconBackground=s("div","display_iconBackground");d.display.appendChild(d.display_image);d.display_iconBackground.appendChild(d.display_icon);d.display.appendChild(d.display_iconBackground);b()}this.getDisplayElement=function(){return d.display};this.resize=function(D,C){f=D;A=C;_css(d.display,{width:D,height:C});_css(d.display_text,{width:(D-10),top:((A-d.display_text.getBoundingClientRect().height)/2)});_css(d.display_iconBackground,{top:((A-w.skin.getSkinElement("display","background").height)/2),left:((f-w.skin.getSkinElement("display","background").width)/2)});h();l({})};this.show=function(){_show(d.display_icon);_show(d.display_iconBackground)};this.hide=function(){q()};function m(C){k=d.display_image.naturalWidth;x=d.display_image.naturalHeight;h()}function h(){a.utils.stretch(w.jwGetStretching(),d.display_image,f,A,k,x)}function s(C,E){var D=document.createElement(C);D.id=w.id+"_jwplayer_"+E;_css(D,c[E].style);return D}function b(){for(var C in d){if(c[C].click!==undefined){d[C].onclick=c[C].click}}}function u(C){if(typeof C.preventDefault!="undefined"){C.preventDefault()}else{C.returnValue=false}if(w.jwGetState()!=a.api.events.state.PLAYING){w.jwPlay()}else{w.jwPause()}}function g(C){if(i||!j.icons){q();return}_show(d.display_iconBackground);d.display_icon.style.backgroundImage=(["url(",w.skin.getSkinElement("display",C).src,")"]).join("");_css(d.display_icon,{display:"block",width:w.skin.getSkinElement("display",C).width,height:w.skin.getSkinElement("display",C).height,top:(w.skin.getSkinElement("display","background").height-w.skin.getSkinElement("display",C).height)/2,left:(w.skin.getSkinElement("display","background").width-w.skin.getSkinElement("display",C).width)/2});if(w.skin.getSkinElement("display",C+"Over")!==undefined){d.display_icon.onmouseover=function(D){d.display_icon.style.backgroundImage=["url(",w.skin.getSkinElement("display",C+"Over").src,")"].join("")};d.display_icon.onmouseout=function(D){d.display_icon.style.backgroundImage=["url(",w.skin.getSkinElement("display",C).src,")"].join("")}}else{d.display_icon.onmouseover=null;d.display_icon.onmouseout=null}}function q(){_hide(d.display_icon);_hide(d.display_iconBackground)}function t(C){i=true;q();d.display_text.innerHTML=C.error;_show(d.display_text);d.display_text.style.top=((A-d.display_text.getBoundingClientRect().height)/2)+"px"}function v(){var C=d.display_image;d.display_image=s("img","display_image");d.display_image.onerror=function(D){_hide(d.display_image)};d.display_image.onload=m;d.display.replaceChild(d.display_image,C)}function l(C){if((C.type==a.api.events.JWPLAYER_PLAYER_STATE||C.type==a.api.events.JWPLAYER_PLAYLIST_ITEM)&&i){i=false;_hide(d.display_text)}if(p!==undefined){clearInterval(p);p=null;a.utils.animations.rotate(d.display_icon,0)}switch(w.jwGetState()){case a.api.events.state.BUFFERING:g("bufferIcon");y=0;p=setInterval(function(){y+=n;a.utils.animations.rotate(d.display_icon,y%360)},e);g("bufferIcon");break;case a.api.events.state.PAUSED:if(w.jwGetPlaylist()[w.jwGetItem()].provider!="sound"){_css(d.display_image,{background:"transparent no-repeat center center"})}g("playIcon");break;case a.api.events.state.IDLE:if(w.jwGetPlaylist()[w.jwGetItem()].image){_css(d.display_image,{display:"block"});d.display_image.src=a.utils.getAbsolutePath(w.jwGetPlaylist()[w.jwGetItem()].image)}else{v()}g("playIcon");break;default:if(w.jwGetMute()&&j.showmute){if(w.jwGetPlaylist()[w.jwGetItem()].provider!="sound"){v()}g("muteIcon")}else{if(w.jwGetPlaylist()[w.jwGetItem()].provider!="sound"){v()}_hide(d.display_iconBackground);_hide(d.display_icon)}break}}return this}})(jwplayer);(function(a){_css=a.utils.css;a.html5.dock=function(g,c){function f(){return{align:a.html5.view.positions.RIGHT}}var k=a.utils.extend({},f(),c);if(k.align=="FALSE"){return}var h={};var b=[];var d;var e;var j=document.createElement("div");j.id=g.id+"_jwplayer_dock";this.getDisplayElement=function(){return j};this.setButton=function(o,l,m,n){if(!l&&h[o]){a.utils.arrays.remove(b,o);j.removeChild(h[o].div);delete h[o]}else{if(l){if(!h[o]){h[o]={}}h[o].handler=l;h[o].outGraphic=m;h[o].overGraphic=n;if(!h[o].div){b.push(o);h[o].div=document.createElement("div");h[o].div.style.position="relative";j.appendChild(h[o].div);h[o].div.appendChild(document.createElement("img"));h[o].div.childNodes[0].style.position="absolute";h[o].div.childNodes[0].style.left=0;h[o].div.childNodes[0].style.top=0;h[o].div.childNodes[0].style.zIndex=10;h[o].div.childNodes[0].style.cursor="pointer";h[o].div.appendChild(document.createElement("img"));h[o].div.childNodes[1].style.position="absolute";h[o].div.childNodes[1].style.left=0;h[o].div.childNodes[1].style.top=0;if(g.skin.getSkinElement("dock","button")){h[o].div.childNodes[1].src=g.skin.getSkinElement("dock","button").src}h[o].div.childNodes[1].style.zIndex=9;h[o].div.childNodes[1].style.cursor="pointer";h[o].div.onmouseover=function(){if(h[o].overGraphic){h[o].div.childNodes[0].src=h[o].overGraphic}if(g.skin.getSkinElement("dock","buttonOver")){h[o].div.childNodes[1].src=g.skin.getSkinElement("dock","buttonOver").src}};h[o].div.onmouseout=function(){if(h[o].outGraphic){h[o].div.childNodes[0].src=h[o].outGraphic}if(g.skin.getSkinElement("dock","button")){h[o].div.childNodes[1].src=g.skin.getSkinElement("dock","button").src}};if(h[o].overGraphic){h[o].div.childNodes[0].src=h[o].overGraphic}if(h[o].outGraphic){h[o].div.childNodes[0].src=h[o].outGraphic}if(g.skin.getSkinElement("dock","button")){h[o].div.childNodes[1].src=g.skin.getSkinElement("dock","button").src}}if(l){h[o].div.onclick=function(p){p.preventDefault();a(g.id).callback(o);if(h[o].overGraphic){h[o].div.childNodes[0].src=h[o].overGraphic}if(g.skin.getSkinElement("dock","button")){h[o].div.childNodes[1].src=g.skin.getSkinElement("dock","button").src}}}}}i(d,e)};function i(n,l){d=n;e=l;if(b.length>0){var p=10;var r=n-g.skin.getSkinElement("dock","button").width-p;var o=p;var q=-1;if(k.align==a.html5.view.positions.LEFT){q=1;r=p}for(var m=0;m<b.length;m++){var s=Math.floor(o/l);if((o+g.skin.getSkinElement("dock","button").height+p)>((s+1)*l)){o=((s+1)*l)+p;s=Math.floor(o/l)}h[b[m]].div.style.top=(o%l)+"px";h[b[m]].div.style.left=(r+(g.skin.getSkinElement("dock","button").width+p)*s*q)+"px";o+=g.skin.getSkinElement("dock","button").height+p}}}this.resize=i;this.show=function(){_css(j,{display:"block"})};this.hide=function(){_css(j,{display:"none"})};return this}})(jwplayer);(function(a){a.html5.eventdispatcher=function(d,b){var c=new a.events.eventdispatcher(b);a.utils.extend(this,c);this.sendEvent=function(e,f){if(f===undefined){f={}}a.utils.extend(f,{id:d,version:a.version,type:e});c.sendEvent(e,f)}}})(jwplayer);(function(a){var b={prefix:"http://l.longtailvideo.com/html5/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:0.5,over:1,timeout:3,hide:true,position:"bottom-left"};_css=a.utils.css;a.html5.logo=function(l,m){var r=l;var n;var i;var c;j();function j(){p();d();f()}function p(){if(b.prefix){var t=l.version.split(/\W/).splice(0,2).join("/");if(b.prefix.indexOf(t)<0){b.prefix+=t+"/"}}if(m.position==a.html5.view.positions.OVER){m.position=b.position}i=a.utils.extend({},b)}function d(){c=document.createElement("img");c.id=r.id+"_jwplayer_logo";c.style.display="none";c.onload=function(t){_css(c,q());r.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,s);e()};if(!i.file){return}if(i.file.indexOf("http://")===0){c.src=i.file}else{c.src=i.prefix+i.file}}if(!i.file){return}this.resize=function(u,t){};this.getDisplayElement=function(){return c};function f(){if(i.link){c.onmouseover=h;c.onmouseout=e;c.onclick=o}else{this.mouseEnabled=false}}function o(t){if(typeof t!="undefined"){t.stopPropagation()}r.jwPause();r.jwSetFullscreen(false);if(i.link){window.open(i.link,"_blank")}return}function e(t){if(i.link){c.style.opacity=i.out}return}function h(t){if(i.hide){c.style.opacity=i.over}return}function q(){var v={textDecoration:"none",position:"absolute",cursor:"pointer"};v.display=i.hide?"none":"block";var u=i.position.toLowerCase().split("-");for(var t in u){v[u[t]]=i.margin}return v}function k(){if(i.hide){c.style.display="block";c.style.opacity=0;a.utils.fadeTo(c,i.out,0.1,parseFloat(c.style.opacity));n=setTimeout(function(){g()},i.timeout*1000)}}function g(){if(i.hide){a.utils.fadeTo(c,0,0.1,parseFloat(c.style.opacity))}}function s(t){if(t.newstate==a.api.events.state.BUFFERING){clearTimeout(n);k()}}return this}})(jwplayer);(function(a){var c={ended:a.api.events.state.IDLE,playing:a.api.events.state.PLAYING,pause:a.api.events.state.PAUSED,buffering:a.api.events.state.BUFFERING};var b=a.utils.css;a.html5.mediavideo=function(f,F){var J={abort:t,canplay:m,canplaythrough:m,durationchange:q,emptied:t,ended:m,error:l,loadeddata:q,loadedmetadata:q,loadstart:m,pause:m,play:M,playing:m,progress:B,ratechange:t,seeked:m,seeking:m,stalled:m,suspend:m,timeupdate:M,volumechange:t,waiting:m,canshowcurrentframe:t,dataunavailable:t,empty:t,load:e,loadedfirstframe:t};var K=new a.html5.eventdispatcher();a.utils.extend(this,K);var h=f;var x=F;var G;var I;var d=a.api.events.state.IDLE;var C=null;var n;var g=0;var A=false;var r=false;var O;var N;var i=[];var P;var E=false;function v(){return d}function e(Q){}function t(Q){}function m(Q){if(c[Q.type]){s(c[Q.type])}}function s(Q){if(E){return}if(n){Q=a.api.events.state.IDLE}if(Q==a.api.events.state.PAUSED&&d==a.api.events.state.IDLE){return}if(Q==a.api.events.state.PLAYING&&d==a.api.events.state.IDLE){s(a.api.events.state.BUFFERING);K.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:h.buffer});z();return}if(d!=Q){var R=d;h.state=Q;d=Q;var S=false;if(Q==a.api.events.state.IDLE){p();if(h.position>=h.duration&&(h.position>0||h.duration>0)){S=true}if(x.style.display!="none"&&!h.config.chromeless){x.style.display="none"}}K.sendEvent(a.api.events.JWPLAYER_PLAYER_STATE,{oldstate:R,newstate:Q});if(S){K.sendEvent(a.api.events.JWPLAYER_MEDIA_COMPLETE)}}n=false}function q(Q){var R={height:Q.target.videoHeight,width:Q.target.videoWidth,duration:Math.round(Q.target.duration*10)/10};if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(Q.target.duration*10)/10}h.playlist[h.item]=a.utils.extend(h.playlist[h.item],R);K.sendEvent(a.api.events.JWPLAYER_MEDIA_META,{metadata:R})}function M(R){if(n){return}if(R!==undefined&&R.target!==undefined){if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(R.target.duration*10)/10}if(!A&&x.readyState>0){s(a.api.events.state.PLAYING)}if(d==a.api.events.state.PLAYING){if(!A&&x.readyState>0){A=true;try{x.currentTime=h.playlist[h.item].start}catch(Q){}x.volume=h.volume/100;x.muted=h.mute}h.position=Math.round(R.target.currentTime*10)/10;K.sendEvent(a.api.events.JWPLAYER_MEDIA_TIME,{position:R.target.currentTime,duration:R.target.duration})}}B(R)}function z(){if(G===false&&d==a.api.events.state.BUFFERING){K.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER_FULL);G=true}}function H(){var Q=(i[i.length-1]-i[0])/i.length;P=setTimeout(function(){if(!I){B({lengthComputable:true,loaded:1,total:1})}},Q*10)}function B(S){var R,Q;if(S!==undefined&&S.lengthComputable&&S.total){o();R=S.loaded/S.total*100;Q=R/100*(h.duration-x.currentTime);if(50<R&&!I){clearTimeout(P);H()}}else{if((x.buffered!==undefined)&&(x.buffered.length>0)){maxBufferIndex=0;if(maxBufferIndex>=0){R=x.buffered.end(maxBufferIndex)/x.duration*100;Q=x.buffered.end(maxBufferIndex)-x.currentTime}}}z();if(!I){if(R==100&&I===false){I=true}if(R!==null&&(R>h.buffer)){h.buffer=Math.round(R);K.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(R)})}}}function w(){if(C===null){C=setInterval(function(){M()},100)}}function p(){clearInterval(C);C=null}function l(S){var R="There was an error: ";if((S.target.error&&S.target.tagName.toLowerCase()=="video")||S.target.parentNode.error&&S.target.parentNode.tagName.toLowerCase()=="video"){var Q=S.target.error===undefined?S.target.parentNode.error:S.target.error;switch(Q.code){case Q.MEDIA_ERR_ABORTED:R="You aborted the video playback: ";break;case Q.MEDIA_ERR_NETWORK:R="A network error caused the video download to fail part-way: ";break;case Q.MEDIA_ERR_DECODE:R="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case Q.MEDIA_ERR_SRC_NOT_SUPPORTED:R="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:R="An unknown error occurred: ";break}}else{if(S.target.tagName.toLowerCase()=="source"){N--;if(N>0){return}R="The video could not be loaded, either because the server or network failed or because the format is not supported: "}else{a.utils.log("Erroneous error received. Continuing...");return}}u();R+=j();E=true;K.sendEvent(a.api.events.JWPLAYER_ERROR,{error:R});return}function j(){var S="";for(var R in O.levels){var Q=O.levels[R];var T=x.ownerDocument.createElement("source");S+=a.utils.getAbsolutePath(Q.file);if(R<(O.levels.length-1)){S+=", "}}return S}this.getDisplayElement=function(){return x};this.play=function(){if(d!=a.api.events.state.PLAYING){if(x.style.display!="block"){x.style.display="block"}x.play();w();if(G){s(a.api.events.state.PLAYING)}}};this.pause=function(){x.pause();s(a.api.events.state.PAUSED)};this.seek=function(Q){if(!(h.duration===0||isNaN(h.duration))&&!(h.position===0||isNaN(h.position))){x.currentTime=Q;x.play()}};function u(){x.pause();x.removeAttribute("src");var Q=x.getElementsByTagName("source");for(var R=0;R<Q.length;R++){x.removeChild(Q[R])}if(typeof x.load=="function"){x.load()}p();h.position=0;n=true;s(a.api.events.state.IDLE)}this.stop=u;this.volume=function(Q){x.volume=Q/100;h.volume=Q;K.sendEvent(a.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(Q)})};this.mute=function(Q){x.muted=Q;h.mute=Q;K.sendEvent(a.api.events.JWPLAYER_MEDIA_MUTE,{mute:Q})};this.resize=function(R,Q){if(false){b(x,{width:R,height:Q})}K.sendEvent(a.api.events.JWPLAYER_MEDIA_RESIZE,{fullscreen:h.fullscreen,width:R,hieght:Q})};this.fullscreen=function(Q){if(Q===true){this.resize("100%","100%")}else{this.resize(h.config.width,h.config.height)}};this.load=function(Q){L(Q);K.sendEvent(a.api.events.JWPLAYER_MEDIA_LOADED);G=false;I=false;A=false;if(!h.config.chromeless&&!r){i=[];o();s(a.api.events.state.BUFFERING);setTimeout(function(){M()},25)}};function o(){var Q=new Date().getTime();i.push(Q)}this.hasChrome=function(){return r};function L(Q){switch(Q.provider){case"youtube":k(Q);break;default:D(Q,document.createElement("video"));break}}function D(X,V){h.duration=X.duration;r=false;O=X;V.preload="none";V.setAttribute("x-webkit-airplay","allow");E=false;N=0;for(var R=0;R<X.levels.length;R++){var Q=X.levels[R];var S;var W=a.utils.extension(Q.file);if(Q.type===undefined){if(a.utils.extensionmap[W]!==undefined&&a.utils.extensionmap[W].html5!==undefined){S=a.utils.extensionmap[W].html5}}else{S=Q.type}if(!S||V.canPlayType(S)||(a.utils.isLegacyAndroid()&&W.match(/m4v|mp4/))){var U=x.ownerDocument.createElement("source");U.src=a.utils.getAbsolutePath(Q.file);if(S&&!a.utils.isLegacyAndroid()){U.type=S}N++;V.appendChild(U)}}if(N===0){E=true;K.sendEvent(a.api.events.JWPLAYER_ERROR,{error:"The media could not be loaded because the format is not supported by your browser: "+j()})}if(h.config.chromeless){V.poster=a.utils.getAbsolutePath(X.image);V.controls="controls"}V.style.top=x.style.top;V.style.left=x.style.left;V.style.width=x.style.width;V.style.height=x.style.height;V.style.zIndex=x.style.zIndex;V.onload=e;V.volume=0;x.parentNode.replaceChild(V,x);V.id=x.id;x=V;for(var T in J){x.addEventListener(T,function(Y){if(Y.target.parentNode!==null){J[Y.type](Y)}},true)}}function k(Q){var Y=Q.levels[0].file;var T=document.createElement("object");Y=["http://www.youtube.com/v/",y(Y),"&amp;hl=en_US&amp;fs=1&autoplay=1"].join("");var W={movie:Y,allowFullScreen:"true",allowscriptaccess:"always"};for(var S in W){var R=document.createElement("param");R.name=S;R.value=W[S];T.appendChild(R)}var X=document.createElement("embed");var U={src:Y,type:"application/x-shockwave-flash",allowscriptaccess:"always",allowfullscreen:"true",width:document.getElementById(f.id).style.width,height:document.getElementById(f.id).style.height};for(var V in U){X[V]=U[V]}T.appendChild(X);T.style.position=x.style.position;T.style.top=x.style.top;T.style.left=x.style.left;T.style.width=document.getElementById(f.id).style.width;T.style.height=document.getElementById(f.id).style.height;T.style.zIndex=2147483000;x.parentNode.replaceChild(T,x);T.id=x.id;x=T;r=true}function y(R){var Q=R.split(/\?|\#\!/);var T="";for(var S=0;S<Q.length;S++){if(Q[S].substr(0,2)=="v="){T=Q[S].substr(2)}}if(T==""){if(R.indexOf("/v/")>=0){T=R.substr(R.indexOf("/v/")+3)}else{if(R.indexOf("youtu.be")>=0){T=R.substr(R.indexOf("youtu.be/")+9)}else{T=R}}}if(T.indexOf("?")>-1){T=T.substr(0,T.indexOf("?"))}if(T.indexOf("&")>-1){T=T.substr(0,T.indexOf("&"))}return T}this.embed=L;return this}})(jwplayer);(function(jwplayer){var _configurableStateVariables=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];jwplayer.html5.model=function(api,container,options){var _api=api;var _container=container;var _model={id:_container.id,playlist:[],state:jwplayer.api.events.state.IDLE,position:0,buffer:0,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:90,mute:false,fullscreen:false,repeat:"none",stretching:jwplayer.utils.stretching.UNIFORM,autostart:false,debug:undefined,screencolor:undefined}};var _media;var _eventDispatcher=new jwplayer.html5.eventdispatcher();var _components=["display","logo","controlbar","dock"];jwplayer.utils.extend(_model,_eventDispatcher);for(var option in options){if(typeof options[option]=="string"){var type=/color$/.test(option)?"color":null;options[option]=jwplayer.utils.typechecker(options[option],type)}var config=_model.config;var path=option.split(".");for(var edge in path){if(edge==path.length-1){config[path[edge]]=options[option]}else{if(config[path[edge]]===undefined){config[path[edge]]={}}config=config[path[edge]]}}}for(var index in _configurableStateVariables){var configurableStateVariable=_configurableStateVariables[index];_model[configurableStateVariable]=_model.config[configurableStateVariable]}var pluginorder=_components.concat([]);if(_model.plugins!==undefined){if(typeof _model.plugins=="string"){var userplugins=_model.plugins.split(",");for(var userplugin in userplugins){if(typeof userplugins[userplugin]=="string"){pluginorder.push(userplugins[userplugin].replace(/^\s+|\s+$/g,""))}}}}if(typeof _model.config.chromeless=="undefined"&&jwplayer.utils.isIOS()){_model.config.chromeless=true}if(_model.config.chromeless){pluginorder=["logo"];if(_model.config.repeat===undefined||_model.config.repeat=="none"){_model.config.repeat="list"}}_model.plugins={order:pluginorder,config:{},object:{}};if(typeof _model.config.components!="undefined"){for(var component in _model.config.components){_model.plugins.config[component]=_model.config.components[component]}}for(var pluginIndex in _model.plugins.order){var pluginName=_model.plugins.order[pluginIndex];var pluginConfig=_model.config[pluginName]===undefined?{}:_model.config[pluginName];_model.plugins.config[pluginName]=_model.plugins.config[pluginName]===undefined?pluginConfig:jwplayer.utils.extend(_model.plugins.config[pluginName],pluginConfig);if(typeof _model.plugins.config[pluginName].position=="undefined"){_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.OVER}else{_model.plugins.config[pluginName].position=_model.plugins.config[pluginName].position.toString().toUpperCase()}}if(typeof _model.plugins.config.dock!="undefined"){if(typeof _model.plugins.config.dock!="object"){var position=_model.plugins.config.dock.toString().toUpperCase();_model.plugins.config.dock={position:position}}if(typeof _model.plugins.config.dock.position!="undefined"){_model.plugins.config.dock.align=_model.plugins.config.dock.position;_model.plugins.config.dock.position=jwplayer.html5.view.positions.OVER}}_model.loadPlaylist=function(arg,ready){var input;if(typeof arg=="string"){try{input=eval(arg)}catch(err){input=arg}}else{input=arg}var config;switch(jwplayer.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input};break}_model.playlist=new jwplayer.html5.playlist(config);if(_model.config.shuffle){_model.item=_getShuffleItem()}else{if(_model.config.item>=_model.playlist.length){_model.config.item=_model.playlist.length-1}else{if(_model.config.item<0){_model.config.item=0}}_model.item=_model.config.item}if(!ready){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:_model.playlist})}_model.setActiveMediaProvider(_model.playlist[_model.item])};function _getShuffleItem(){var result=null;if(_model.playlist.length>1){while(result===null){result=Math.floor(Math.random()*_model.playlist.length);if(result==_model.item){result=null}}}else{result=0}return result}function forward(evt){if(evt.type==jwplayer.api.events.JWPLAYER_MEDIA_LOADED){_container=_media.getDisplayElement()}_eventDispatcher.sendEvent(evt.type,evt)}_model.setActiveMediaProvider=function(playlistItem){if(_media!==undefined){_media.resetEventListeners()}_media=new jwplayer.html5.mediavideo(_model,_container);_media.addGlobalListener(forward);if(_model.config.chromeless){_media.load(playlistItem)}return true};_model.getMedia=function(){return _media};_model.seek=function(pos){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_MEDIA_SEEK,{position:_model.position,offset:pos});return _media.seek(pos)};_model.setupPlugins=function(){for(var plugin in _model.plugins.order){try{var pluginName=_model.plugins.order[plugin];if(jwplayer.html5[pluginName]!==undefined){_model.plugins.object[pluginName]=new jwplayer.html5[pluginName](_api,_model.plugins.config[pluginName])}else{_model.plugins.order.splice(plugin,plugin+1)}}catch(err){jwplayer.utils.log("Could not setup "+pluginName)}}};return _model}})(jwplayer);(function(a){a.html5.playlist=function(b){var d=[];if(b.playlist&&b.playlist instanceof Array&&b.playlist.length>0){for(var c in b.playlist){if(!isNaN(parseInt(c))){d.push(new a.html5.playlistitem(b.playlist[c]))}}}else{d.push(new a.html5.playlistitem(b))}return d}})(jwplayer);(function(b){b.html5.playlistitem=function(d){var e={author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]};var c=b.utils.extend({},e,d);if(c.type){c.provider=c.type;delete c.type}if(c.levels.length===0){c.levels[0]=new b.html5.playlistitemlevel(c)}if(!c.provider){c.provider=a(c.levels[0])}else{c.provider=c.provider.toLowerCase()}return c};function a(e){if(b.utils.isYouTube(e.file)){return"youtube"}else{var f=b.utils.extension(e.file);var c;if(f&&b.utils.extensionmap[f]){c=b.utils.extensionmap[f].html5}else{if(e.type){c=e.type}}if(c){var d=c.split("/")[0];if(d=="audio"){return"sound"}else{if(d=="video"){return d}}}}return""}})(jwplayer);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(b[c]!==undefined){d[c]=b[c]}}return d}})(jwplayer);(function(a){a.html5.skin=function(){var b={};var c=false;this.load=function(d,e){new a.html5.skinloader(d,function(f){c=true;b=f;e()},function(){new a.html5.skinloader("",function(f){c=true;b=f;e()})})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){a.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){return b[d].layout}return null}}})(jwplayer);(function(a){a.html5.skinloader=function(f,n,i){var m={};var c=n;var j=i;var e=true;var h;var l=f;var q=false;function k(){if(typeof l!="string"||l===""){d(a.html5.defaultSkin().xml)}else{a.utils.ajax(a.utils.getAbsolutePath(l),function(r){try{if(r.responseXML!==null){d(r.responseXML);return}}catch(s){}d(a.html5.defaultSkin().xml)},function(r){d(a.html5.defaultSkin().xml)})}}function d(w){var C=w.getElementsByTagName("component");if(C.length===0){return}for(var F=0;F<C.length;F++){var A=C[F].getAttribute("name");var z={settings:{},elements:{},layout:{}};m[A]=z;var E=C[F].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var D=0;D<E.length;D++){b(E[D],A)}var x=C[F].getElementsByTagName("settings")[0];if(x!==undefined&&x.childNodes.length>0){var I=x.getElementsByTagName("setting");for(var N=0;N<I.length;N++){var O=I[N].getAttribute("name");var G=I[N].getAttribute("value");var v=/color$/.test(O)?"color":null;m[A].settings[O]=a.utils.typechecker(G,v)}}var J=C[F].getElementsByTagName("layout")[0];if(J!==undefined&&J.childNodes.length>0){var K=J.getElementsByTagName("group");for(var u=0;u<K.length;u++){var y=K[u];m[A].layout[y.getAttribute("position")]={elements:[]};for(var M=0;M<y.attributes.length;M++){var B=y.attributes[M];m[A].layout[y.getAttribute("position")][B.name]=B.value}var L=y.getElementsByTagName("*");for(var t=0;t<L.length;t++){var r=L[t];m[A].layout[y.getAttribute("position")].elements.push({type:r.tagName});for(var s=0;s<r.attributes.length;s++){var H=r.attributes[s];m[A].layout[y.getAttribute("position")].elements[t][H.name]=H.value}if(m[A].layout[y.getAttribute("position")].elements[t].name===undefined){m[A].layout[y.getAttribute("position")].elements[t].name=r.tagName}}}}e=false;p()}}function p(){clearInterval(h);if(!q){h=setInterval(function(){o()},100)}}function b(w,v){var u=new Image();var r=w.getAttribute("name");var t=w.getAttribute("src");var y;if(t.indexOf("data:image/png;base64,")===0){y=t}else{var s=a.utils.getAbsolutePath(l);var x=s.substr(0,s.lastIndexOf("/"));y=[x,v,t].join("/")}m[v].elements[r]={height:0,width:0,src:"",ready:false};u.onload=function(z){g(u,r,v)};u.onerror=function(z){q=true;p();j()};u.src=y}function o(){for(var r in m){if(r!="properties"){for(var s in m[r].elements){if(!m[r].elements[s].ready){return}}}}if(e===false){clearInterval(h);c(m)}}function g(r,t,s){m[s].elements[t].height=r.height;m[s].elements[t].width=r.width;m[s].elements[t].src=r.src;m[s].elements[t].ready=true;p()}k()}})(jwplayer);(function(a){a.html5.api=function(b,l){var k={};var f=document.createElement("div");b.parentNode.replaceChild(f,b);f.id=b.id;k.version=a.version;k.id=f.id;var j=new a.html5.model(k,f,l);var h=new a.html5.view(k,f,j);var i=new a.html5.controller(k,f,j,h);k.skin=new a.html5.skin();k.jwPlay=function(m){if(typeof m=="undefined"){e()}else{if(m.toString().toLowerCase()=="true"){i.play()}else{i.pause()}}};k.jwPause=function(m){if(typeof m=="undefined"){e()}else{if(m.toString().toLowerCase()=="true"){i.pause()}else{i.play()}}};function e(){if(j.state==a.api.events.state.PLAYING||j.state==a.api.events.state.BUFFERING){i.pause()}else{i.play()}}k.jwStop=i.stop;k.jwSeek=i.seek;k.jwPlaylistItem=i.item;k.jwPlaylistNext=i.next;k.jwPlaylistPrev=i.prev;k.jwResize=i.resize;k.jwLoad=i.load;function g(m){return function(){return j[m]}}function d(m,o,n){return function(){var p=j.plugins.object[m];if(p&&p[o]&&typeof p[o]=="function"){p[o].apply(p,n)}}}k.jwGetItem=g("item");k.jwGetPosition=g("position");k.jwGetDuration=g("duration");k.jwGetBuffer=g("buffer");k.jwGetWidth=g("width");k.jwGetHeight=g("height");k.jwGetFullscreen=g("fullscreen");k.jwSetFullscreen=i.setFullscreen;k.jwGetVolume=g("volume");k.jwSetVolume=i.setVolume;k.jwGetMute=g("mute");k.jwSetMute=i.setMute;k.jwGetStretching=g("stretching");k.jwGetState=g("state");k.jwGetVersion=function(){return k.version};k.jwGetPlaylist=function(){return j.playlist};k.jwGetPlaylistIndex=k.jwGetItem;k.jwAddEventListener=i.addEventListener;k.jwRemoveEventListener=i.removeEventListener;k.jwSendEvent=i.sendEvent;k.jwDockSetButton=function(p,m,n,o){if(j.plugins.object.dock&&j.plugins.object.dock.setButton){j.plugins.object.dock.setButton(p,m,n,o)}};k.jwShowControlbar=d("controlbar","show");k.jwHideControlbar=d("controlbar","hide");k.jwShowDock=d("dock","show");k.jwHideDock=d("dock","hide");k.jwShowDisplay=d("display","show");k.jwHideDisplay=d("display","hide");k.jwGetLevel=function(){};k.jwGetBandwidth=function(){};k.jwGetLockState=function(){};k.jwLock=function(){};k.jwUnlock=function(){};function c(o,n,m){return function(){o.loadPlaylist(o.config,true);o.setupPlugins();n.setup(o.getMedia().getDisplayElement());var p={id:k.id,version:k.version};m.sendEvent(a.api.events.JWPLAYER_READY,p);if(playerReady!==undefined){playerReady(p)}if(window[o.config.playerReady]!==undefined){window[o.config.playerReady](p)}o.sendEvent(a.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:o.playlist});m.item(o.item)}}if(j.config.chromeless){setTimeout(c(j,h,i),25)}else{k.skin.load(j.config.skin,c(j,h,i))}return k}})(jwplayer)};

/*  */
function loadSWF(url, id, width, height){
         if (url !="") {
		 var flashvars = {};
	         var params = {allowfullscreen:"true",wmode:"transparent"};
	         var attributes = {};  
	           swfobject.embedSWF(url, id+"-youtubevideo", width , height , "6", false, flashvars, params, attributes);
	         }
}
 
function loadSWFX(url, id, width, height, autostart){
		autostart = typeof(autostart) != 'undefined' ? autostart : false;
    jwplayer(id+'-youtubevideo').setup({
    'flashplayer': mod_youtubeplaylist,
    'file': url,
    'autostart': autostart ,	
    'controlbar': 'bottom',
    'width': width,
    'height': height
	});
}
 
function loadSWFXHD(url, id, width, height, autostart){
		autostart = typeof(autostart) != 'undefined' ? autostart : false;
    jwplayer(id+'-youtubevideo').setup({
    'flashplayer': mod_youtubeplaylist,
    'file': url,
    'autostart': autostart ,	
    'controlbar': 'bottom',
    'width': width,
    'height': height,
	'plugins': {
	   'hd-1': {}
		}	
	});
}

/*  */
window.addEvent("load", function(){	
	(function() {
        $$('.nsp_main').each(function(module){
    		var id = module.getProperty('id');
    		var $G = $Gavick[id];
    		var arts_actual = 0;
    		var list_actual = 0;
    		var arts_block_width = $E('.nsp_arts', module) ? $E('.nsp_arts', module).getSize().size.x : null;
    		var links_block_width = $E('.nsp_links ul', module) ? $E('.nsp_links ul', module).getSize().size.x : null;
    		var arts = $ES('.nsp_art', module);
    		var links = $ES('.nsp_links .list li', module);
    		var arts_per_page = $G['news_column'] * $G['news_rows'];
    		var pages_amount = Math.ceil(arts.length / arts_per_page);
    		var links_pages_amount = Math.ceil(Math.ceil(links.length / $G['links_amount']) / $G['links_columns_amount']);
            var auto_anim = module.hasClass('autoanim');
    		var hover_anim = module.hasClass('hover');
    		var anim_speed = $G['animation_speed'];
    		var anim_interval = $G['animation_interval'];
    		var animation = true;
    		
    		if(arts.length > 0){
    			for(var i = 0; i < pages_amount; i++){
    				var div = new Element('div',{"class" : "nsp_art_page"});
    				div.setStyles({ "width" : arts_block_width+"px", "float" : "left" });
    				div.injectBefore(arts[0]);
    			}	
    			
    			var j = 0;
    			for(var i = 0; i < arts.length; i++) {
    				if(i % arts_per_page == 0 && i != 0) { j++; }
    				if(window.ie) arts[i].setStyle('width', (arts[i].getStyle('width').toInt() - 0.2) + "%");
    				arts[i].injectInside($ES('.nsp_art_page',module)[j]);
    				if(arts[i].hasClass('unvisible')) arts[i].removeClass('unvisible');
    			}
    			
    			var main_scroll = new Element('div',{"class" : "nsp_art_scroll1" });
    			main_scroll.setStyles({ "width" : arts_block_width + "px", "overflow" : "hidden" });
    			main_scroll.innerHTML = '<div class="nsp_art_scroll2"></div>';
    			main_scroll.injectBefore($E('.nsp_art_page',module));
    			var long_scroll = $E('.nsp_art_scroll2',module);
    			long_scroll.setStyle('width','100000px');
    			$ES('.nsp_art_page',module).injectInside(long_scroll);
    			var art_scroller = new Fx.Scroll(main_scroll, {duration:$G['animation_speed'], wait:false, wheelStops:false});
    		}
    		
    		if(links.length > 0){
    			for(var i = 0; i < links_pages_amount * $G['links_columns_amount']; i++){
    				var ul = new Element('ul');
    				ul.setStyles({ "width" : Math.floor(links_block_width / $G['links_columns_amount']) +"px", "float" : "left" });
    				ul.setProperty("class","list");
    				ul.injectTop($E('.nsp_links',module));
    			}
    			
    			var k = 0;
    			for(var i = 0; i < links.length; i++) {
    				if(i % $G['links_amount'] == 0 && i != 0) { k++; }
    				links[i].injectInside($ES('.nsp_links ul.list',module)[k]);
    				if(links[i].hasClass('unvisible')) links[i].removeClass('unvisible');
    			}
    			$ES('.nsp_links ul.list',module)[$ES('.nsp_links ul.list',module).length - 1].remove();
    			var link_scroll = new Element('div',{"class" : "nsp_link_scroll1" });
    			link_scroll.setStyles({ "width" : links_block_width + "px", "overflow" : "hidden" });
    			link_scroll.innerHTML = '<div class="nsp_link_scroll2"></div>';
    			link_scroll.injectTop($E('.nsp_links',module));
    			var long_link_scroll = $E('.nsp_link_scroll2',module);
    			long_link_scroll.setStyle('width','100000px');
    			$ES('.nsp_links ul.list',module).injectInside(long_link_scroll);
    			var link_scroller = new Fx.Scroll(link_scroll, {duration:$G['animation_speed'], wait:false, wheelStops:false});
    		}
    		
    		// top interface
    		nsp_art_list(0, module, 'top');
    		nsp_art_list(0, module, 'bottom');
    		nsp_art_counter(0, module, 'top', pages_amount);
    		nsp_art_counter(0, module, 'bottom', links_pages_amount);
    		
    		if($E('.nsp_top_interface .pagination', module)){
    			$E('.nsp_top_interface .pagination', module).getElementsBySelector('li').each(function(item,i){
    				item.addEvent(hover_anim ? 'mouseenter' : 'click', function(){
    					art_scroller.scrollTo(i*arts_block_width, 0);
    					arts_actual = i;
    					
    					if(window.opera){
    			 			new Fx.Style($ES('.nsp_art_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * arts_actual * arts_block_width);
    					}
    					
    					nsp_art_list(i, module, 'top');
    					nsp_art_counter(i, module, 'top', pages_amount);
    					animation = false;
    					(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
    				});	
    			});
    		}
    		if($E('.nsp_top_interface .prev', module)){
    			$E('.nsp_top_interface .prev', module).addEvent("click", function(){
    				if(arts_actual == 0) arts_actual = pages_amount - 1;
    				else arts_actual--;
    				art_scroller.scrollTo(arts_actual * arts_block_width, 0);
    				
    				if(window.opera){
    			 		new Fx.Style($ES('.nsp_art_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * arts_actual * arts_block_width);	
    				}
    				
    				nsp_art_list(arts_actual, module, 'top');
    				nsp_art_counter(arts_actual, module, 'top', pages_amount);
    				animation = false;
    				(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
    			});
    		}
    		
    		if($E('.nsp_top_interface .next', module)){
    			$E('.nsp_top_interface .next', module).addEvent("click", function(){
    				if(arts_actual == pages_amount - 1) arts_actual = 0;
    				else arts_actual++;
    				art_scroller.scrollTo(arts_actual * arts_block_width, 0);
    				
    				if(window.opera){
    			 		new Fx.Style($ES('.nsp_art_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * arts_actual * arts_block_width);	
    				}
    				
    				nsp_art_list(arts_actual, module, 'top');
    				nsp_art_counter(arts_actual, module, 'top', pages_amount);
    				animation = false;
    				(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
    			});
    		}
    		// bottom interface
    		if($E('.nsp_bottom_interface .pagination', module)){
    			$E('.nsp_bottom_interface .pagination', module).getElementsBySelector('li').each(function(item,i){
    				item.addEvent(hover_anim ? 'mouseenter' : 'click', function(){
    					link_scroller.scrollTo(i*links_block_width, 0);
    					list_actual = i;
    					
    					if(window.opera){
    			 			new Fx.Style($ES('.nsp_link_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * list_actual * links_block_width);	
    					}
    					
    					nsp_art_list(i, module, 'bottom', links_pages_amount);
    				});	
    			});
    		}
    		if($E('.nsp_bottom_interface .prev', module)){
    			$E('.nsp_bottom_interface .prev', module).addEvent("click", function(){
    				if(list_actual == 0) list_actual = links_pages_amount - 1;
    				else list_actual--;
    				link_scroller.scrollTo(list_actual * links_block_width, 0);
    				
    				if(window.opera){
    		 			new Fx.Style($ES('.nsp_link_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * list_actual * links_block_width);	
    				}
    				
    				nsp_art_list(list_actual, module, 'bottom', links_pages_amount);
    				nsp_art_counter(list_actual, module, 'bottom', links_pages_amount);
    			});
    		}
    		if($E('.nsp_bottom_interface .next', module)){
    			$E('.nsp_bottom_interface .next', module).addEvent("click", function(){
    				if(list_actual == links_pages_amount - 1) list_actual = 0;
    				else list_actual++;
    				link_scroller.scrollTo(list_actual * links_block_width, 0);
    				
    				if(window.opera){
     					new Fx.Style($ES('.nsp_link_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * list_actual * links_block_width);	
    				}
    				
    				nsp_art_list(list_actual, module, 'bottom', links_pages_amount);
    				nsp_art_counter(list_actual, module, 'bottom', links_pages_amount);
    			});
    		}
    		
    		if(auto_anim){
    			(function(){
    				if($E('.nsp_top_interface .next', module)){
    					if(animation) $E('.nsp_top_interface .next', module).fireEvent("click");
    				}else{
    					if(arts_actual == pages_amount - 1) arts_actual = 0;
    					else arts_actual++;
    					art_scroller.scrollTo(arts_actual * arts_block_width, 0);
    					
    					if(window.opera){
    				 		new Fx.Style($ES('.nsp_art_scroll2',module)[0], 'margin-left', {duration:$G['animation_speed'], wait:false}).start(-1 * arts_actual * arts_block_width);	
    					}
    					nsp_art_list(arts_actual, module, 'top');
    					nsp_art_counter(arts_actual, module, 'top', pages_amount);
    				}
    			}).periodical($G['animation_interval']);
    		}
    	});
	}).delay(500);
	
	function nsp_art_list(i, module, position){
		if($E('.nsp_'+position+'_interface .pagination', module)){
			$E('.nsp_'+position+'_interface .pagination', module).getElementsBySelector('li').setProperty('class', '');
			$E('.nsp_'+position+'_interface .pagination', module).getElementsBySelector('li')[i].setProperty('class', 'active');
		}
	}
	
	function nsp_art_counter(i, module, position, num){
		if($E('.nsp_'+position+'_interface .counter', module)){
			$E('.nsp_'+position+'_interface .counter span', module).innerHTML =  (i+1) + ' / ' + num;
		}
	}
});


