/*
 * Moving Boxes v2.1.4 minified
 * by Chris Coyier 
 * http://css-tricks.com/moving-boxes/
 */
 
$p = jQuery.noConflict();
$p(document).ready(function(){
	
		$p("a.tab").click(function (event) {
			event.preventDefault(); 						
			$p(".active").removeClass("active");
			ind = $p("ul.video-banner-leftNav li").index($p(this).parent());
			$p(this).addClass("active");
			$p(".content").hide();
			$p(".content:eq("+ind+")").show();

$p(".movingslider:eq("+ind+")").movingBoxes({
		startPanel   : 2,   
		width        : 695, 
		panelWidth   : .46,  
		buildNav     : true,   
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } 
	});
//$p('#slider-one .item12').innerHTML;
$p('#slider-one .item13').remove();
$p('#slider-one .item14').remove();

/*$p('#slider-three').movingBoxes({
		startPanel   : 2,   
		width        : 695, 
		panelWidth   : .46,  
		buildNav     : true,   
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } 
	});
$p('#slider-four').movingBoxes({
		startPanel   : 2,   
		width        : 695, 
		panelWidth   : .46,  
		buildNav     : true,   
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } 
	});
$p('#slider-five').movingBoxes({
		startPanel   : 1,   
		width        : 695, 
		panelWidth   : .46,  
		buildNav     : true,   
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } 
	});
$p('#slider-one').movingBoxes({
		startPanel   : 2,      // start with this panel
		width        : 695,    // overall width of movingBoxes (not including navigation arrows)
		panelWidth   : .46,     // current panel width adjusted to 70% of overall width
		buildNav     : true,   // if true, navigation links will be added
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } // function which gets nav text from span inside the panel header
	});		     */
		});


(function(d){


		  d.movingBoxes=function(e,h){
			  var c,a=this;a.$pel=d(e).addClass("mb-slider");
			  a.el=e;a.$pel.data("movingBoxes",a);
			  a.init=function(){a.options=c=d.extend({},d.movingBoxes.defaultOptions,h);
			  a.$pel.wrap('<div class="movingBoxes mb-wrapper"><div class="mb-scroll" /></div>');
			  a.$pwindow=a.$pel.parent();
			  a.$pwrap=a.$pwindow.parent().css({width:c.width}).prepend('<a class="mb-scrollButtons mb-left"></a>').append('<a class="mb-scrollButtons mb-right"></a><div class="mb-left-shadow"></div><div class="mb-right-shadow"></div>');
			  a.$ppanels=a.$pel.children().addClass("mb-panel");
			  a.runTime=d(".mb-slider").index(a.$pel)+1;a.regex=RegExp("slider"+a.runTime+"=(\\d+)","i");
			  a.initialized=!1;a.currentlyMoving=!1;
			  a.curPanel=1;
			  a.$pleft=a.$pwrap.find(".mb-left").click(function(){a.goBack();
																		 return!1});
			  a.$pright=a.$pwrap.find(".mb-right").click(function(){a.goForward();return!1});
			  a.update();
			  d(window).load(function(){a.update(!1)});
			  a.$pel.delegate(".mb-panel","click",function(){a.change(a.$ppanels.index(d(this))+1)});
			  a.$pwrap.click(function(){a.active()}); 
			  a.$ppanels.delegate("a","focus",function(){a.$ppanels.index(d(this).closest(".mb-panel"))+1!==a.curPanel&&a.change(a.$ppanels.index(d(this).closest(".mb-panel"))+1,{},!1)});
			  d(document).keyup(function(b){
										 if(!b.target.tagName.match("TEXTAREA|INPUT|SELECT")
																	)
										 switch(b.which)
										 {
											 case 39:case 32:a.$pwrap.is(".mb-active-slider")&&a.goForward();
											 break;
											 case 37:a.$pwrap.is(".mb-active-slider")&&a.goBack()}});
			  var b=c.hashTags?a.getHash()||c.startPanel:c.startPanel;
			  d.each("initialized.movingBoxes initChange.movingBoxes beforeAnimation.movingBoxes completed.movingBoxes".split(" "), function(b,f){var e=f.split(".")[0];d.isFunction(c[e])&&a.$pel.bind(f,c[e])});
			  setTimeout(function(){a.change(b,function(){a.initialized=!0;
														a.$pel.trigger("initialized.movingBoxes",[a,b])})},c.speed*2)};
			  a.update=function(b){
				  var g;
			  a.$ppanels=a.$pel.children().addClass("mb-panel").css({width:c.width*c.panelWidth}).each(function(){d(this).find(".mb-inside").length===0&&d(this).wrapInner('<div class="mb-inside" />')
						 });

$p(".mb-inside img").each(function(){
        $p(this).removeAttr('width')
        $p(this).removeAttr('height');
    });


			  a.totalPanels=a.$ppanels.length;g=a.$ppanels.eq(a.curPanel-1);
			  a.curWidth=a.curWidth|| g.outerWidth();
			  a.regWidth=a.curWidth*c.reducedSize;
			  a.$ppanels.css({width:a.curWidth,fontSize:"1em",margin:0});
			  a.$ppanels.eq(a.curPanel-1).addClass(c.currentPanel);
			  a.heights=a.$ppanels.map(function(a,b){return d(b).outerHeight(!0)}).get();
			  a.returnToNormal(a.curPanel,0);
			  a.growBigger(a.curPanel,0,b);
			  c.wrap||a.updateArrows(a.curPanel);
			  a.$pel.css({position:"absolute",width:(a.curWidth+100)*a.totalPanels+(c.width-a.curWidth)/2,height:Math.max.apply(this,a.heights)+10});
			  a.$pwindow.css({height:c.fixedHeight?Math.max.apply(this, a.heights):a.heights[a.curPanel-1]});
			  a.$ppanels.eq(0).css({"margin-left":(c.width-a.curWidth)/2});a.buildNav();
			  a.change(a.curPanel,{},!1)};
			  a.buildNav=function(){a.$pnavLinks={};
			  a.$pnav&&a.$pnav.remove();
			  if(c.buildNav&&a.totalPanels>1){
				  a.$pnav=d('<div class="mb-controls"><a class="mb-testing"></a></div>').appendTo(a.$pwrap);
				  var b,g="",f=d.isFunction(c.navFormatter),e=parseInt(a.$pnav.find(".mb-testing").css("text-indent"),10)<0;
				  a.$ppanels.each(function(a){
										  b=a+1;g+='<a href="#" class="mb-panel'+b;
										  f?(a=c.navFormatter(b, d(this)),g+=e?" "+c.tooltipClass+'" title="'+a:"",g+='">'+a+"</a> "):g+='">'+b+"</a> "});
				  a.$pnavLinks=a.$pnav.html(g).find("a").bind("click",function(){a.change(a.$pnavLinks.index(d(this))+1);
																											return!1
																											})
				  }};
				  a.returnToNormal=function(b,d){var f=a.$ppanels.not(":eq("+(b-1)+")").removeClass(c.currentPanel);
				  c.reducedSize===1?f.css({width:a.regWidth}):f.animate({width:a.regWidth,fontSize:c.reducedSize+"em"},d===0?d:c.speed)};
				  a.growBigger=function(b,d,f){var e=a.$ppanels.eq(b-1);
				  c.reducedSize===1?(e.css({width:a.curWidth}), a.initialized&&a.completed(b,f)):e.animate({width:a.curWidth,fontSize:"1em"},d===0?d:c.speed,function(){a.initialized&&a.completed(b,f)})};a.completed=function(b,d){a.$ppanels.eq(b-1).addClass(c.currentPanel);d!==!1&&a.$pel.trigger("completed.movingBoxes",[a,b])};a.goForward=function(){a.initialized&&a.change(a.curPanel+1)};a.goBack=function(){a.initialized&&a.change(a.curPanel-1)};a.change=function(b,d,f){b=parseInt(b,10);a.initialized&&(a.active(),a.$pel.trigger("initChange.movingBoxes",[a,b]));if(c.wrap){if(b< 1)b=a.totalPanels;b>a.totalPanels&&(b=1)}else if(b<1&&(b=1),b>a.totalPanels)b=a.totalPanels;if(a.initialized&&a.curPanel===b&&!f)return!1;if(!a.currentlyMoving||!a.initialized)a.currentlyMoving=!0,f=a.$ppanels.eq(b-1).position().left-(c.width-a.curWidth)/2,b>a.curPanel&&(f-=a.curWidth-a.regWidth),f=c.fixedHeight?{scrollLeft:f}:{scrollLeft:f,height:a.heights[b-1]},a.initialized&&a.$pel.trigger("beforeAnimation.movingBoxes",[a,b]),a.$pwindow.animate(f,{queue:!1,duration:c.speed,easing:c.easing,complete:function(){a.curPanel= b;a.initialized&&a.$pwindow.scrollTop(0);a.currentlyMoving=!1;typeof d==="function"&&d(a)}}),a.returnToNormal(b),a.growBigger(b),c.wrap||a.updateArrows(b),c.hashTags&&a.initialized&&a.setHash(b);a.$pwrap.find(".mb-controls a").removeClass(c.currentPanel).eq(b-1).addClass(c.currentPanel)};a.updateArrows=function(b){a.$pleft.toggleClass(c.disabled,b===1);a.$pright.toggleClass(c.disabled,b===a.totalPanels)};a.getHash=function(){var b=window.location.hash.match(a.regex);return b===null?"":parseInt(b[1],10)}; a.setHash=function(b){var c="slider"+a.runTime+"=",d=window.location.hash;if(typeof d!=="undefined")window.location.hash=d.indexOf(c)>0?d.replace(a.regex,c+b):d+"&"+c+b};a.active=function(){d(".mb-active-slider").removeClass("mb-active-slider");a.$pwrap.addClass("mb-active-slider")};a.currentPanel=function(b,c){typeof b!=="undefined"&&a.change(b,c);return a.curPanel};a.init()};d.movingBoxes.defaultOptions={startPanel:1,width:670,panelWidth:0.5,reducedSize:0.6,fixedHeight:!1,speed:500,hashTags:!0,wrap:!1, buildNav:!1,navFormatter:null,easing:"swing",currentPanel:"current",tooltipClass:"tooltip",disabled:"disabled",initialized:null,initChange:null,beforeAnimation:null,completed:null};d.fn.movingBoxes=function(e,h){var c,a=this.data("movingBoxes");return this.each(function(){(typeof e).match("object|undefined")?a?a.update():new d.movingBoxes(this,e):/\d/.test(e)&&!isNaN(e)&&a&&(c=typeof e==="number"?e:parseInt(d.trim(e),10),c>=1&&c<=a.totalPanels&&a.change(c,h))})};d.fn.getMovingBoxes=function(){return this.data("movingBoxes")}}) (jQuery);


$p(function(){
   
$p('#slider-one').movingBoxes({
		startPanel   : 2,      // start with this panel
		width        : 695,    // overall width of movingBoxes (not including navigation arrows)
		panelWidth   : .46,     // current panel width adjusted to 70% of overall width
		buildNav     : true,   // if true, navigation links will be added
		navFormatter : function(index, panel){ return panel.find('h2 span').text(); } // function which gets nav text from span inside the panel header
	});
$p('#slider-one .item12').remove();
$p('#slider-one .item13').remove();
$p('#slider-one .item14').remove();
});
 });					
