﻿/****************************************************************************************	
	[GLOBAL JQUERY FUNCTIONS]
*****************************************************************************************/

jQuery(function () {
	// Superfish dropdown menu
	//jQuery("ul#nav-main").superfish({delay:400,animation:{height:"show"},speed:"fast",autoArrows:false,dropShadows:false});
	
	// Restrict number of characters in textareas - used for Reviews and Forum modules but can be used anywhere
    jQuery("textarea.char-limit-255").charLimit({limit: 255}); // Small character limit - 255 (Reviews)
	
	// Datepicker
	//jQuery(".dp").datePicker({startDate:"01/01/1900",calendarIconURL:"/global/images/icons/calendar.gif"});
	
	// Nav goes Double width sometimes
	jQuery('#nav-main > li > div').each(function(){
		if (jQuery(this).find('ul').length > 1) { jQuery(this).addClass('duo'); };
	});
	
	// Banner
	if (jQuery('body').hasClass('home')) {
		jQuery('body.home #banner-items').innerfadeplus({ timeout: 7000, containerheight: 507, prev: '.banner-cont .prev', next: '.banner-cont .next' }); 
	} else {
		jQuery('#banner-items').innerfadeplus({ timeout: 7000, containerheight: 260, prev: '.banner-cont .prev', next: '.banner-cont .next' }); 
	}
	if (jQuery('.banner-item').length > 1) { jQuery('.banner-cont').css('display', 'block'); };
	
	// Carousel
	// Select Internet Explorer 7 and below
	if (jQuery('#carousel ul li').length > 1) { jQuery('#carousel .carousel-cont').show(); }
	if (jQuery.browser.msie && jQuery.browser.version <= 7) {
		jQuery('#carousel').carousel({target:"ul", axis:"y", previous:"#carousel .prev", next:"#carousel .next", autoscroll:false, hoverpause:true, speed:500, duration:2000, offset: 0});
	} else {
		jQuery('#carousel').carousel({target:"ul", axis:"y", previous:"#carousel .prev", next:"#carousel .next", autoscroll:false, hoverpause:true, speed:500, duration:2000, offset: 3});
	}
	
	// Home Panels Height Matching
	jQuery('body.home .column-triple .inner').eq(0).height() > jQuery('body.home .column-triple .inner').eq(1).height() ? jQuery('body.home .column-triple .inner').eq(1).height(jQuery('body.home .column-triple .inner').eq(0).height()) : jQuery('body.home .column-triple .inner').eq(0).height(jQuery('body.home .column-triple .inner').eq(1).height());
	
	// Home Panels Clicking, clicks read-more link
	//jQuery('body.home .column-triple .inner').click(function(){ window.location.href = jQuery(this).find('.read-more').attr('href'); })
	
	// Refinery Adding image
	jQuery('#refinery dl.accordion dt').css('background-image', 'url("/global/images/template/bg-refine.png")').css('cursor', 'pointer');
	
	// Accordion
	var activeItem = false;
	jQuery('.home .accordion').accordion({ 
		header: 'h5', 
		autoheight: false,
		active: 0
	});
	jQuery('.accordion h5').append('<span></span>');
	
	// Refinery Accordion
	jQuery('#refinery .accordion dd').each(function(){
		if (jQuery(this).attr('style') == undefined || jQuery(this).attr('style') == "") {
			jQuery(this).hide();
			jQuery(this).prev('dt').removeClass('selected');
		}
	});
	jQuery('#refinery .accordion dt').click(function(){ 
		if (jQuery(this).hasClass('selected')) {
			jQuery(this).removeClass('selected').next('dd').slideUp();
		} else {
			jQuery(this).addClass('selected').next('dd').slideDown();
		}
	});
	
	// Spander Accordion
	jQuery('#spander-list .spand-all').css('visibility', 'visible');
	jQuery('#spander-list .accordion dt').css('cursor', 'pointer').find('span').css('visibility', 'visible');
	jQuery('#spander-list .accordion dd').each(function(){
		if (jQuery(this).attr('style') == undefined || jQuery(this).attr('style') == "") {
			jQuery(this).hide();
			jQuery(this).prev('dt').removeClass('selected');
		}
	});
	jQuery('#spander-list .accordion dt').click(function(){ 
		if (jQuery(this).hasClass('selected')) {
			jQuery(this).removeClass('selected').next('dd').slideUp();
		} else {
			jQuery(this).addClass('selected').next('dd').slideDown();
		}
	});
	jQuery('#spander-list .spand-all').click(function(e){
		e.preventDefault();
		if (jQuery(this).hasClass('close')) {
			jQuery(this).removeClass('close').html($(this).attr('expandmsg'));
			jQuery(this).parent().find('dt').removeClass('selected');
			jQuery(this).parent().find('dd').slideUp();
		} else {
			jQuery(this).addClass('close').html($(this).attr('collapsemsg'));
			jQuery(this).parent().find('dt').addClass('selected');
			jQuery(this).parent().find('dd').slideDown();
		}
	});
	//Spander Alt item hiding
	jQuery('#spander-list.alt').each(function(){
		if (jQuery(this).find('dt').length < 2) {
			jQuery(this).find('dt span').remove();
			jQuery(this).find('.spand-all').css('visibility', 'hidden');
			jQuery(this).find('dt').css('cursor','default').unbind('click').bind('mouseenter', function(){ jQuery(this).css('background','#fff'); });
		}
	});
	
	// Filter Hide and submit on change
	jQuery('#list-filter select, #list-filter label.alt').next('input[type="image"]').hide();
	jQuery('#list-filter select').change(function(){ jQuery(this).next('input[type="image"]').click(); });
	jQuery('#list-filter select input[type="radio"], #list-filter label.alt').click(function(){ jQuery(this).next('input[type="image"]').click(); });
	
	// Nav Ancillary Hide and submit on change
	jQuery('#nav-ancillary select').next('input[type="image"]').hide();//.parent().width('452');
	jQuery('#nav-ancillary select').change(function(){ jQuery(this).next('input[type="image"]').click(); });
	
	// Event filter Hide and submit on change
	jQuery('.filter select').width('133').next('input[type="image"]').hide();
	jQuery('.filter select').change(function(){ jQuery(this).next('input[type="image"]').click(); });
	
	// Sidebar Search Hide
	jQuery('#sidebar .search .btn-submit').hide();
	jQuery('#sidebar .search .txt-input').width(154);
	
	// Map hilight
	if (jQuery('#wrapper').css('backgroundColor') == "rgb(38, 38, 38)" || jQuery('#wrapper').css('backgroundColor') == "#262626" ) {
		jQuery('#map-selector > img').maphilight({strokeColor: 'ffff00', fillOpacity: 1, fillColor: 'ffff00'});
	} else {
		jQuery('#map-selector > img').maphilight({strokeColor: 'b45501', fillOpacity: 1, fillColor: 'b45501'});
	}
	jQuery('area').mouseover(function(){
		var whichArea = jQuery(this).attr('alt');
		jQuery('#map-selector li[title=' + whichArea + '] > a').addClass('over');
	}).mouseout(function(){
		var whichArea = jQuery(this).attr('alt');
		jQuery('#map-selector li[title=' + whichArea + '] > a').removeClass('over');
	});
	jQuery('#map-selector li').mouseover(function(){
		var whichLabel = jQuery(this).attr('title');
		jQuery('area[alt=' + whichLabel + ']').first().mouseover();
	}).mouseout(function(){
		var whichLabel = jQuery(this).attr('title');
		jQuery('area[alt=' + whichLabel + ']').first().mouseout();
	});
	
	// Init AV Elements
	VideoJS.setupAllWhenReady();
	
	// Table Checkboxes
	jQuery('table.tbl-standard thead input[type="checkbox"]').click(function(){
		if (jQuery(this).is(':checked')) {
			jQuery(this).parents('table.tbl-standard').find('tbody input[type="checkbox"]').attr('checked',true);
		} else {
			jQuery(this).parents('table.tbl-standard').find('tbody input[type="checkbox"]').attr('checked',false);
		}
	});
	
	// Equal Height Quintuple Columns
	jQuery('.column-quintuple').each(function(){
		var tallestQuintColumn = 0;
		jQuery(this).find('.col').each(function(){
			if (jQuery(this).height() > tallestQuintColumn) {
				tallestQuintColumn = jQuery(this).height();
			} else {
				jQuery(this).height(tallestQuintColumn);
			}
		});
	});
	
	// Equal Height Quadruple Navigator Columns
	jQuery('.column-quadruple.navigator').each(function(){
		var tallestQuadColumn = 0;
		jQuery(this).find('.col').each(function(){
			if (jQuery(this).height() > tallestQuadColumn) {
				tallestQuadColumn = jQuery(this).height();
			} else {
				jQuery(this).height(tallestQuadColumn);
			}
		});
	});
	var tallestQuadHead = 0;
	jQuery('.column-quadruple.navigator h2').each(function(){
		if (jQuery(this).height() > tallestQuadHead) {
			tallestQuadHead = jQuery(this).height();
		} 
	});
	jQuery('.column-quadruple.navigator h2').height(tallestQuadHead);
	
	// Equal Height Newsletter Items
	jQuery('.structured-list.newsletter').each(function(){
		var tallestNewsItem = 0;
		jQuery(this).find('li').each(function(){
			if (jQuery(this).height() > tallestNewsItem && !jQuery(this).hasClass('divider')) {
				tallestNewsItem = jQuery(this).height();
			} else if (jQuery(this).height() <= tallestNewsItem && !jQuery(this).hasClass('divider')) {
				jQuery(this).height(tallestNewsItem);
			}
		});
	});
	
	// Faux Tabs
	if (jQuery('.tabs').length > 0) {
		jQuery('.tabs').prepend('<ul class="tab-nav"></ul>');
		jQuery('.tabs .tab-hdr').each(function(){jQuery('.tab-nav').append('<li><a href="/no-script.aspx">'+jQuery(this).html()+'</a></li>');});
	}
	jQuery('.tab-hdr, .tab-content').addClass('hide');
	jQuery('.tab-nav a').click(function(e){
		e.preventDefault();
		jQuery('.tab-nav a').removeClass('active');
		jQuery(this).addClass('active');	
		var theDex = jQuery('.tab-nav a').index(jQuery(this));
		jQuery('.tab-content').addClass('hide');
		jQuery('.tab-content').eq(theDex).removeClass('hide');
		$('.tab-content .feedback, .tab-content .feedback-sml').remove();
	});
	var tabToOpen = getUrlVars()['tab'];
	if (!tabToOpen == '') {
        if (tabToOpen > (jQuery('.tab-content').length - 1)) {
			tabToOpen = 0;
			jQuery('.tab-nav a').eq(tabToOpen).addClass('active');
			jQuery('.tab-content').eq(tabToOpen).removeClass('hide');
		} else {
			jQuery('.tab-nav a').eq(tabToOpen).addClass('active');
			jQuery('.tab-content').eq(tabToOpen).removeClass('hide');
		}
    } else {
		jQuery('.tab-nav a').eq(0).addClass('active');
		jQuery('.tab-content').eq(0).removeClass('hide');
	};
	
	// Get the params from the query string
    function getUrlVars() {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    }
	
	// Select Internet Explorer 7 and below
	if (jQuery.browser.msie && jQuery.browser.version <= 7) {
	}
	
	// Clear text input values
	var swap_text_boxes = [];
	jQuery.each(jQuery("input[type='text'].autoclear"), function() {
        swap_text_boxes[jQuery(this).attr('id')] = jQuery(this).attr('value');
        jQuery(this).bind('focus', function() {
            if (jQuery(this).val() == swap_text_boxes[jQuery(this).attr('id')]) {
                jQuery(this).val('');
            }
        });
        jQuery(this).bind('blur', function() {
            if (jQuery(this).val() == '') {
                jQuery(this).val(swap_text_boxes[jQuery(this).attr('id')]);
            }
        }); 
    });
	
	// Enable forms to be submitted via ENTER key
	var AreaSelector = "#content-wrapper, .search";
	var ButtonSelector = "input[type='submit'],input[type='image'],button";
	jQuery.each(jQuery(AreaSelector), function() {
        jQuery(this).keypress(function(e) {
            if (e.which == 13 && e.target.type != 'textarea') {
                var arrItems = jQuery(this).find(ButtonSelector);
                if (arrItems.length > 0) {
                    jQuery(this).find(ButtonSelector)[0].click();
                }
                return false;
            }
        });
    });
	
	// Briefcase and Favourites COlor Change
	$('.additional.briefcase, .additional.favourites').click(function(e){
		e.preventDefault();
		$(this).hasClass('alt') ? $(this).removeClass('alt') : $(this).addClass('alt');
	});
	
});
/****************************************************************************************	
	[JQUERY FUNCTIONS]
*****************************************************************************************/
function SyncRegionLawSelection(chkRegion){
	jQuery(chkRegion).siblings("ul").find('input[type="checkbox"]').each(function () {
		if (jQuery(chkRegion).attr('checked')) {
			jQuery(this).attr('checked', 'true');
		}
		else {
			jQuery(this).removeAttr('checked');
		}
	});
}
/****************************************************************************************	
	[JQUERY PLUG-INS]
*****************************************************************************************/
// Thickbox 3 - One Box To Rule Them All
var tb_pathToImage="/global/images/pre-loaders/loader2.gif";
jQuery(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){jQuery(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;});}function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window' role='dialog' aria-live='assertive' aria-relevant='additions'></div>");}}else{if(document.getElementById("TB_overlay")===null){jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window' role='dialog' aria-live='assertive' aria-relevant='additions'></div>");jQuery("#TB_overlay").click(tb_remove);}}if(tb_detectMacXFF()){jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{jQuery("#TB_overlay").addClass("TB_overlayBG");}if(caption===null){caption="";}jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' alt='Loading...' /></div>");jQuery('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}var urlString=/\.jpgjQuery|\.jpegjQuery|\.pngjQuery|\.gifjQuery|\.bmpjQuery/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=jQuery("a[rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<a href='#' id='TB_next'><img src='/global/images/template/tbox-nxt.gif' width='32' height='32' alt='Next' /></a>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<a href='#' id='TB_prev'><img src='/global/images/template/tbox-prev.gif' width='32' height='32' alt='Previous' /></a>";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;jQuery("#TB_window").append("<a href='#' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"' /></a>"+"<p id='TB_footer'>"+TB_PrevHTML+TB_NextHTML+"<span>"+TB_imageCount+" | <em>"+caption+"</em></span></p><a href='#' id='TB_closeWindowButton'><img src='/global/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a>");jQuery("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;}jQuery("#TB_prev").click(goPrev);}if(!(TB_NextHTML==="")){function goNext(){jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;}jQuery("#TB_next").click(goNext);}document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();jQuery("#TB_load").remove();jQuery("#TB_ImageOff").click(tb_remove);jQuery("#TB_window").css({position:"fixed",top:"50%",left:"50%",height:"auto",overflow:"auto"});if(typeof document.body.style.maxHeight==="undefined"){jQuery("#TB_window").css({position:"absolute"});};};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');jQuery("#TB_iframeContent").remove();if(params['modal']!="true"){jQuery("#TB_window").css({padding:"15px 15px 48px"}).append("<a href='#' id='TB_closeWindowButton'><img src='/global/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a><iframe allowtransparency='true' frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").css({padding:"15px"}).append("<iframe allowtransparency='true' frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>");}}else{if(jQuery("#TB_window").css("overflow")!="visible"){if(params['modal']!="true"){jQuery("#TB_window").css({padding:"15px 15px 48px"}).append("<a href='#' id='TB_closeWindowButton'><img src='/global/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").css({padding:"15px"}).append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");}}else{jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";jQuery("#TB_ajaxContent")[0].scrollTop=0;jQuery("#TB_ajaxWindowTitle").html(caption);}}jQuery("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){jQuery("#TB_ajaxContent").append(jQuery('#'+params['inlineId']).children());jQuery("#TB_window").unload(function(){jQuery('#'+params['inlineId']).append(jQuery("#TB_ajaxContent").children());});tb_position();jQuery("#TB_load").remove();jQuery("#TB_window").css({position:"fixed",top:"50%",left:"50%",height:"auto",width:"auto",overflow:"visible"});if(typeof document.body.style.maxHeight==="undefined"){jQuery("#TB_window").css({position:"absolute"});};}else if(url.indexOf('TB_iframe')!=-1){tb_position();if(jQuery.browser.safari){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}}else{jQuery("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();jQuery("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");jQuery("#TB_window").css({position:"fixed",top:"50%",left:"50%",height:"auto",width:"auto",overflow:"visible"});if(typeof document.body.style.maxHeight==="undefined"){jQuery("#TB_window").css({position:"absolute"});};});}}if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}if(keycode==27){tb_remove();}};}}catch(e){}}function tb_showIframe(){jQuery("#TB_load").remove();jQuery("#TB_window").css({position:"fixed",top:"50%",left:"50%",height:"auto",overflow:"visible"});if(typeof document.body.style.maxHeight==="undefined"){jQuery("#TB_window").css({position:"absolute"});};}function tb_remove(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");jQuery("#TB_window,#TB_overlay").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});jQuery("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){jQuery("body","html").css({height:"auto",width:"auto"});jQuery("html").css("overflow","");}document.onkeydown="";document.onkeyup="";return false;}function tb_position(){jQuery("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){jQuery("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}}function tb_parseQuery(query){var Params={};if(!query){return Params;}var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}return Params;}function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}}
// jQuery UI Accordion 1.6 * Copyright (c) 2007 Jörn Zaefferer * http://docs.jquery.com/UI/Accordion * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * Revision: jQueryId: jquery.accordion.js 4876 2008-03-08 11:49:04Z joern.zaefferer jQuery
(function(e){e.ui=e.ui||{};e.fn.extend({accordion:function(h,i){var g=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof h=="string"){var j=e.data(this,"ui-accordion");j[h].apply(j,g);}else{if(!e(this).is(".ui-accordion")){e.data(this,"ui-accordion",new e.ui.accordion(this,h));}}});},activate:function(g){return this.accordion("activate",g);}});e.ui.accordion=function(g,h){this.options=h=e.extend({},e.ui.accordion.defaults,h);this.element=g;e(g).addClass("ui-accordion");if(h.navigation){var k=e(g).find("a").filter(h.navigationFilter);if(k.length){if(k.filter(h.header).length){h.active=k;}else{h.active=k.parent().parent().prev();k.addClass("current");}}}h.headers=e(g).find(h.header);h.active=c(h.headers,h.active);if(h.fillSpace){var j=e(g).parent().height();h.headers.each(function(){j-=e(this).outerHeight();});var i=0;h.headers.next().each(function(){i=Math.max(i,e(this).innerHeight()-e(this).height());}).height(j-i);}else{if(h.autoheight){var j=0;h.headers.next().each(function(){j=Math.max(j,e(this).outerHeight());}).height(j);}}h.headers.not(h.active||"").next().hide();h.active.parent().andSelf().addClass(h.selectedClass);if(h.event){e(g).bind((h.event)+".ui-accordion",f);}};e.ui.accordion.prototype={activate:function(g){f.call(this.element,{target:c(this.options.headers,g)[0]});},enable:function(){this.options.disabled=false;},disable:function(){this.options.disabled=true;},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoheight){this.options.headers.next().css("height","");}e.removeData(this.element,"ui-accordion");e(this.element).removeClass("ui-accordion").unbind(".ui-accordion");}};function b(h,g){return function(){return h.apply(g,arguments);};}function d(i){if(!e.data(this,"ui-accordion")){return;}var g=e.data(this,"ui-accordion");var h=g.options;h.running=i?0:--h.running;if(h.running){return;}if(h.clearStyle){h.toShow.add(h.toHide).css({height:"",overflow:""});}e(this).triggerHandler("change.ui-accordion",[h.data],h.change);}function a(g,k,l,j,m){var i=e.data(this,"ui-accordion").options;i.toShow=g;i.toHide=k;i.data=l;var h=b(d,this);i.running=k.size()==0?g.size():k.size();if(i.animated){if(!i.alwaysOpen&&j){e.ui.accordion.animations[i.animated]({toShow:jQuery([]),toHide:k,complete:h,down:m,autoheight:i.autoheight});}else{e.ui.accordion.animations[i.animated]({toShow:g,toHide:k,complete:h,down:m,autoheight:i.autoheight});}}else{if(!i.alwaysOpen&&j){g.toggle();}else{k.hide();g.show();}h(true);}}function f(l){var j=e.data(this,"ui-accordion").options;if(j.disabled){return false;}if(!l.target&&!j.alwaysOpen){j.active.parent().andSelf().toggleClass(j.selectedClass);var i=j.active.next(),m={instance:this,options:j,newHeader:jQuery([]),oldHeader:j.active,newContent:jQuery([]),oldContent:i},g=j.active=e([]);a.call(this,g,i,m);return false;}var k=e(l.target);if(k.parents(j.header).length){while(!k.is(j.header)){k=k.parent();}}var h=k[0]==j.active[0];if(j.running||(j.alwaysOpen&&h)){return false;}if(!k.is(j.header)){return;}j.active.parent().andSelf().toggleClass(j.selectedClass);if(!h){k.parent().andSelf().addClass(j.selectedClass);}var g=k.next(),i=j.active.next(),m={instance:this,options:j,newHeader:k,oldHeader:j.active,newContent:g,oldContent:i},n=j.headers.index(j.active[0])>j.headers.index(k[0]);j.active=h?e([]):k;a.call(this,g,i,m,h,n);return false;}function c(h,g){return g!=undefined?typeof g=="number"?h.filter(":eq("+g+")"):h.not(h.not(g)):g===false?e([]):h.filter(":eq(0)");}e.extend(e.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoheight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(g,i){g=e.extend({easing:"swing",duration:300},g,i);if(!g.toHide.size()){g.toShow.animate({height:"show"},g);return;}var h=g.toHide.height(),j=g.toShow.height(),k=j/h;g.toShow.css({height:0,overflow:"hidden"}).show();g.toHide.filter(":hidden").each(g.complete).end().filter(":visible").animate({height:"hide"},{step:function(l){var m=(h-l)*k;if(e.browser.msie||e.browser.opera){m=Math.ceil(m);}g.toShow.height(m);},duration:g.duration,easing:g.easing,complete:function(){if(!g.autoheight){g.toShow.css("height","auto");}g.complete();}});},bounceslide:function(g){this.slide(g,{easing:g.down?"bounceout":"swing",duration:g.down?1000:200});},easeslide:function(g){this.slide(g,{easing:"easeinout",duration:700});}}});})(jQuery);

