/*!
 * jQuery UI 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||function(c){c.ui={version:"1.8.1",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")=="hidden")return false;
b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,
PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||
/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==
undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&
!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery);
;/*!
 * jQuery UI Widget 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=
b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=
b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*
 * jQuery UI Accordion 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},_create:function(){var a=this.options,b=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset");
this.element[0].nodeName=="UL"&&this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(a.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c(this).removeClass("ui-state-focus")});
this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(a.navigation){var d=this.element.find("a").filter(a.navigationFilter);if(d.length){var f=d.closest(".ui-accordion-header");this.active=f.length?f:d.closest(".ui-accordion-content").prev()}}this.active=this._findActive(this.active||a.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");
this._createIcons();this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(g){return b._keydown(g)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();this.active.length?this.active.attr("aria-expanded","true").attr("tabIndex","0"):this.headers.eq(0).attr("tabIndex","0");c.browser.safari||this.headers.find("a").attr("tabIndex","-1");a.event&&this.headers.bind(a.event+
".accordion",function(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("<span/>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");
this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(a.autoHeight||a.fillHeight)b.css("height",
"");return this},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();b&&this._createIcons()}},_keydown:function(a){var b=c.ui.keyCode;if(!(this.options.disabled||a.altKey||a.ctrlKey)){var d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},
a.target);a.preventDefault()}if(g){c(a.target).attr("tabIndex","-1");c(g).attr("tabIndex","0");g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,
b-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a=="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=
this.options;if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]==this.active[0];d.active=d.collapsible&&b?false:c(".ui-accordion-header",this.element).index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);
a.next().addClass("ui-accordion-content-active")}e=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):e,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(e,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},e=this.active=c([]);this._toggle(e,f,g)}},_toggle:function(a,b,d,f,g){var e=this.options,k=this;this.toShow=a;this.toHide=b;this.data=d;var i=function(){if(k)return k._completed.apply(k,arguments)};this._trigger("changestart",null,this.data);this.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),
toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:i,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var h=e.duration,j=e.animated;if(j&&!f[j]&&!c.easing[j])j="slide";f[j]||(f[j]=function(l){this.slide(l,{easing:j,
duration:h||700})});f[j](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}i(true)}b.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();a.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(a){var b=this.options;this.running=a?0:--this.running;if(!this.running){b.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,
{version:"1.8.1",animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},e={},k;b=a.toShow;k=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(i,h){e[h]="hide";i=(""+c.css(a.toShow[0],
h)).match(/^([\d+-.]+)(.*)$/);g[h]={value:i[1],unit:i[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(e,{step:function(i,h){if(h.prop=="height")f=h.end-h.start===0?0:(h.now-h.start)/(h.end-h.start);a.toShow[0].style[h.prop]=f*g[h.prop].value+g[h.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css("width",k);a.toShow.css({overflow:d});a.complete()}})}else a.toHide.animate({height:"hide"},
a);else a.toShow.animate({height:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
;
$(function(){
	clearFormFields({
		clearInputs: true,
		clearTextareas: true,
		passwordFieldText: true,
		addClassFocus: "focus",
		filterClass: "default"
	});
	$("#carousel").carousel();
	initSlideHeading();
	$('ul.accordion').accordion({
		active: ".selected",
		autoHeight: false,
		header: ".opener",
		collapsible: true,
		event: "click"
	});
	initMenu();
	initFadeHover();
});
function _initFadeHover(){
	$('#nav a:not(.hidden)').each(function(){
		$(this).mouseenter(function(){
			$(this).hide();
			$(this).parent().find('> a.hidden').fadeIn().queue(false);
		});
		$(this).parent().find('> a.hidden').mouseleave(function(){
			$(this).animate({'opacity':0.4},{queue: false, duration: 250, complete: function(){
				$(this).css({
					'display':'none',
					'opacity':1
				});
				//$(this).parent().find('> a:not(.hidden)').fadeIn();
				$(this).parent().find('> a:not(.hidden)').show();
			}})
		});
	});
}
function initFadeHover(){
	$('span.bg, span.bg-nav').each(function(){
		if($(this).parents('li').hasClass('active')) $(this).css({'opacity': 0});
		else $(this).css({'opacity': 0});
	});
	$('div.boxes-holder li, ul.items-list > li, #nav > li').each(function(){
		$(this).mouseenter(function(){
				$(this).find('span.bg').animate({'opacity': 0.4}, 200);
				$(this).find('span.bg-nav').animate({'opacity': 1}, 300);				
			
		}).mouseleave(function(){

				$(this).find('span.bg').animate({'opacity': 0}, 200);
				$(this).find('span.bg-nav').animate({'opacity': 0}, 300);				
			
		});
	});
}
function initMenu(){
	var nav = $('div.nav-holder');
	var t = nav.offset().top;
	$(window).scroll(function(){
		var winT = $(window).scrollTop();
		if(winT >= t){
			if($.browser.msie){
				nav.css({
					position:'absolute',
					top:winT,
					left:0,
					zIndex:100
				});
			}
			else{
				nav.css({
					position:'fixed',
					top:0,
					left:0,
					zIndex:100
				});
			}
		}
		else{
			nav.css({
				position:'relative',
				top:0,
				left:0
			});
		}
	});
}
function initSlideHeading(){
	$('ul.image-list > li').each(function(){
		var _this = $(this);
		var info = _this.find('> .image-box');
		_this.mouseenter(function(){
			info.animate({bottom: 0},{queue:false, duration: 300});
		}).mouseleave(function(){
			info.animate({bottom: -23},{queue:false, duration: 300});
		});
	});
}
function clearFormFields(o)
{
	if (o.clearInputs == null) o.clearInputs = true;
	if (o.clearTextareas == null) o.clearTextareas = true;
	if (o.passwordFieldText == null) o.passwordFieldText = false;
	if (o.addClassFocus == null) o.addClassFocus = false;
	if (!o.filter) o.filter = "default";
	if(o.clearInputs) {
		var inputs = document.getElementsByTagName("input");
		for (var i = 0; i < inputs.length; i++ ) {
			if((inputs[i].type == "text" || inputs[i].type == "password") && inputs[i].className.indexOf(o.filterClass)) {
				inputs[i].valueHtml = inputs[i].value;
				inputs[i].onfocus = function ()	{
					if(this.valueHtml == this.value) this.value = "";
					if(this.fake) {
						inputsSwap(this, this.previousSibling);
						this.previousSibling.focus();
					}
					if(o.addClassFocus && !this.fake) {
						this.className += " " + o.addClassFocus;
						this.parentNode.className += " parent-" + o.addClassFocus;
					}
				}
				inputs[i].onblur = function () {
					if(this.value == "") {
						this.value = this.valueHtml;
						if(o.passwordFieldText && this.type == "password") inputsSwap(this, this.nextSibling);
					}
					if(o.addClassFocus) {
						this.className = this.className.replace(o.addClassFocus, "");
						this.parentNode.className = this.parentNode.className.replace("parent-"+o.addClassFocus, "");
					}
				}
				if(o.passwordFieldText && inputs[i].type == "password") {
					var fakeInput = document.createElement("input");
					fakeInput.type = "text";
					fakeInput.value = inputs[i].value;
					fakeInput.className = inputs[i].className;
					fakeInput.fake = true;
					inputs[i].parentNode.insertBefore(fakeInput, inputs[i].nextSibling);
					inputsSwap(inputs[i], null);
				}
			}
		}
	}
	if(o.clearTextareas) {
		var textareas = document.getElementsByTagName("textarea");
		for(var i=0; i<textareas.length; i++) {
			if(textareas[i].className.indexOf(o.filterClass)) {
				textareas[i].valueHtml = textareas[i].value;
				textareas[i].onfocus = function() {
					if(this.value == this.valueHtml) this.value = "";
					if(o.addClassFocus) {
						this.className += " " + o.addClassFocus;
						this.parentNode.className += " parent-" + o.addClassFocus;
					}
				}
				textareas[i].onblur = function() {
					if(this.value == "") this.value = this.valueHtml;
					if(o.addClassFocus) {
						this.className = this.className.replace(o.addClassFocus, "");
						this.parentNode.className = this.parentNode.className.replace("parent-"+o.addClassFocus, "");
					}
				}
			}
		}
	}
	function inputsSwap(el, el2) {
		if(el) el.style.display = "none";
		if(el2) el2.style.display = "inline";
	}
}
$.fn.carousel = function (options) {
	options = $.extend({}, $.fn.carousel.defaults, options || {});
	return $(this).each(function () {
		var pluginData = {
			centerFeatureWidth:     (options.containerWidth * options.centerFeatureFactor),
			smallFeatureWidth:      ((options.containerWidth * options.centerFeatureFactor) * options.smallFeatureFactor),
			currentCenterNum:       options.startingFeature,
			totalFeatureCount:      $(this).children("div").length,
			currentlyMoving:        false,
			featuresContainer:      $(this),
			containerIDTag:         "#"+$(this).attr("id"),
			timeoutVar:             null,
			animationQueue:         0,
			itemsToAnimate:         0
		}
		preload(function () {
			setupCarousel();
			setupFeaturePositions();
			if (options.useBlips == true) setupBlips();
			initiateMove(true,1);
		});
		function preload(callback) {
			if (options.preload == true) {
				$(".carouselLoader").css({left: (options.containerWidth / 2) - ($(".carouselLoader").width() / 2)}).show();
				var $imageElements = pluginData.featuresContainer.find("img:not(.carouselLoader)");
				var images = [];
				$imageElements.each(function () {
					if ($.inArray($(this).attr('src'),images) == -1) images.push($(this).attr('src'));
				});
				var loadedImages = 0;
				var totalImages = images.length;
				$imageElements.each(function () {
					if ($.inArray($(this).attr('src'),images) > -1) {
						$(this).load(function () {
							loadedImages++;
							if (loadedImages == totalImages) {
								$(".carouselLoader").fadeOut();
								callback();
							}
						});
					}
				});
			} else callback();
		}
		function getContainer(featureNum) {
			return pluginData.featuresContainer.children("div").eq(featureNum - 1);
		}
		function getBySetPos(position) {
			pluginData.featuresContainer.children("div").each(function () {
				if ($(this).data().setPosition == position) return $(this);
			});
		}
		function getPreviousNum(num) {
			if ((num - 1) == 0) return pluginData.totalFeatureCount;
			else return num - 1;
		}
		function getNextNum(num) {
			if ((num + 1) > pluginData.totalFeatureCount) return 1;
			else return num + 1;
		}
		function setupCarousel() {
			pluginData.featuresContainer.css('position','relative').children("div").each(function () {
				$(this).css({
					'left': (options.containerWidth / 2) - (pluginData.smallFeatureWidth / 2),
					'width': pluginData.smallFeatureWidth,
					'top': options.topPadding,
					'position': 'absolute',
					'padding': options.featurePadding / 2,
					'opacity': 0
				});
			}).find(".featureImage").css({'width': pluginData.smallFeatureWidth - (options.featurePadding)});
			if (pluginData.totalFeatureCount < 4) pluginData.itemsToAnimate = pluginData.totalFeatureCount;
			else pluginData.itemsToAnimate = 4;
			if (options.hideFeatureInfo == true) pluginData.featuresContainer.find(".storyinfo").hide();
			else pluginData.featuresContainer.find("img:not(.featureImage):not(.carouselLoader)").hide().end().find(".description").css("fontSize", options.smallDescriptionSize).end().find(".header").css("fontSize", options.smallHeaderSize);
		}
		function setupFeaturePositions() {
			var oneBeforeStarting = getPreviousNum(options.startingFeature);
			pluginData.currentCenterNum = oneBeforeStarting;
			var $centerFeature = pluginData.featuresContainer.children("div").eq(oneBeforeStarting-1);
			$centerFeature.data('position',1);
			var $prevFeatures = $centerFeature.prevAll();
			$prevFeatures.each(function (i) {
				$(this).data('position',(pluginData.totalFeatureCount - i));
			});
			var $nextFeatures = $centerFeature.nextAll();
			$nextFeatures.each(function (i) {
				$(this).data('position',(i + 2));
			});
			pluginData.featuresContainer.children("div").each(function (i) {
				$(this).data('setPosition',i+1);
			});
		}
		function setupBlips(){
			var $list = $("<ul></ul>");
			$list.addClass("blipsContainer");
			for (var i = 0; i < pluginData.totalFeatureCount; i++) {
				var $blip = $("<div></div>");
				$blip.addClass("blip");
				$blip.css("cursor","pointer");
				$blip.attr("id","blip_"+(i+1));
				var $listEntry = $("<li></li>");
				$listEntry.append($blip);
				$listEntry.css("float","left");
				$listEntry.css("list-style-type","none");
				$list.append($listEntry);
			}
			$(pluginData.containerIDTag).append($list);
			$list.hide().show();
		}
		function changeBlip(oldCenter, newCenter){
			var $blipsContainer = pluginData.featuresContainer.find(".blipsContainer");
			var $oldCenter = $blipsContainer.find("#blip_"+oldCenter);
			var $newCenter = $blipsContainer.find("#blip_"+newCenter);
			$oldCenter.removeClass("blipSelected");
			$newCenter.addClass("blipSelected");
		}
		function autoPlay() {
			if (pluginData.timeoutVar != null) {
				pluginData.timeoutVar = clearTimeout(pluginData.timeoutVar);
			}
			if (options.autoPlay != 0) {
				var autoTime = (Math.abs(options.autoPlay) < options.carouselSpeed) ? options.carouselSpeed : Math.abs(options.autoPlay);
				pluginData.timeoutVar = setTimeout(function () {
					if (options.autoPlay > 0) initiateMove(true,1);
					else if (options.autoPlay < 0) initiateMove(false,1);
				}, autoTime);
			}
		}
		function rotatePositions(direction) {
			pluginData.featuresContainer.children("div").each(function () {
				var newPos;
				if (direction == false) newPos = getNextNum($(this).data().position);
				else newPos = getPreviousNum($(this).data().position);
				$(this).data('position',newPos);
			});
		}
		function animateFeature($feature, direction){
			var new_width, new_top, new_left, new_zindex, new_headerfont, new_descriptionfont, new_padding, new_fade;
			var oldPosition = $feature.data('position');
			var newPosition;
			if (direction == true)
				newPosition = getPreviousNum(oldPosition);
			else
				newPosition = getNextNum(oldPosition);
			if (newPosition == 1) {
				new_headerfont = options.featureHeaderSize;
				new_descriptionfont = options.featureDescriptionSize;
				new_width = pluginData.centerFeatureWidth - (options.featurePadding * 2);
				new_top = 0;
				new_zindex = $feature.css("z-index");
				new_left = (options.containerWidth / 2) - (pluginData.centerFeatureWidth / 2);
				new_padding = options.featurePadding;
				new_fade = 1.0;
			} else {
				new_headerfont = options.smallHeaderSize;
				new_descriptionfont = options.smallDescriptionSize;
				new_width = pluginData.smallFeatureWidth - (options.featurePadding);
				new_top = options.topPadding;
				new_zindex = 1;
				new_padding = options.featurePadding / 2;
				new_fade = 0.4;
				if (newPosition == pluginData.totalFeatureCount) {
					new_left = options.sidePadding;
				} else if (newPosition == 2) {
					new_left = options.containerWidth - pluginData.smallFeatureWidth - options.sidePadding;
				} else {
					new_left = (options.containerWidth / 2) - (pluginData.smallFeatureWidth / 2);
					new_fade = 0;
				}
			}
			if (newPosition != 1 && options.hideFeatureInfo == true) $feature.find(".storyinfo").slideUp("fast");
			$feature.animate({
				width: new_width,
				top: new_top,
				left: new_left,
				padding: new_padding,
				opacity: new_fade
			},
			options.carouselSpeed, 'linear', function () {
				if (newPosition == 1 && options.hideFeatureInfo == true) $feature.find(".storyinfo").show();
				pluginData.animationQueue = pluginData.animationQueue - 1;
				$feature.css("z-index", new_zindex);
				if (options.useBlips == true) {
					if (newPosition == 1) {
						var newCenterItemNum = pluginData.featuresContainer.children("div").index($feature) + 1;
						var oldCenterItemNum;
						if (direction == false) oldCenterItemNum = getNextNum(newCenterItemNum);
						else oldCenterItemNum = getPreviousNum(newCenterItemNum);
						changeBlip(oldCenterItemNum, newCenterItemNum);
					}
				}
				var divide = pluginData.animationQueue / pluginData.itemsToAnimate;
				if (divide % 1 == 0) {
					pluginData.currentlyMoving = false;
					rotatePositions(direction);
					if (pluginData.animationQueue > 0) move(direction);
				}
				autoPlay();
			}).find(".featureImage").animate({width: new_width - 20 }, options.carouselSpeed, 'linear').end();
			if (options.hideFeatureInfo == false) {
				$feature.find(".header").animate({fontSize: new_headerfont}, options.carouselSpeed, 'linear').end().find(".description").animate({fontSize: new_descriptionfont}, options.carouselSpeed, 'linear').end();
				if (newPosition == 1) {
					if ($.browser.msie == false) $feature.find("img:not(.featureImage)").fadeIn();
					else $feature.find("img:not(.featureImage)").show();
				} else {
					if ($.browser.msie == false) $feature.find("img:not(.featureImage)").fadeOut();
					else $feature.find("img:not(.featureImage)").hide();
				}
			}
		}
		function move(direction)
		{
			pluginData.currentlyMoving = true;
			var $newCenter, $newLeft, $newRight, $newHidden;
			if (direction == true) {
				// Shift features to the left
				$newCenter = getContainer(getNextNum(pluginData.currentCenterNum));
				$newLeft = getContainer(pluginData.currentCenterNum);
				$newRight = getContainer(getNextNum(getNextNum(pluginData.currentCenterNum)));
				$newHidden = getContainer(getPreviousNum(pluginData.currentCenterNum));
				pluginData.currentCenterNum = getNextNum(pluginData.currentCenterNum);
			} else {
				$newCenter = getContainer(getPreviousNum(pluginData.currentCenterNum));
				$newLeft = getContainer(getPreviousNum(getPreviousNum(pluginData.currentCenterNum)));
				$newRight = getContainer(pluginData.currentCenterNum);
				$newHidden = getContainer(getNextNum(pluginData.currentCenterNum));
				pluginData.currentCenterNum = getPreviousNum(pluginData.currentCenterNum);
			}
			if (direction) {
				$newLeft.css("z-index", 3).find('.info-box').hide();
				$newRight.css("z-index", 3).find('.info-box').hide();
			} else {
				$newRight.css("z-index", 3).find('.info-box').hide();
			}
			$newCenter.css("z-index", 4).find('.info-box').show();
			animateFeature($newLeft, direction);
			animateFeature($newCenter, direction);
			animateFeature($newRight, direction);
			if (pluginData.totalFeatureCount > 3) {
				animateFeature($newHidden, direction);
			}
		}
		function initiateMove(direction, rotations) {
			if (pluginData.currentlyMoving == false) {
				var queue = rotations * pluginData.itemsToAnimate;
				pluginData.animationQueue = queue;
				move(direction);
			}
		}
		function findShortestDistance(from, to) {
			var goingToLeft = 1, goingToRight = 1, tracker;
			tracker = from;
			while ((tracker = getPreviousNum(tracker)) != to) {goingToLeft++;}
			tracker = from;
			while ((tracker = getNextNum(tracker)) != to) {
				goingToRight++;
			}
			return (goingToLeft < goingToRight) ? goingToLeft*-1 : goingToRight;
		}
		$(".leftButton").click(function () {
			initiateMove(false,1);
		});
		$(".rightButton").click(function () {
			initiateMove(true,1);
		});
		pluginData.featuresContainer.children("div")
			.click(function () {
				var position = $(this).data('position');
				if (position == 2) {
					initiateMove(true,1);
				} else if (position == pluginData.totalFeatureCount) {
					initiateMove(false,1);
				}
			})
			.mouseover(function () {
				if (pluginData.currentlyMoving == false) {
					var position = $(this).data('position');
					if (position == 2 || position == pluginData.totalFeatureCount) {
						$(this).css("opacity",0.8);
					}
				}
			})
			.mouseout(function () {
				if (pluginData.currentlyMoving == false) {
					var position = $(this).data('position');
					if (position == 2 || position == pluginData.totalFeatureCount) {
						$(this).css("opacity",0.4);
					}
				}
			});
		$("a", pluginData.containerIDTag).live("click", function (event) {
			var $parents = $(this).parentsUntil(pluginData.containerIDTag);
			$parents.each(function () {
				var position = $(this).data('position');
				if (position != undefined) {
					if (position != 1) {
						if (position == pluginData.totalFeatureCount) {
							initiateMove(false,1);
						} else if (position == 2) {
							initiateMove(true,1);
						}
						event.preventDefault();
						return false;
					} else {}
				}
			})
		});
		$(".blip").live("click",function () {
			var goTo = $(this).attr("id").substring(5);
			var whereIsIt = pluginData.featuresContainer.children("div").eq(goTo-1);
			whereIsIt = whereIsIt.data('position');
			var currentlyAt = pluginData.currentCenterNum;
			if (goTo != currentlyAt) {
				var shortest = findShortestDistance(1, whereIsIt);
				if (shortest < 0) {
					initiateMove(false,(shortest*-1));
				} else {
					initiateMove(true,shortest);
				}
			}

		})
	});
}
$.fn.carousel.defaults = {
	containerWidth:         800,
	centerFeatureFactor:    .56,
	smallFeatureFactor:     .5,
	topPadding:             60,
	sidePadding:            0,
	startingFeature:        1,
	carouselSpeed:          500,
	featurePadding:         0,
	smallHeaderSize:        9,
	smallDescriptionSize:   6,
	featureHeaderSize:      14,
	featureDescriptionSize: 12,
	autoPlay:               0,
	hideFeatureInfo:        false,
	useBlips:               true,
	preload:                false
};
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 u=k(){9 g=/^([^#.>`]*)(#|\\.|\\>|\\`)(.+)$/;k u(a,b){9 c=a.J(/\\s*\\,\\s*/);9 d=[];n(9 i=0;i<c.l;i++){d=d.v(o(c[i],b))};6 d};k o(a,b,c){a=a.z(" ","`");9 d=a.r(g);9 e,5,m,7,i,h;9 f=[];4(d==8){d=[a,a]};4(d[1]==""){d[1]="*"};4(c==8){c="`"};4(b==8){b=E};K(d[2]){w"#":7=d[3].r(g);4(7==8){7=[8,d[3]]};e=E.L(7[1]);4(e==8||(d[1]!="*"&&!x(e,d[1]))){6 f};4(7.l==2){f.A(e);6 f};6 o(7[3],e,7[2]);w".":4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};7=d[3].r(g);4(7!=8){4(e.j==8||e.j.r("(\\\\s|^)"+7[1]+"(\\\\s|$)")==8){q};m=o(7[3],e,7[2]);f=f.v(m)}y 4(e.j!=8&&e.j.r("(\\\\s|^)"+d[3]+"(\\\\s|$)")!=8){f.A(e)}};6 f;w">":4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};4(!x(e,d[1])){q};m=o(d[3],e,">");f=f.v(m)};6 f;w"`":5=p(b,d[1]);n(i=0,h=5.l;i<h;i++){e=5[i];m=o(d[3],e,"`");f=f.v(m)};6 f;M:4(c!=">"){5=p(b,d[1])}y{5=b.B};n(i=0,h=5.l;i<h;i++){e=5[i];4(e.C!=1){q};4(!x(e,d[1])){q};f.A(e)};6 f}};k p(a,b){4(b=="*"&&a.F!=8){6 a.F};6 a.p(b)};k x(a,b){4(b=="*"){6 N};6 a.O.G().z("P:","")==b.G()};6 u}();k Q(a,b){9 c=u(a);n(9 i=0;i<c.l;i++){c[i].R=k(){4(t.j.H(b)==-1){t.j+=" "+b}};c[i].S=k(){4(t.j.H(b)!=-1){t.j=t.j.z(b,"")}}}}4(D.I&&!D.T){D.I("U",V)}',58,58,'||||if|listNodes|return|subselector|null|var||||||||limit||className|function|length|listSubNodes|for|doParse|getElementsByTagName|continue|match||this|parseSelector|concat|case|matchNodeNames|else|replace|push|childNodes|nodeType|window|document|all|toLowerCase|indexOf|attachEvent|split|switch|getElementById|default|true|nodeName|html|hoverForIE6|onmouseover|onmouseout|opera|onload|ieHover'.split('|'),0,{}))
function ieHover() {hoverForIE6("#nav li, input.submit", "hover");}