//jQuery Infinite Carousel  - Copyright 2009 Stéphane Roucheray - Note: This version has been modified by BlueArc.
jQuery.fn.carousel=function(a){var b={target:"ul",axis:"y",previous:null,next:null,pause:null,autoscroll:true,hoverpause:true,speed:750,duration:5e3,offset:0};if(a)jQuery.extend(b,a);if(jQuery(this).css("position")!="relative")jQuery(this).css("position","relative");var c=jQuery(this).children(b.target)[0];if(jQuery(c).css("position")!="absolute")jQuery(c).css("position","absolute");if(c){var d;if(b.axis=="y"){d=jQuery(c).children().outerWidth("true")+b.offset}else if(b.axis=="x"){d=jQuery(c).children().outerHeight("true")+b.offset}var e=jQuery(c).children(),f=e.length,g=d;var h;if(b.axis=="y"){h=Math.round(jQuery(this).width()/g)}else if(b.axis=="x"){h=Math.round(jQuery(this).height()/g)}var j=1,k=false,l=false,m;if(f<=h){jQuery(b.previous).hide();jQuery(b.next).hide();if(b.axis=="y"){jQuery(c).css("width",(f+h)*d+d+"px")}else if(b.axis=="x"){jQuery(c).css("height",(f+h)*d+d+"px")}}else{for(i=0;i<h;i++){if(b.axis=="y"){jQuery(c).css("width",(f+h)*d+d+"px")}else if(b.axis=="x"){jQuery(c).css("height",(f+h)*d+d+"px")}if(i<f){jQuery(c).append(jQuery(e[i]).clone())}}}jQuery(b.previous).click(function(a){a.preventDefault();if(!l){if(j==1){if(b.axis=="y"){jQuery(c).css("left","-"+f*g+"px")}else if(b.axis=="x"){jQuery(c).css("top","-"+f*g+"px")}j=f}else{j--}if(b.axis=="y"){jQuery(c).animate({left:"+="+d,y:0,queue:false},b.speed,"swing",function(){l=false})}else if(b.axis=="x"){jQuery(c).animate({top:"+="+d,x:0,queue:false},b.speed,"swing",function(){l=false})}l=true}});jQuery(b.next).click(function(a){a.preventDefault();if(!l){if(j>f){j=2;if(b.axis=="y"){jQuery(c).css("left","0px")}else if(b.axis=="x"){jQuery(c).css("top","0px")}}else{j++}if(b.axis=="y"){jQuery(c).animate({left:"-="+d,y:0,queue:false},b.speed,"swing",function(){l=false})}else if(b.axis=="x"){jQuery(c).animate({top:"-="+d,x:0,queue:false},b.speed,"swing",function(){l=false})}l=true}});jQuery(b.pause).click(function(a){if(!k){k=true;jQuery(b.pause).addClass("paused");if(b.autoscroll){window.clearInterval(m)}}else{k=false;jQuery(b.pause).removeClass("paused");if(b.autoscroll&&f>h&&!b.hoverpause){m=window.setInterval(function(){jQuery(b.next).click()},b.duration)}}});if(b.autoscroll&&f>h){m=window.setInterval(function(){jQuery(b.next).click()},b.duration)}if(b.hoverpause){jQuery(this).mouseenter(function(){if(!k&&b.autoscroll){window.clearInterval(m)}});jQuery(this).mouseleave(function(){if(!k&&b.autoscroll){m=window.setInterval(function(){jQuery(b.next).click()},b.duration)}})}}};

// Metadata - jQuery plugin for parsing metadata from elements * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan * Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html * Revision: jQueryId: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan jQuery
(function(jQuery){jQuery.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(a,b){this.defaults.type=a;this.defaults.name=b},get:function(elem,opts){var settings=jQuery.extend({},this.defaults,opts);if(!settings.single.length)settings.single="metadata";var data=jQuery.data(elem,settings.single);if(data)return data;data="{}";var getData=function(data){if(typeof data!="string")return data;if(data.indexOf("{")<0){data=eval("("+data+")")}};var getObject=function(data){if(typeof data!="string")return data;data=eval("("+data+")");return data};if(settings.type=="html5"){var object={};jQuery(elem.attributes).each(function(){var a=this.nodeName;if(a.match(/^data-/))a=a.replace(/^data-/,"");else return true;object[a]=getObject(this.nodeValue)})}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1]}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)data=jQuery.trim(e[0].innerHTML)}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}jQuery.data(elem,settings.single,object);return object}}});jQuery.fn.metadata=function(a){return jQuery.metadata.get(this[0],a)}})(jQuery);
// Metadata - jQuery plugin for parsing metadata from elements * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan * Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $

// jQuery Map Hilight (C) David Lynch http://davidlynch.org/js/maphilight/docs/
(function(a){var b,c,d,e,f,g,h,j,k,l,m;b=document.namespaces;c=!!document.createElement("canvas").getContext;if(!(c||b)){a.fn.maphilight=function(){return this};return}if(c){j=function(a){return Math.max(0,Math.min(parseInt(a,16),255))};k=function(a,b){return"rgba("+j(a.substr(0,2))+","+j(a.substr(2,2))+","+j(a.substr(4,2))+","+b+")"};d=function(b){var c=a('<canvas style="width:'+b.width+"px;height:"+b.height+'px;"></canvas>').get(0);c.getContext("2d").clearRect(0,0,c.width,c.height);return c};var n=function(a,b,c,d,e){d=d||0;e=e||0;a.beginPath();if(b=="rect"){a.rect(c[0]+d,c[1]+e,c[2]-c[0],c[3]-c[1])}else if(b=="poly"){a.moveTo(c[0]+d,c[1]+e);for(i=2;i<c.length;i+=2){a.lineTo(c[i]+d,c[i+1]+e)}}else if(b=="circ"){a.arc(c[0]+d,c[1]+e,c[2],0,Math.PI*2,false)}a.closePath()};e=function(b,c,d,e,f){var g,h=b.getContext("2d");if(e.shadow){h.save();if(e.shadowPosition=="inside"){n(h,c,d);h.clip()}var i=b.width*100;var j=b.height*100;n(h,c,d,i,j);h.shadowOffsetX=e.shadowX-i;h.shadowOffsetY=e.shadowY-j;h.shadowBlur=e.shadowRadius;h.shadowColor=k(e.shadowColor,e.shadowOpacity);var l=e.shadowFrom;if(!l){if(e.shadowPosition=="outside"){l="fill"}else{l="stroke"}}if(l=="stroke"){h.strokeStyle="rgba(0,0,0,1)";h.stroke()}else if(l=="fill"){h.fillStyle="rgba(0,0,0,1)";h.fill()}h.restore();if(e.shadowPosition=="outside"){h.save();n(h,c,d);h.globalCompositeOperation="destination-out";h.fillStyle="rgba(0,0,0,1);";h.fill();h.restore()}}h.save();n(h,c,d);if(e.fill){h.fillStyle=k(e.fillColor,e.fillOpacity);h.fill()}if(e.stroke){h.strokeStyle=k(e.strokeColor,e.strokeOpacity);h.lineWidth=e.strokeWidth;h.stroke()}h.restore();if(e.fade){a(b).css("opacity",0).animate({opacity:1},100)}};f=function(a){a.getContext("2d").clearRect(0,0,a.width,a.height)}}else{d=function(b){return a('<var style="zoom:1;overflow:hidden;display:block;width:'+b.width+"px;height:"+b.height+'px;"></var>').get(0)};e=function(b,c,d,e,f){var g,h,i,j;g='<v:fill color="#'+e.fillColor+'" opacity="'+(e.fill?e.fillOpacity:0)+'" />';h=e.stroke?'strokeweight="'+e.strokeWidth+'" stroked="t" strokecolor="#'+e.strokeColor+'"':'stroked="f"';i='<v:stroke opacity="'+e.strokeOpacity+'"/>';if(c=="rect"){j=a('<v:rect name="'+f+'" filled="t" '+h+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+d[0]+"px;top:"+d[1]+"px;width:"+(d[2]-d[0])+"px;height:"+(d[3]-d[1])+'px;"></v:rect>')}else if(c=="poly"){j=a('<v:shape name="'+f+'" filled="t" '+h+' coordorigin="0,0" coordsize="'+b.width+","+b.height+'" path="m '+d[0]+","+d[1]+" l "+d.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+b.width+"px;height:"+b.height+'px;"></v:shape>')}else if(c=="circ"){j=a('<v:oval name="'+f+'" filled="t" '+h+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(d[0]-d[2])+"px;top:"+(d[1]-d[2])+"px;width:"+d[2]*2+"px;height:"+d[2]*2+'px;"></v:oval>')}j.get(0).innerHTML=g+i;a(b).append(j)};f=function(b){a(b).find("[name=highlighted]").remove()}}g=function(a){var b,c=a.getAttribute("coords").split(",");for(b=0;b<c.length;b++){c[b]=parseFloat(c[b])}return[a.getAttribute("shape").toLowerCase().substr(0,4),c]};m=function(b,c){var d=a(b);return a.extend({},c,a.metadata?d.metadata():false,d.data("maphilight"))};l=function(a){if(!a.complete){return false}if(typeof a.naturalWidth!="undefined"&&a.naturalWidth==0){return false}return true};h={position:"absolute",left:0,top:0,padding:0,border:0};var o=false;a.fn.maphilight=function(b){b=a.extend({},a.fn.maphilight.defaults,b);if(!c&&a.browser.msie&&!o){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var i=document.createStyleSheet();var j=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"];a.each(j,function(){i.addRule("v\\:"+this,"behavior: url(#default#VML); antialias:true")});o=true}return this.each(function(){var i,j,k,n,o,p,q,r,s;i=a(this);if(!l(this)){return window.setTimeout(function(){i.maphilight(b)},200)}k=a.extend({},b,a.metadata?i.metadata():false,i.data("maphilight"));s=i.get(0).getAttribute("usemap");n=a('map[name="'+s.substr(1)+'"]');if(!(i.is("img")&&s&&n.size()>0)){return}if(i.hasClass("maphilighted")){var t=i.parent();i.insertBefore(t);t.remove();a(n).unbind(".maphilight").find("area[coords]").unbind(".maphilight")}j=a("<div></div>").css({display:"block",background:'url("'+this.src+'")',position:"relative",padding:0,width:this.width,height:this.height});if(k.wrapClass){if(k.wrapClass===true){j.addClass(a(this).attr("class"))}else{j.addClass(k.wrapClass)}}i.before(j).css("opacity",0).css(h).remove();if(a.browser.msie){i.css("filter","Alpha(opacity=0)")}j.append(i);o=d(this);a(o).css(h);o.height=this.height;o.width=this.width;q=function(b){var d,f;f=m(this,k);if(!f.neverOn&&!f.alwaysOn){d=g(this);e(o,d[0],d[1],f,"highlighted");if(f.groupBy){var h;if(/^[a-zA-Z][-a-zA-Z]+$/.test(f.groupBy)){h=n.find("area["+f.groupBy+'="'+a(this).attr(f.groupBy)+'"]')}else{h=n.find(f.groupBy)}var i=this;h.each(function(){if(this!=i){var a=m(this,k);if(!a.neverOn&&!a.alwaysOn){var b=g(this);e(o,b[0],b[1],a,"highlighted")}}})}if(!c){a(o).append("<v:rect></v:rect>")}}};a(n).bind("alwaysOn.maphilight",function(){if(p){f(p)}if(!c){a(o).empty()}a(n).find("area[coords]").each(function(){var b,f;f=m(this,k);if(f.alwaysOn){if(!p&&c){p=d(i.get());a(p).css(h);p.width=i.width();p.height=i.height();i.before(p)}f.fade=f.alwaysOnFade;b=g(this);if(c){e(p,b[0],b[1],f,"")}else{e(o,b[0],b[1],f,"")}}})});a(n).trigger("alwaysOn.maphilight").find("area[coords]").bind("mouseover.maphilight",q).bind("mouseout.maphilight",function(a){f(o)});i.before(o);i.addClass("maphilighted")})};a.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false,neverOn:false,groupBy:false,wrapClass:true,shadow:false,shadowX:0,shadowY:0,shadowRadius:6,shadowColor:"000000",shadowOpacity:.8,shadowPosition:"outside",shadowFrom:false}})(jQuery);

// VideoJS - HTML5 Video Player v2.0.2 This file is part of VideoJS. Copyright 2010 Zencoder, Inc. VideoJS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VideoJS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with VideoJS.  If not, see <http://www.gnu.org/licenses/>.
(function(a,b){var c=a.document;(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.JRClass=function(){};JRClass.extend=function(c){function g(){if(!a&&this.init)this.init.apply(this,arguments)}var d=this.prototype;a=true;var e=new this;a=false;for(var f in c){e[f]=typeof c[f]=="function"&&typeof d[f]=="function"&&b.test(c[f])?function(a,b){return function(){var c=this._super;this._super=d[a];var e=b.apply(this,arguments);this._super=c;return e}}(f,c[f]):c[f]}g.prototype=e;g.constructor=g;g.extend=arguments.callee;return g}})();var d=JRClass.extend({init:function(a,e){if(typeof a=="string"){this.video=c.getElementById(a)}else{this.video=a}this.video.player=this;this.values={};this.elements={};this.options={autoplay:false,preload:true,useBuiltInControls:false,controlsBelow:false,controlsAtStart:false,controlsHiding:true,defaultVolume:.85,playerFallbackOrder:["html5","flash","links"],flashPlayer:"htmlObject",flashPlayerVersion:false};if(typeof d.options=="object"){_V_.merge(this.options,d.options)}if(typeof e=="object"){_V_.merge(this.options,e)}if(this.getPreloadAttribute()!==b){this.options.preload=this.getPreloadAttribute()}if(this.getAutoplayAttribute()!==b){this.options.autoplay=this.getAutoplayAttribute()}this.box=this.video.parentNode;this.linksFallback=this.getLinksFallback();this.hideLinksFallback();this.each(this.options.playerFallbackOrder,function(a){if(this[a+"Supported"]()){this[a+"Init"]();return true}});this.activateElement(this,"player");this.activateElement(this.box,"box")},behaviors:{},newBehavior:function(a,b,c){this.behaviors[a]=b;this.extend(c)},activateElement:function(a,b){if(typeof a=="string"){a=c.getElementById(a)}this.behaviors[b].call(this,a)},errors:[],warnings:[],warning:function(a){this.warnings.push(a);this.log(a)},history:[],log:function(a){if(!a){return}if(typeof a=="string"){a={type:a}}if(a.type){this.history.push(a.type)}if(this.history.length>=50){this.history.shift()}try{console.log(a.type)}catch(b){try{opera.postError(a.type)}catch(b){}}},setLocalStorage:function(a,b){if(!localStorage){return}try{localStorage[a]=b}catch(c){if(c.code==22||c.code==1014){this.warning(d.warnings.localStorageFull)}}},getPreloadAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")){var a=this.video.getAttribute("preload");if(a===""||a==="true"){return"auto"}if(a==="false"){return"none"}return a}},getAutoplayAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("autoplay")){var a=this.video.getAttribute("autoplay");if(a==="false"){return false}return true}},bufferedPercent:function(){return this.duration()?this.buffered()[1]/this.duration():0},each:function(a,b){if(!a||a.length===0){return}for(var c=0,d=a.length;c<d;c++){if(b.call(this,a[c],c)){break}}},extend:function(a){for(var b in a){if(a.hasOwnProperty(b)){this[b]=a[b]}}}});d.player=d.prototype;d.player.extend({flashSupported:function(){if(!this.flashElement){this.flashElement=this.getFlashElement()}if(this.flashElement&&this.flashPlayerVersionSupported()){return true}else{return false}},flashInit:function(){this.replaceWithFlash();this.element=this.flashElement;this.video.src="";var a=d.flashPlayers[this.options.flashPlayer];this.extend(d.flashPlayers[this.options.flashPlayer].api);a.init.context(this)()},getFlashElement:function(){var a=this.video.children;for(var b=0,c=a.length;b<c;b++){if(a[b].className=="vjs-flash-fallback"){return a[b]}}},replaceWithFlash:function(){if(this.flashElement){this.box.insertBefore(this.flashElement,this.video);this.video.style.display="none"}},flashPlayerVersionSupported:function(){var a=this.options.flashPlayerVersion?this.options.flashPlayerVersion:d.flashPlayers[this.options.flashPlayer].flashPlayerVersion;return d.getFlashVersion()>=a}});d.flashPlayers={};d.flashPlayers.htmlObject={flashPlayerVersion:9,init:function(){return true},api:{width:function(a){if(a!==b){this.element.width=a;this.box.style.width=a+"px";this.triggerResizeListeners();return this}return this.element.width},height:function(a){if(a!==b){this.element.height=a;this.box.style.height=a+"px";this.triggerResizeListeners();return this}return this.element.height}}};d.player.extend({linksSupported:function(){return true},linksInit:function(){this.showLinksFallback();this.element=this.video},getLinksFallback:function(){return this.box.getElementsByTagName("P")[0]},hideLinksFallback:function(){if(this.linksFallback){this.linksFallback.style.display="none"}},showLinksFallback:function(){if(this.linksFallback){this.linksFallback.style.display="block"}}});d.merge=function(a,b,c){for(var d in b){if(b.hasOwnProperty(d)&&(!c||!a.hasOwnProperty(d))){a[d]=b[d]}}return a};d.extend=function(a){this.merge(this,a,true)};d.extend({setupAllWhenReady:function(a){d.options=a;d.DOMReady(d.setup)},DOMReady:function(a){d.addToDOMReady(a)},setup:function(a,b){var e=false,f=[],g;if(!a||a=="All"){a=d.getVideoJSTags()}else if(typeof a!="object"||a.nodeType==1){a=[a];e=true}for(var h=0;h<a.length;h++){if(typeof a[h]=="string"){g=c.getElementById(a[h])}else{g=a[h]}f.push(new d(g,b))}return e?f[0]:f},getVideoJSTags:function(){var a=c.getElementsByTagName("video"),b=[],d;for(var e=0,f=a.length;e<f;e++){d=a[e];if(d.className.indexOf("video-js")!=-1){b.push(d)}}return b},browserSupportsVideo:function(){if(typeof d.videoSupport!="undefined"){return d.videoSupport}d.videoSupport=!!c.createElement("video").canPlayType;return d.videoSupport},getFlashVersion:function(){if(typeof d.flashVersion!="undefined"){return d.flashVersion}var b=0,c;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){c=navigator.plugins["Shockwave Flash"].description;if(c&&!(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-shockwave-flash"]&&!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)){b=parseInt(c.match(/^.*\s+([^\s]+)\.[^\s]+\s+[^\s]+jQuery/)[1],10)}}else if(typeof a.ActiveXObject!="undefined"){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(e){b=parseInt(e.GetVariable("jQueryversion").match(/^[^\s]+\s(\d+)/)[1],10)}}catch(f){}}d.flashVersion=b;return d.flashVersion},isIE:function(){return!+"1"},isIPad:function(){return navigator.userAgent.match(/iPad/i)!==null},isIPhone:function(){return navigator.userAgent.match(/iPhone/i)!==null},isIOS:function(){return d.isIPhone()||d.isIPad()},iOSVersion:function(){var a=navigator.userAgent.match(/OS (\d+)_/i);if(a&&a[1]){return a[1]}},isAndroid:function(){return navigator.userAgent.match(/Android/i)!==null},androidVersion:function(){var a=navigator.userAgent.match(/Android (\d+)\./i);if(a&&a[1]){return a[1]}},warnings:{videoNotReady:"Video is not ready yet (try playing the video first).",localStorageFull:"Local Storage is Full"}});if(d.isIE()){c.createElement("video")}a.VideoJS=a._V_=d;d.player.extend({html5Supported:function(){if(d.browserSupportsVideo()&&this.canPlaySource()){return true}else{return false}},html5Init:function(){this.element=this.video;this.fixPreloading();this.supportProgressEvents();this.volume(localStorage&&localStorage.volume||this.options.defaultVolume);if(d.isIOS()){this.options.useBuiltInControls=true;this.iOSInterface()}else if(d.isAndroid()){this.options.useBuiltInControls=true;this.androidInterface()}if(!this.options.useBuiltInControls){this.video.controls=false;if(this.options.controlsBelow){_V_.addClass(this.box,"vjs-controls-below")}this.activateElement(this.video,"playToggle");this.buildStylesCheckDiv();this.buildAndActivatePoster();this.buildBigPlayButton();this.buildAndActivateSpinner();this.buildAndActivateControlBar();this.loadInterface();this.getSubtitles()}},canPlaySource:function(){if(this.canPlaySourceResult){return this.canPlaySourceResult}var a=this.video.children;for(var b=0,c=a.length;b<c;b++){if(a[b].tagName.toUpperCase()=="SOURCE"){var d=this.video.canPlayType(a[b].type)||this.canPlayExt(a[b].src);if(d=="probably"||d=="maybe"){this.firstPlayableSource=a[b];this.canPlaySourceResult=true;return true}}}this.canPlaySourceResult=false;return false},canPlayExt:function(a){if(!a){return""}var b=a.match(/\.([^\.]+)jQuery/);if(b&&b[1]){var c=b[1].toLowerCase();if(d.isAndroid()){if(c=="mp4"||c=="m4v"){return"maybe"}}else if(d.isIOS()){if(c=="m3u8"){return"maybe"}}}return""},forceTheSource:function(){this.video.src=this.firstPlayableSource.src;this.video.load()},fixPreloading:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")&&this.video.preload!="none"){this.video.autobuffer=true}else{this.video.autobuffer=false;this.video.preload="none"}},supportProgressEvents:function(a){_V_.addListener(this.video,"progress",this.playerOnVideoProgress.context(this))},playerOnVideoProgress:function(a){this.setBufferedFromProgress(a)},setBufferedFromProgress:function(a){if(a.total>0){var b=a.loaded/a.total*this.duration();if(b>this.values.bufferEnd){this.values.bufferEnd=b}}},iOSInterface:function(){if(d.iOSVersion()<4){this.forceTheSource()}if(d.isIPad()){this.buildAndActivateSpinner()}},androidInterface:function(){this.forceTheSource();_V_.addListener(this.video,"click",function(){this.play()});this.buildBigPlayButton();_V_.addListener(this.bigPlayButton,"click",function(){this.play()}.context(this));this.positionBox();this.showBigPlayButtons()},loadInterface:function(){if(!this.stylesHaveLoaded()){if(!this.positionRetries){this.positionRetries=1}if(this.positionRetries++<100){setTimeout(this.loadInterface.context(this),10);return}}this.hideStylesCheckDiv();this.showPoster();if(this.video.paused!==false){this.showBigPlayButtons()}if(this.options.controlsAtStart){this.showControlBars()}this.positionAll()},buildAndActivateControlBar:function(){this.controls=_V_.createElement("div",{className:"vjs-controls"});this.box.appendChild(this.controls);this.activateElement(this.controls,"controlBar");this.activateElement(this.controls,"mouseOverVideoReporter");this.playControl=_V_.createElement("div",{className:"vjs-play-control",innerHTML:"<span></span>"});this.controls.appendChild(this.playControl);this.activateElement(this.playControl,"playToggle");this.progressControl=_V_.createElement("div",{className:"vjs-progress-control"});this.controls.appendChild(this.progressControl);this.progressHolder=_V_.createElement("div",{className:"vjs-progress-holder"});this.progressControl.appendChild(this.progressHolder);this.activateElement(this.progressHolder,"currentTimeScrubber");this.loadProgressBar=_V_.createElement("div",{className:"vjs-load-progress"});this.progressHolder.appendChild(this.loadProgressBar);this.activateElement(this.loadProgressBar,"loadProgressBar");this.playProgressBar=_V_.createElement("div",{className:"vjs-play-progress"});this.progressHolder.appendChild(this.playProgressBar);this.activateElement(this.playProgressBar,"playProgressBar");this.timeControl=_V_.createElement("div",{className:"vjs-time-control"});this.controls.appendChild(this.timeControl);this.currentTimeDisplay=_V_.createElement("span",{className:"vjs-current-time-display",innerHTML:"00:00"});this.timeControl.appendChild(this.currentTimeDisplay);this.activateElement(this.currentTimeDisplay,"currentTimeDisplay");this.timeSeparator=_V_.createElement("span",{innerHTML:" / "});this.timeControl.appendChild(this.timeSeparator);this.durationDisplay=_V_.createElement("span",{className:"vjs-duration-display",innerHTML:"00:00"});this.timeControl.appendChild(this.durationDisplay);this.activateElement(this.durationDisplay,"durationDisplay");this.volumeControl=_V_.createElement("div",{className:"vjs-volume-control",innerHTML:"<div><span></span><span></span><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.volumeControl);this.activateElement(this.volumeControl,"volumeScrubber");this.volumeDisplay=this.volumeControl.children[0];this.activateElement(this.volumeDisplay,"volumeDisplay");this.fullscreenControl=_V_.createElement("div",{className:"vjs-fullscreen-control",innerHTML:"<div><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.fullscreenControl);this.activateElement(this.fullscreenControl,"fullscreenToggle")},buildAndActivatePoster:function(){this.updatePosterSource();if(this.video.poster){this.poster=c.createElement("img");this.box.appendChild(this.poster);this.poster.src=this.video.poster;this.poster.className="vjs-poster";this.activateElement(this.poster,"poster")}else{this.poster=false}},buildBigPlayButton:function(){this.bigPlayButton=_V_.createElement("div",{className:"vjs-big-play-button",innerHTML:"<span></span>"});this.box.appendChild(this.bigPlayButton);this.activateElement(this.bigPlayButton,"bigPlayButton")},buildAndActivateSpinner:function(){this.spinner=_V_.createElement("div",{className:"vjs-spinner",innerHTML:"<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>"});this.box.appendChild(this.spinner);this.activateElement(this.spinner,"spinner")},buildStylesCheckDiv:function(){this.stylesCheckDiv=_V_.createElement("div",{className:"vjs-styles-check"});this.stylesCheckDiv.style.position="absolute";this.box.appendChild(this.stylesCheckDiv)},hideStylesCheckDiv:function(){this.stylesCheckDiv.style.display="none"},stylesHaveLoaded:function(){if(this.stylesCheckDiv.offsetHeight!=5){return false}else{return true}},positionAll:function(){this.positionBox();this.positionControlBars();this.positionPoster()},positionBox:function(){if(this.videoIsFullScreen){this.box.style.width="";this.element.style.height="";if(this.options.controlsBelow){this.box.style.height="";this.element.style.height=this.box.offsetHeight-this.controls.offsetHeight+"px"}}else{this.box.style.width=this.width()+"px";this.element.style.height=this.height()+"px";if(this.options.controlsBelow){this.element.style.height=""}}},getSubtitles:function(){var a=this.video.getElementsByTagName("TRACK");for(var b=0,c=a.length;b<c;b++){if(a[b].getAttribute("kind")=="subtitles"&&a[b].getAttribute("src")){this.subtitlesSource=a[b].getAttribute("src");this.loadSubtitles();this.buildSubtitles()}}},loadSubtitles:function(){_V_.get(this.subtitlesSource,this.parseSubtitles.context(this))},parseSubtitles:function(a){var b=a.split("\n"),c="",d,e,f;this.subtitles=[];this.currentSubtitle=false;this.lastSubtitleIndex=0;for(var g=0;g<b.length;g++){c=_V_.trim(b[g]);if(c){d={id:c,index:this.subtitles.length};c=_V_.trim(b[++g]);e=c.split(" --> ");d.start=this.parseSubtitleTime(e[0]);d.end=this.parseSubtitleTime(e[1]);f=[];for(var h=g;h<b.length;h++){c=_V_.trim(b[++g]);if(!c){break}f.push(c)}d.text=f.join("<br/>");this.subtitles.push(d)}}},parseSubtitleTime:function(a){var b=a.split(":"),c=0;c+=parseFloat(b[0])*60*60;c+=parseFloat(b[1])*60;var d=b[2].split(/\.|,/);c+=parseFloat(d[0]);ms=parseFloat(d[1]);if(ms){c+=ms/1e3}return c},buildSubtitles:function(){this.subtitlesDisplay=_V_.createElement("div",{className:"vjs-subtitles"});this.box.appendChild(this.subtitlesDisplay);this.activateElement(this.subtitlesDisplay,"subtitlesDisplay")},addVideoListener:function(a,b){_V_.addListener(this.video,a,b.rEvtContext(this))},play:function(){this.video.play();return this},onPlay:function(a){this.addVideoListener("play",a);return this},pause:function(){this.video.pause();return this},onPause:function(a){this.addVideoListener("pause",a);return this},paused:function(){return this.video.paused},currentTime:function(a){if(a!==b){try{this.video.currentTime=a}catch(c){this.warning(d.warnings.videoNotReady)}this.values.currentTime=a;return this}return this.video.currentTime},onCurrentTimeUpdate:function(a){this.currentTimeListeners.push(a)},duration:function(){return this.video.duration},buffered:function(){if(this.values.bufferStart===b){this.values.bufferStart=0;this.values.bufferEnd=0}if(this.video.buffered&&this.video.buffered.length>0){var a=this.video.buffered.end(0);if(a>this.values.bufferEnd){this.values.bufferEnd=a}}return[this.values.bufferStart,this.values.bufferEnd]},volume:function(a){if(a!==b){this.values.volume=Math.max(0,Math.min(1,parseFloat(a)));this.video.volume=this.values.volume;this.setLocalStorage("volume",this.values.volume);return this}if(this.values.volume){return this.values.volume}return this.video.volume},onVolumeChange:function(a){_V_.addListener(this.video,"volumechange",a.rEvtContext(this))},width:function(a){if(a!==b){this.video.width=a;this.box.style.width=a+"px";this.triggerResizeListeners();return this}return this.video.offsetWidth},height:function(a){if(a!==b){this.video.height=a;this.box.style.height=a+"px";this.triggerResizeListeners();return this}return this.video.offsetHeight},supportsFullScreen:function(){if(typeof this.video.webkitEnterFullScreen=="function"){if(!navigator.userAgent.match("Chrome")&&!navigator.userAgent.match("Mac OS X 10.5")){return true}}return false},html5EnterNativeFullScreen:function(){try{this.video.webkitEnterFullScreen()}catch(a){if(a.code==11){this.warning(d.warnings.videoNotReady)}}return this},enterFullScreen:function(){if(this.supportsFullScreen()){this.html5EnterNativeFullScreen()}else{this.enterFullWindow()}},exitFullScreen:function(){if(this.supportsFullScreen()){}else{this.exitFullWindow()}},enterFullWindow:function(){this.videoIsFullScreen=true;this.docOrigOverflow=c.documentElement.style.overflow;_V_.addListener(c,"keydown",this.fullscreenOnEscKey.rEvtContext(this));_V_.addListener(a,"resize",this.fullscreenOnWindowResize.rEvtContext(this));c.documentElement.style.overflow="hidden";_V_.addClass(this.box,"vjs-fullscreen");this.positionAll()},exitFullWindow:function(){this.videoIsFullScreen=false;c.removeEventListener("keydown",this.fullscreenOnEscKey,false);a.removeEventListener("resize",this.fullscreenOnWindowResize,false);c.documentElement.style.overflow=this.docOrigOverflow;_V_.removeClass(this.box,"vjs-fullscreen");this.positionAll()},onError:function(a){this.addVideoListener("error",a);return this},onEnded:function(a){this.addVideoListener("ended",a);return this}});d.player.newBehavior("player",function(a){this.onError(this.playerOnVideoError);this.onPlay(this.playerOnVideoPlay);this.onPlay(this.trackCurrentTime);this.onPause(this.playerOnVideoPause);this.onPause(this.stopTrackingCurrentTime);this.onEnded(this.playerOnVideoEnded);this.trackBuffered();this.onBufferedUpdate(this.isBufferFull)},{playerOnVideoError:function(a){this.log(a);this.log(this.video.error)},playerOnVideoPlay:function(a){this.hasPlayed=true},playerOnVideoPause:function(a){},playerOnVideoEnded:function(a){this.currentTime(0);this.pause()},trackBuffered:function(){this.bufferedInterval=setInterval(this.triggerBufferedListeners.context(this),500)},stopTrackingBuffered:function(){clearInterval(this.bufferedInterval)},bufferedListeners:[],onBufferedUpdate:function(a){this.bufferedListeners.push(a)},triggerBufferedListeners:function(){this.isBufferFull();this.each(this.bufferedListeners,function(a){a.context(this)()})},isBufferFull:function(){if(this.bufferedPercent()==1){this.stopTrackingBuffered()}},trackCurrentTime:function(){if(this.currentTimeInterval){clearInterval(this.currentTimeInterval)}this.currentTimeInterval=setInterval(this.triggerCurrentTimeListeners.context(this),100);this.trackingCurrentTime=true},stopTrackingCurrentTime:function(){clearInterval(this.currentTimeInterval);this.trackingCurrentTime=false},currentTimeListeners:[],triggerCurrentTimeListeners:function(a,b){this.each(this.currentTimeListeners,function(a){a.context(this)(b||this.currentTime())})},resizeListeners:[],onResize:function(a){this.resizeListeners.push(a)},triggerResizeListeners:function(){this.each(this.resizeListeners,function(a){a.context(this)()})}});d.player.newBehavior("mouseOverVideoReporter",function(a){_V_.addListener(a,"mousemove",this.mouseOverVideoReporterOnMouseMove.context(this));_V_.addListener(a,"mouseout",this.mouseOverVideoReporterOnMouseOut.context(this))},{mouseOverVideoReporterOnMouseMove:function(){this.showControlBars();clearInterval(this.mouseMoveTimeout);this.mouseMoveTimeout=setTimeout(this.hideControlBars.context(this),4e3)},mouseOverVideoReporterOnMouseOut:function(a){var b=a.relatedTarget;while(b&&b!==this.box){b=b.parentNode}if(b!==this.box){this.hideControlBars()}}});d.player.newBehavior("box",function(a){this.positionBox();_V_.addClass(a,"vjs-paused");this.activateElement(a,"mouseOverVideoReporter");this.onPlay(this.boxOnVideoPlay);this.onPause(this.boxOnVideoPause)},{boxOnVideoPlay:function(){_V_.removeClass(this.box,"vjs-paused");_V_.addClass(this.box,"vjs-playing")},boxOnVideoPause:function(){_V_.removeClass(this.box,"vjs-playing");_V_.addClass(this.box,"vjs-paused")}});d.player.newBehavior("poster",function(a){this.activateElement(a,"mouseOverVideoReporter");this.activateElement(a,"playButton");this.onPlay(this.hidePoster);this.onEnded(this.showPoster);this.onResize(this.positionPoster)},{showPoster:function(){if(!this.poster){return}this.poster.style.display="block";this.positionPoster()},positionPoster:function(){if(!this.poster||this.poster.style.display=="none"){return}this.poster.style.height=this.height()+"px";this.poster.style.width=this.width()+"px"},hidePoster:function(){if(!this.poster){return}this.poster.style.display="none"},updatePosterSource:function(){if(!this.video.poster){var a=this.video.getElementsByTagName("img");if(a.length>0){this.video.poster=a[0].src}}}});d.player.newBehavior("controlBar",function(a){if(!this.controlBars){this.controlBars=[];this.onResize(this.positionControlBars)}this.controlBars.push(a);_V_.addListener(a,"mousemove",this.onControlBarsMouseMove.context(this));_V_.addListener(a,"mouseout",this.onControlBarsMouseOut.context(this))},{showControlBars:function(){if(!this.options.controlsAtStart&&!this.hasPlayed){return}this.each(this.controlBars,function(a){a.style.display="block"})},positionControlBars:function(){this.updatePlayProgressBars();this.updateLoadProgressBars()},hideControlBars:function(){if(this.options.controlsHiding&&!this.mouseIsOverControls){this.each(this.controlBars,function(a){a.style.display="none"})}},onControlBarsMouseMove:function(){this.mouseIsOverControls=true},onControlBarsMouseOut:function(a){this.mouseIsOverControls=false}});d.player.newBehavior("playToggle",function(a){if(!this.elements.playToggles){this.elements.playToggles=[];this.onPlay(this.playTogglesOnPlay);this.onPause(this.playTogglesOnPause)}this.elements.playToggles.push(a);_V_.addListener(a,"click",this.onPlayToggleClick.context(this))},{onPlayToggleClick:function(a){if(this.paused()){this.play()}else{this.pause()}},playTogglesOnPlay:function(a){this.each(this.elements.playToggles,function(a){_V_.removeClass(a,"vjs-paused");_V_.addClass(a,"vjs-playing")})},playTogglesOnPause:function(a){this.each(this.elements.playToggles,function(a){_V_.removeClass(a,"vjs-playing");_V_.addClass(a,"vjs-paused")})}});d.player.newBehavior("playButton",function(a){_V_.addListener(a,"click",this.onPlayButtonClick.context(this))},{onPlayButtonClick:function(a){this.play()}});d.player.newBehavior("pauseButton",function(a){_V_.addListener(a,"click",this.onPauseButtonClick.context(this))},{onPauseButtonClick:function(a){this.pause()}});d.player.newBehavior("playProgressBar",function(a){if(!this.playProgressBars){this.playProgressBars=[];this.onCurrentTimeUpdate(this.updatePlayProgressBars)}this.playProgressBars.push(a)},{updatePlayProgressBars:function(a){var c=a!==b?a/this.duration():this.currentTime()/this.duration();if(isNaN(c)){c=0}this.each(this.playProgressBars,function(a){if(a.style){a.style.width=_V_.round(c*100,2)+"%"}})}});d.player.newBehavior("loadProgressBar",function(a){if(!this.loadProgressBars){this.loadProgressBars=[]}this.loadProgressBars.push(a);this.onBufferedUpdate(this.updateLoadProgressBars)},{updateLoadProgressBars:function(){this.each(this.loadProgressBars,function(a){if(a.style){a.style.width=_V_.round(this.bufferedPercent()*100,2)+"%"}})}});d.player.newBehavior("currentTimeDisplay",function(a){if(!this.currentTimeDisplays){this.currentTimeDisplays=[];this.onCurrentTimeUpdate(this.updateCurrentTimeDisplays)}this.currentTimeDisplays.push(a)},{updateCurrentTimeDisplays:function(a){if(!this.currentTimeDisplays){return}var b=a?a:this.currentTime();this.each(this.currentTimeDisplays,function(a){a.innerHTML=_V_.formatTime(b)})}});d.player.newBehavior("durationDisplay",function(a){if(!this.durationDisplays){this.durationDisplays=[];this.onCurrentTimeUpdate(this.updateDurationDisplays)}this.durationDisplays.push(a)},{updateDurationDisplays:function(){if(!this.durationDisplays){return}this.each(this.durationDisplays,function(a){if(this.duration()){a.innerHTML=_V_.formatTime(this.duration())}})}});d.player.newBehavior("currentTimeScrubber",function(a){_V_.addListener(a,"mousedown",this.onCurrentTimeScrubberMouseDown.rEvtContext(this))},{onCurrentTimeScrubberMouseDown:function(a,b){a.preventDefault();this.currentScrubber=b;this.stopTrackingCurrentTime();this.videoWasPlaying=!this.paused();this.pause();_V_.blockTextSelection();this.setCurrentTimeWithScrubber(a);_V_.addListener(c,"mousemove",this.onCurrentTimeScrubberMouseMove.rEvtContext(this));_V_.addListener(c,"mouseup",this.onCurrentTimeScrubberMouseUp.rEvtContext(this))},onCurrentTimeScrubberMouseMove:function(a){this.setCurrentTimeWithScrubber(a)},onCurrentTimeScrubberMouseUp:function(a){_V_.unblockTextSelection();c.removeEventListener("mousemove",this.onCurrentTimeScrubberMouseMove,false);c.removeEventListener("mouseup",this.onCurrentTimeScrubberMouseUp,false);if(this.videoWasPlaying){this.play();this.trackCurrentTime()}},setCurrentTimeWithScrubber:function(a){var b=_V_.getRelativePosition(a.pageX,this.currentScrubber);var c=b*this.duration();this.triggerCurrentTimeListeners(0,c);if(c==this.duration()){c=c-.1}this.currentTime(c)}});d.player.newBehavior("volumeDisplay",function(a){if(!this.volumeDisplays){this.volumeDisplays=[];this.onVolumeChange(this.updateVolumeDisplays)}this.volumeDisplays.push(a);this.updateVolumeDisplay(a)},{updateVolumeDisplays:function(){if(!this.volumeDisplays){return}this.each(this.volumeDisplays,function(a){this.updateVolumeDisplay(a)})},updateVolumeDisplay:function(a){var b=Math.ceil(this.volume()*6);this.each(a.children,function(a,c){if(c<b){_V_.addClass(a,"vjs-volume-level-on")}else{_V_.removeClass(a,"vjs-volume-level-on")}})}});d.player.newBehavior("volumeScrubber",function(a){_V_.addListener(a,"mousedown",this.onVolumeScrubberMouseDown.rEvtContext(this))},{onVolumeScrubberMouseDown:function(a,b){_V_.blockTextSelection();this.currentScrubber=b;this.setVolumeWithScrubber(a);_V_.addListener(c,"mousemove",this.onVolumeScrubberMouseMove.rEvtContext(this));_V_.addListener(c,"mouseup",this.onVolumeScrubberMouseUp.rEvtContext(this))},onVolumeScrubberMouseMove:function(a){this.setVolumeWithScrubber(a)},onVolumeScrubberMouseUp:function(a){this.setVolumeWithScrubber(a);_V_.unblockTextSelection();c.removeEventListener("mousemove",this.onVolumeScrubberMouseMove,false);c.removeEventListener("mouseup",this.onVolumeScrubberMouseUp,false)},setVolumeWithScrubber:function(a){var b=_V_.getRelativePosition(a.pageX,this.currentScrubber);this.volume(b)}});d.player.newBehavior("fullscreenToggle",function(a){_V_.addListener(a,"click",this.onFullscreenToggleClick.context(this))},{onFullscreenToggleClick:function(a){if(!this.videoIsFullScreen){this.enterFullScreen()}else{this.exitFullScreen()}},fullscreenOnWindowResize:function(a){this.positionControlBars()},fullscreenOnEscKey:function(a){if(a.keyCode==27){this.exitFullScreen()}}});d.player.newBehavior("bigPlayButton",function(a){if(!this.elements.bigPlayButtons){this.elements.bigPlayButtons=[];this.onPlay(this.bigPlayButtonsOnPlay);this.onEnded(this.bigPlayButtonsOnEnded)}this.elements.bigPlayButtons.push(a);this.activateElement(a,"playButton")},{bigPlayButtonsOnPlay:function(a){this.hideBigPlayButtons()},bigPlayButtonsOnEnded:function(a){this.showBigPlayButtons()},showBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(a){a.style.display="block"})},hideBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(a){a.style.display="none"})}});d.player.newBehavior("spinner",function(a){if(!this.spinners){this.spinners=[];_V_.addListener(this.video,"loadeddata",this.spinnersOnVideoLoadedData.context(this));_V_.addListener(this.video,"loadstart",this.spinnersOnVideoLoadStart.context(this));_V_.addListener(this.video,"seeking",this.spinnersOnVideoSeeking.context(this));_V_.addListener(this.video,"seeked",this.spinnersOnVideoSeeked.context(this));_V_.addListener(this.video,"canplay",this.spinnersOnVideoCanPlay.context(this));_V_.addListener(this.video,"canplaythrough",this.spinnersOnVideoCanPlayThrough.context(this));_V_.addListener(this.video,"waiting",this.spinnersOnVideoWaiting.context(this));_V_.addListener(this.video,"stalled",this.spinnersOnVideoStalled.context(this));_V_.addListener(this.video,"suspend",this.spinnersOnVideoSuspend.context(this));_V_.addListener(this.video,"playing",this.spinnersOnVideoPlaying.context(this));_V_.addListener(this.video,"timeupdate",this.spinnersOnVideoTimeUpdate.context(this))}this.spinners.push(a)},{showSpinners:function(){this.each(this.spinners,function(a){a.style.display="block"});clearInterval(this.spinnerInterval);this.spinnerInterval=setInterval(this.rotateSpinners.context(this),100)},hideSpinners:function(){this.each(this.spinners,function(a){a.style.display="none"});clearInterval(this.spinnerInterval)},spinnersRotated:0,rotateSpinners:function(){this.each(this.spinners,function(a){a.style.WebkitTransform="scale(0.5) rotate("+this.spinnersRotated+"deg)";a.style.MozTransform="scale(0.5) rotate("+this.spinnersRotated+"deg)"});if(this.spinnersRotated==360){this.spinnersRotated=0}this.spinnersRotated+=45},spinnersOnVideoLoadedData:function(a){this.hideSpinners()},spinnersOnVideoLoadStart:function(a){this.showSpinners()},spinnersOnVideoSeeking:function(a){},spinnersOnVideoSeeked:function(a){},spinnersOnVideoCanPlay:function(a){},spinnersOnVideoCanPlayThrough:function(a){this.hideSpinners()},spinnersOnVideoWaiting:function(a){this.showSpinners()},spinnersOnVideoStalled:function(a){},spinnersOnVideoSuspend:function(a){},spinnersOnVideoPlaying:function(a){this.hideSpinners()},spinnersOnVideoTimeUpdate:function(a){if(this.spinner.style.display=="block"){this.hideSpinners()}}});d.player.newBehavior("subtitlesDisplay",function(a){if(!this.subtitleDisplays){this.subtitleDisplays=[];this.onCurrentTimeUpdate(this.subtitleDisplaysOnVideoTimeUpdate);this.onEnded(function(){this.lastSubtitleIndex=0}.context(this))}this.subtitleDisplays.push(a)},{subtitleDisplaysOnVideoTimeUpdate:function(a){if(this.subtitles){if(!this.currentSubtitle||this.currentSubtitle.start>=a||this.currentSubtitle.end<a){var b=false,c=this.subtitles[this.lastSubtitleIndex].start>a,d=this.lastSubtitleIndex-c?1:0;while(true){if(c){if(d<0||this.subtitles[d].end<a){break}if(this.subtitles[d].start<a){b=d;break}d--}else{if(d>=this.subtitles.length||this.subtitles[d].start>a){break}if(this.subtitles[d].end>a){b=d;break}d++}}if(b!==false){this.currentSubtitle=this.subtitles[b];this.lastSubtitleIndex=b;this.updateSubtitleDisplays(this.currentSubtitle.text)}else if(this.currentSubtitle){this.currentSubtitle=false;this.updateSubtitleDisplays("")}}}},updateSubtitleDisplays:function(a){this.each(this.subtitleDisplays,function(b){b.innerHTML=a})}});d.extend({addClass:function(a,b){if((" "+a.className+" ").indexOf(" "+b+" ")==-1){a.className=a.className===""?b:a.className+" "+b}},removeClass:function(a,b){if(a.className.indexOf(b)==-1){return}var c=a.className.split(/\s+/);c.splice(c.lastIndexOf(b),1);a.className=c.join(" ")},createElement:function(a,b){return this.merge(c.createElement(a),b)},blockTextSelection:function(){c.body.focus();c.onselectstart=function(){return false}},unblockTextSelection:function(){c.onselectstart=function(){return true}},formatTime:function(a){var b=Math.round(a);var c=Math.floor(b/60);c=c>=10?c:"0"+c;b=Math.floor(b%60);b=b>=10?b:"0"+b;return c+":"+b},getRelativePosition:function(a,b){return Math.max(0,Math.min(1,(a-this.findPosX(b))/b.offsetWidth))},findPosX:function(a){var b=a.offsetLeft;while(a=a.offsetParent){b+=a.offsetLeft}return b},getComputedStyleValue:function(b,c){return a.getComputedStyle(b,null).getPropertyValue(c)},round:function(a,b){if(!b){b=0}return Math.round(a*Math.pow(10,b))/Math.pow(10,b)},addListener:function(a,b,c){if(a.addEventListener){a.addEventListener(b,c,false)}else if(a.attachEvent){a.attachEvent("on"+b,c)}},removeListener:function(a,b,c){if(a.removeEventListener){a.removeEventListener(b,c,false)}else if(a.attachEvent){a.detachEvent("on"+b,c)}},get:function(a,b){if(typeof XMLHttpRequest=="undefined"){XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}throw new Error("This browser does not support XMLHttpRequest.")}}var c=new XMLHttpRequest;c.open("GET",a);c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){b(c.responseText)}}.context(this);c.send()},trim:function(a){return a.toString().replace(/^\s+/,"").replace(/\s+jQuery/,"")},bindDOMReady:function(){if(c.readyState==="complete"){return d.onDOMReady()}if(c.addEventListener){c.addEventListener("DOMContentLoaded",d.DOMContentLoaded,false);a.addEventListener("load",d.onDOMReady,false)}else if(c.attachEvent){c.attachEvent("onreadystatechange",d.DOMContentLoaded);a.attachEvent("onload",d.onDOMReady)}},DOMContentLoaded:function(){if(c.addEventListener){c.removeEventListener("DOMContentLoaded",d.DOMContentLoaded,false);d.onDOMReady()}else if(c.attachEvent){if(c.readyState==="complete"){c.detachEvent("onreadystatechange",d.DOMContentLoaded);d.onDOMReady()}}},DOMReadyList:[],addToDOMReady:function(a){if(d.DOMIsReady){a.call(c)}else{d.DOMReadyList.push(a)}},DOMIsReady:false,onDOMReady:function(){if(d.DOMIsReady){return}if(!c.body){return setTimeout(d.onDOMReady,13)}d.DOMIsReady=true;if(d.DOMReadyList){for(var a=0;a<d.DOMReadyList.length;a++){d.DOMReadyList[a].call(c)}d.DOMReadyList=null}}});d.bindDOMReady();Function.prototype.context=function(a){var b=this,c=function(){return b.apply(a,arguments)};return c};Function.prototype.evtContext=function(a){var b=this,c=function(){var c=this;return b.call(a,arguments[0],c)};return c};Function.prototype.rEvtContext=function(a,b){if(this.hasContext===true){return this}if(!b){b=a}for(var c in b){if(b[c]==this){b[c]=this.evtContext(a);b[c].hasContext=true;return b[c]}}return this.evtContext(a)};if(a.jQuery){(function(a){a.fn.VideoJS=function(a){this.each(function(){d.setup(this,a)});return this};a.fn.player=function(){return this[0].player}})(jQuery)}a.VideoJS=a._V_=d})(window);

/*
* CharLimit - jQuery plugin for counting and limiting characters for input and textarea fields
* jQueryVersion: 18.11.2008
* michal.podhradsky@gmail.com
*/
jQuery.fn.charLimit = function(options) {
	var defaults = {
		limit: 30,
		descending: true
	}
	var o = jQuery.extend(defaults, options);
	return this.each(function(i) {
		var obj = jQuery(this);
		var message = obj.next("p.char-count");
		message.attr("aria-live", "polite").attr("aria-relevant", "additions").attr("aria-atomic", "true");
		message.html("<em></em> characters remaining (" + o.limit + " maximum). " + message.text());
		countChars();
		function countChars() {
			var value = (o.descending) ? o.limit - obj.val().length : obj.val().length;
			message.children("em:first-child").text(value);
		}
		obj
			.keydown(function(e) {
				if (obj.val().length >= o.limit && e.keyCode != "8" && e.keyCode != "9" && e.keyCode != "46")
					e.preventDefault(); // cancel event
				countChars();
			})
			.keyup(function(e) {
				if (obj.val().length >= o.limit) {
					obj.val(obj.val().substr(0, o.limit))
				}
				countChars();
			})
	});
};









/* =========================================================
// jquery.innerfadeplus.js Modified by Bluearc FOR SIMMONS ELEXICA ONLY - DO NOT REUSE (unless you need the animation thing)
// Datum: 2008-02-14 Firma: Medienfreunde Hofmann & Baldes GbR Author: Torsten Baldes Mail: t.baldes@medienfreunde.com Web: http://medienfreunde.com

// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/ and Ralf S. Engelschall http://trainofthoughts.org/
 *
 *  <ul id="news"> 
 *      <li>content 1</li>
 *      <li>content 2</li>
 *      <li>content 3</li>
 *  </ul>
 *  
 *  Modified by Bluearc to include pagination and navigation
// ========================================================= */


(function(jQuery) {

	var currentIndex = 0;
	var timer;
    jQuery.fn.innerfadeplus = function(options) {
        return this.each(function() {   
            jQuery.innerfadeplus(this, options);
        });
    };
	
    jQuery.innerfadeplus = function(container, options) {
        var settings = {
            'speed': 2000,
            'timeout': 2000,
            'containerheight': 'auto',
            'runningclass': 'innerfadeplus',
			'activeclass': 'active',
            'children': null,
			'playpause': null,
			'prev': null,
			'next': null,
			'nav': null,
			'paused': false,
			'onBefore': null,
			'onAfter': null
        };
        if (options) {
            jQuery.extend(settings, options);
		}
        if (settings.children === null)
            var elements = jQuery(container).children();
        else
            var elements = jQuery(container).children(settings.children);
		var navElements = jQuery(settings.nav);
        if (elements.length > 1) {
			jQuery(elements[currentIndex]).addClass(settings.activeclass);
			jQuery(navElements[currentIndex]).addClass(settings.activeclass);
            jQuery(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
            for (var i = 0; i < elements.length; i++) {
                jQuery(elements[i]).css('z-index', String(elements.length-i)).hide();
            };
			if (settings.timeout != 0) {setTimeout(function() {jQuery.innerfadeplus.next(elements, navElements, settings);}, settings.timeout);};
			jQuery(elements[0]).show();
		}
		
		jQuery(settings.playpause).click(function(e) {
			e.preventDefault();
			if (jQuery(this).hasClass('alt')) {
				jQuery(this).removeClass('alt');
				settings.paused = false;
				timer = setTimeout((function() {
					jQuery.innerfadeplus.next(elements, navElements, settings);
				}), settings.timeout);
			} else {
				jQuery(this).addClass('alt');
				settings.paused = true;
				clearTimeout(timer);
			}
		});
		jQuery(settings.prev).click(function(e) {
			e.preventDefault();
			settings.timeout = 0;
			jQuery.innerfadeplus.prev(elements, navElements, settings);
		});
		jQuery(settings.next).click(function(e) {
			e.preventDefault();
			settings.timeout = 0;
			jQuery.innerfadeplus.next(elements, navElements, settings);
		});
		jQuery(settings.nav).each(function(e) {
			var jumpIndex = jQuery(settings.nav).index(this);
			jQuery(this).bind('click',function(e) {e.preventDefault(); jQuery.innerfadeplus.jump(elements, navElements, settings, jumpIndex);});
		});
    };

    jQuery.innerfadeplus.next = function(elements, navElements, settings) {
		clearTimeout(timer);
		if (settings.onBefore != null) {settings.onBefore();};
		var nextIndex;
        jQuery(elements[currentIndex]).fadeOut(settings.speed).removeClass(settings.activeclass);
		
		if (jQuery('body').hasClass('home')) {
			jQuery(elements[currentIndex]).find('.top-square').animate({marginLeft: '-835px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-80px');});
			jQuery(elements[currentIndex]).find('.btm-square').animate({marginLeft: '-1035px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-435px');});
			jQuery(elements[currentIndex]).find('.banner-desc').animate({marginLeft: '-635px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-380px');});
		} else {
			jQuery(elements[currentIndex]).find('.top-square').animate({left: '-100px'}, (settings.speed), function(){jQuery(this).css('left', '294px');});
			jQuery(elements[currentIndex]).find('.btm-square').animate({left: '-200px'}, (settings.speed), function(){jQuery(this).css('left', '0px');});
			jQuery(elements[currentIndex]).find('.banner-desc').animate({left: '-200px'}, (settings.speed), function(){jQuery(this).css('left', '20px');});
		}
				
		if ((currentIndex + 1) > (elements.length - 1)) {nextIndex = 0;} else {nextIndex = currentIndex + 1;};
        jQuery(elements[nextIndex]).fadeIn(settings.speed, function() {removeFilter(jQuery(this)[0]);}).addClass(settings.activeclass);
		
		if (jQuery('body').hasClass('home')) {
			jQuery(elements[nextIndex]).find('.top-square').delay(600).css('opacity', '0').css('margin-left', '400px').animate({marginLeft: '-80px', opacity: '.6'}, (settings.speed));
			jQuery(elements[nextIndex]).find('.btm-square').delay(600).css('opacity', '0').css('margin-left', '-50px').animate({marginLeft: '-435px', opacity: '.6'}, (settings.speed));
			jQuery(elements[nextIndex]).find('.banner-desc').delay(400).css('opacity', '0').css('margin-left', '-35px').animate({marginLeft: '-380px', opacity: '1'}, (settings.speed));
		} else {
			jQuery(elements[nextIndex]).find('.top-square').delay(400).css('opacity', '0').css('left', '600px').animate({left: '294px', opacity: '.6'}, (settings.speed));
			jQuery(elements[nextIndex]).find('.btm-square').delay(400).css('opacity', '0').css('left', '400px').animate({left: '0px', opacity: '.6'}, (settings.speed));
			jQuery(elements[nextIndex]).find('.banner-desc').delay(200).css('opacity', '0').css('left', '162px').animate({left: '20px', opacity: '1'}, (settings.speed));
		}
		
		jQuery(navElements[currentIndex]).removeClass(settings.activeclass);
		jQuery(navElements[nextIndex]).addClass(settings.activeclass);
		currentIndex = nextIndex;
		if (settings.onAfter != null) {settings.onAfter();};
		if (settings.timeout != 0 && settings.paused == false) {
			timer = setTimeout((function() {
				jQuery.innerfadeplus.next(elements, navElements, settings);
			}), settings.timeout);
		};
    };
	jQuery.innerfadeplus.prev = function(elements, navElements, settings) {
		clearTimeout(timer);
		if (settings.onBefore != null) {settings.onBefore();};
		var prevIndex;
        jQuery(elements[currentIndex]).fadeOut(settings.speed).removeClass(settings.activeclass);
		
		if (jQuery('body').hasClass('home')) {
			jQuery(elements[currentIndex]).find('.top-square').animate({marginLeft: '675px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-80px');});
			jQuery(elements[currentIndex]).find('.btm-square').animate({marginLeft: '165px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-435px');});
			jQuery(elements[currentIndex]).find('.banner-desc').animate({marginLeft: '-125px'}, (settings.speed), function(){jQuery(this).css('margin-left', '-380px');});
		} else {
			jQuery(elements[currentIndex]).find('.top-square').animate({left: '600px'}, (settings.speed), function(){jQuery(this).css('left', '294px');});
			jQuery(elements[currentIndex]).find('.btm-square').animate({left: '400px'}, (settings.speed), function(){jQuery(this).css('left', '0px');});
			jQuery(elements[currentIndex]).find('.banner-desc').animate({left: '162px'}, (settings.speed), function(){jQuery(this).css('left', '20px');});
		}
		
		if ((currentIndex - 1) < 0) {prevIndex = (elements.length - 1);} else {prevIndex = currentIndex - 1;};
        jQuery(elements[prevIndex]).fadeIn(settings.speed, function() {removeFilter(jQuery(this)[0]);}).addClass(settings.activeclass);
		
		if (jQuery('body').hasClass('home')) {
			jQuery(elements[prevIndex]).find('.top-square').delay(600).css('opacity', '0').css('margin-left', '-380px').animate({marginLeft: '-80px', opacity: '.6'}, (settings.speed));
			jQuery(elements[prevIndex]).find('.btm-square').delay(600).css('opacity', '0').css('margin-left', '-735px').animate({marginLeft: '-435px', opacity: '.6'}, (settings.speed));
			jQuery(elements[prevIndex]).find('.banner-desc').delay(400).css('opacity', '0').css('margin-left', '-680px').animate({marginLeft: '-380px', opacity: '1'}, (settings.speed));
		} else {
			jQuery(elements[prevIndex]).find('.top-square').delay(400).css('opacity', '0').css('left', '-100px').animate({left: '294px', opacity: '.6'}, (settings.speed));
			jQuery(elements[prevIndex]).find('.btm-square').delay(400).css('opacity', '0').css('left', '-200px').animate({left: '0px', opacity: '.6'}, (settings.speed));
			jQuery(elements[prevIndex]).find('.banner-desc').delay(200).css('opacity', '0').css('left', '-200px').animate({left: '20px', opacity: '1'}, (settings.speed));
		}
		
		jQuery(navElements[currentIndex]).removeClass(settings.activeclass);
		jQuery(navElements[prevIndex]).addClass(settings.activeclass);
		currentIndex = prevIndex;
		if (settings.onAfter != null) {settings.onAfter();};
		if (settings.timeout != 0 && settings.paused == false) {
			timer = setTimeout((function() {
				jQuery.innerfadeplus.next(elements, navElements, settings);
			}), settings.timeout);
		};
    };
	jQuery.innerfadeplus.jump = function(elements, navElements, settings, index) {
		clearTimeout(timer);
		if (settings.onBefore != null) {settings.onBefore();};
		var newIndex = index;
        jQuery(elements[currentIndex]).fadeOut(settings.speed).removeClass(settings.activeclass);
        jQuery(elements[newIndex]).fadeIn(settings.speed, function() {removeFilter(jQuery(this)[0]);}).addClass(settings.activeclass);
		jQuery(navElements[currentIndex]).removeClass(settings.activeclass);
		jQuery(navElements[newIndex]).addClass(settings.activeclass);
		currentIndex = newIndex;
		if (settings.onAfter != null) {settings.onAfter();};
		if (settings.timeout != 0 && settings.paused == false) {
			timer = setTimeout((function() {
				jQuery.innerfadeplus.next(elements, navElements, settings);
			}), settings.timeout);
		};
    };

	

})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}
