jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};;
/*
 * jQuery imagesLoaded plugin v1.0.4
 * http://github.com/desandro/imagesloaded
 *
 * MIT License. by Paul Irish et al.
 */
(function($,undefined){$.fn.imagesLoaded=function(callback){var $this=this,$images=$this.find('img').add($this.filter('img')),len=$images.length,blank='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';function triggerCallback(){callback.call($this,$images);}
function imgLoaded(event){if(--len<=0&&event.target.src!==blank){setTimeout(triggerCallback);$images.unbind('load error',imgLoaded);}}
if(!len){triggerCallback();}
$images.bind('load error',imgLoaded).each(function(){if(this.complete||typeof this.complete==="undefined"){var src=this.src;this.src=blank;this.src=src;}});return $this;};})(jQuery);;jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.event.special
jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)
return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseFloat(result[1]);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)
times=fn;fn=label;label=interval;}
interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)
return;if(times&&times.constructor!=Number){belay=!!times;times=0;}
times=times||0;belay=belay||false;var timers=jQuery.data(element,this.dataKey)||jQuery.data(element,this.dataKey,{});if(!timers[label])
timers[label]={};fn.timerID=fn.timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)
return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)
jQuery.timer.remove(element,label,fn);this.inProgress=false;};handler.timerID=fn.timerID;if(!timers[label][fn.timerID])
timers[label][fn.timerID]=window.setInterval(handler,interval);this.global.push(element);},remove:function(element,label,fn){var timers=jQuery.data(element,this.dataKey),ret;if(timers){if(!label){for(label in timers)
this.remove(element,label,fn);}else if(timers[label]){if(fn){if(fn.timerID){window.clearInterval(timers[label][fn.timerID]);delete timers[label][fn.timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}
for(ret in timers[label])break;if(!ret){ret=null;delete timers[label];}}
for(ret in timers)break;if(!ret)
jQuery.removeData(element,this.dataKey);}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(index,item){jQuery.timer.remove(item);});});;(function($){var
undefined,dataFlag="watermark",dataClass="watermarkClass",dataFocus="watermarkFocus",dataFormSubmit="watermarkSubmit",dataMaxLen="watermarkMaxLength",dataPassword="watermarkPassword",dataText="watermarkText",selWatermarkDefined=":data("+dataFlag+")",selWatermarkAble=":text,:password,:search,textarea",triggerFns=["Page_ClientValidate"],pageDirty=false;$.extend($.expr[":"],{"search":function(elem){return"search"===(elem.type||"");},"data":function(element,index,matches,set){var data,parts=/^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(matches[3]);if(parts){data=$(element).data(parts[1]);if(data!==undefined){if(parts[2]){data=""+data;switch(parts[2]){case"=":return(data==parts[3]);case"!=":return(data!=parts[3]);case"^=":return(data.slice(0,parts[3].length)==parts[3]);case"$=":return(data.slice(-parts[3].length)==parts[3]);case"*=":return(data.indexOf(parts[3])!==-1);}}
return true;}}
return false;}});$.watermark={version:"3.0.6",options:{className:"watermark",useNative:true},hide:function(selector){$(selector).filter(selWatermarkDefined).each(function(){$.watermark._hide($(this));});},_hide:function($input,focus){var inputVal=$input.val()||"",inputWm=$input.data(dataText)||"",maxLen=$input.data(dataMaxLen)||0,className=$input.data(dataClass);if((inputWm.length)&&(inputVal==inputWm)){$input.val("");if($input.data(dataPassword)){if(($input.attr("type")||"")==="text"){var $pwd=$input.data(dataPassword)||[],$wrap=$input.parent()||[];if(($pwd.length)&&($wrap.length)){$wrap[0].removeChild($input[0]);$wrap[0].appendChild($pwd[0]);$input=$pwd;}}}
if(maxLen){$input.attr("maxLength",maxLen);$input.removeData(dataMaxLen);}
if(focus){$input.attr("autocomplete","off");window.setTimeout(function(){$input.select();},1);}}
className&&$input.removeClass(className);},show:function(selector){$(selector).filter(selWatermarkDefined).each(function(){$.watermark._show($(this));});},_show:function($input){var val=$input.val()||"",text=$input.data(dataText)||"",type=$input.attr("type")||"",className=$input.data(dataClass);if(((val.length==0)||(val==text))&&(!$input.data(dataFocus))){pageDirty=true;if($input.data(dataPassword)){if(type==="password"){var $pwd=$input.data(dataPassword)||[],$wrap=$input.parent()||[];if(($pwd.length)&&($wrap.length)){$wrap[0].removeChild($input[0]);$wrap[0].appendChild($pwd[0]);$input=$pwd;$input.attr("maxLength",text.length);}}}
if((type==="text")||(type==="search")){var maxLen=$input.attr("maxLength")||0;if((maxLen>0)&&(text.length>maxLen)){$input.data(dataMaxLen,maxLen);$input.attr("maxLength",text.length);}}
className&&$input.addClass(className);$input.val(text);}
else{$.watermark._hide($input);}},hideAll:function(){if(pageDirty){$.watermark.hide(selWatermarkAble);pageDirty=false;}},showAll:function(){$.watermark.show(selWatermarkAble);}};$.fn.watermark=function(text,options){if(!this.length){return this;}
var hasClass=false,hasText=(typeof(text)==="string");if(typeof(options)==="object"){hasClass=(typeof(options.className)==="string");options=$.extend({},$.watermark.options,options);}
else if(typeof(options)==="string"){hasClass=true;options=$.extend({},$.watermark.options,{className:options});}
else{options=$.watermark.options;}
if(typeof(options.useNative)!=="function"){options.useNative=options.useNative?function(){return true;}:function(){return false;};}
return this.each(function(){var $input=$(this);if(!$input.is(selWatermarkAble)){return;}
if($input.data(dataFlag)){if(hasText||hasClass){$.watermark._hide($input);if(hasText){$input.data(dataText,text);}
if(hasClass){$input.data(dataClass,options.className);}}}
else{if(options.useNative.call(this,$input)){if(((""+$input.css("-webkit-appearance")).replace("undefined","")!=="")&&(($input.attr("tagName")||"")!=="TEXTAREA")){if(hasText){$input.attr("placeholder",text);}
return;}}
$input.data(dataText,hasText?text:"");$input.data(dataClass,options.className);$input.data(dataFlag,1);if(($input.attr("type")||"")==="password"){var $wrap=$input.wrap("<span>").parent(),$wm=$($wrap.html().replace(/type=["']?password["']?/i,'type="text"'));$wm.data(dataText,$input.data(dataText));$wm.data(dataClass,$input.data(dataClass));$wm.data(dataFlag,1);$wm.attr("maxLength",text.length);$wm.focus(function(){$.watermark._hide($wm,true);}).bind("dragenter",function(){$.watermark._hide($wm);}).bind("dragend",function(){window.setTimeout(function(){$wm.blur();},1);});$input.blur(function(){$.watermark._show($input);}).bind("dragleave",function(){$.watermark._show($input);});$wm.data(dataPassword,$input);$input.data(dataPassword,$wm);}
else{$input.focus(function(){$input.data(dataFocus,1);$.watermark._hide($input,true);}).blur(function(){$input.data(dataFocus,0);$.watermark._show($input);}).bind("dragenter",function(){$.watermark._hide($input);}).bind("dragleave",function(){$.watermark._show($input);}).bind("dragend",function(){window.setTimeout(function(){$.watermark._show($input);},1);}).bind("drop",function(evt){var dropText=evt.originalEvent.dataTransfer.getData("Text");if($input.val().replace(dropText,"")===$input.data(dataText)){$input.val(dropText);}
$input.focus();});}
if(this.form){var form=this.form,$form=$(form);if(!$form.data(dataFormSubmit)){$form.submit($.watermark.hideAll);if(form.submit){$form.data(dataFormSubmit,form.submit);form.submit=(function(f,$f){return function(){var nativeSubmit=$f.data(dataFormSubmit);$.watermark.hideAll();if(nativeSubmit.apply){nativeSubmit.apply(f,Array.prototype.slice.call(arguments));}
else{nativeSubmit();}};})(form,$form);}
else{$form.data(dataFormSubmit,1);form.submit=(function(f){return function(){$.watermark.hideAll();delete f.submit;f.submit();};})(form);}}}}
$.watermark._show($input);});};if(triggerFns.length){$(function(){var i,name,fn;for(i=triggerFns.length-1;i>=0;i--){name=triggerFns[i];fn=window[name];if(typeof(fn)==="function"){window[name]=(function(origFn){return function(){$.watermark.hideAll();return origFn.apply(null,Array.prototype.slice.call(arguments));};})(fn);}}});}})(jQuery);;
/*
 * jQuery UI 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});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)},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!==j)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"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{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,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);;
/*
 * jQuery UI Widget 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=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 l.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(true,{},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.charAt(0)==="_")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!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():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){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_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;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_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);;;(function($){$.widget("ui.cgallery",{options:{showCarousel:true,showThumbImages:true,slideshow:null,btnPrev:null,btnNext:null,showCaptions:false,overlayOpacity:0.7,overlayPosition:'bottom',cropPanels:true,fadePanels:true,fadePanelsSpeed:150,allowCurvyCorners:true,changeOn:'hover',onImageTransition:null,start:0,showLoading:true},_create:function(){this._isOpen=false;this._itemCount=0;this._initCheck=false;this._speed=this.options.fadePanels?this.options.fadePanelsSpeed:0;this._curr=null;this._autoPlayId=null;this._galleryHeight=null;this._galleryWidth=null;this._bkgHref=new Array();this._bkgCss=new Array();this._$gallery=this.element;this._$carousel=null;this._$thumbs=null;this._$panelWrapper=null;this._$panelImages=null;this._$currentThumb=$();this._$currentPanel=$();this.element.css('visibility','hidden');this.buildGallery();if(this.options.showCarousel){this.buildCarousel();this.showTarget($(this._$thumbs[this._curr]));}else{this.changePanel(this._curr);}
this.element.css('visibility','visible').show();this._initCheck=true;$.ui.cgallery.instances.push(this.element);},_init:function(){if(this.options.autoOpen){this.open();}},clickImage:function(){var self=this;if(self._curr!=undefined)
if(self._bkgHref[self._curr]!=undefined)
window.location=self._bkgHref[self._curr];},isImageLoaded:function($el){var dataSrc=$el.attr("data-src");if(dataSrc!=undefined){var src=$el.attr("src");$el.attr("src",dataSrc);$el.removeAttr("data-src");}
else
if($el.get(0).complete)
return true;return false;},transitionImage:function(i){var self=this;this._$currentPanel=$(this._$panelImages.get(i));this._curr=i;if(this.isImageLoaded(this._$currentPanel)){if(this.options.onImageTransition)
{this.options.onImageTransition(i,this._$currentPanel);}
if(this.options.allowCurvyCorners){if(this._bkgCss[i]==undefined)
i=this._itemCount;if(this._bkgHref[i]!=undefined)
{this._$panelWrapper.click(function(){self.clickImage()}).css("cursor","pointer");}else{this._$panelWrapper.unbind("click",self.clickImage).css("cursor","auto");}
this._$panelWrapper.css(this._bkgCss[i]).stop(true,true).fadeTo(this._speed,1);}else{var $displayPanel=(!this._$currentPanel.get(0).complete)?this._$panelWrapper:this._$currentPanel;$displayPanel.fadeIn(this._speed);}}},changePanel:function(panelIndex){if(this.options.allowCurvyCorners){if(this.isImageLoaded(this._$currentPanel)){this._$currentPanel.stop(true,true).fadeIn(0).fadeOut(this._speed);}
this.transitionImage(panelIndex);}else{var cur=this._$currentPanel.get(0);var base=this;this._$panelImages.fadeOut(this._speed,function(){if(this==cur)
{base.transitionImage(panelIndex);}else{}});}},showTarget:function($target){var panelIndex=parseInt($target.get(0).value);if($target.length&&$target.get(0)!=this._$currentThumb.get(0)){this._$currentThumb.removeClass('current');$target.addClass('current');this._$currentThumb=$target;this.changePanel(panelIndex);}},buildCarouselEvents:function(){var base=this;this._$allItems=$('li',this._$carousel);if(this.options.changeOn=='hover'){$(this._$allItems).hoverIntent(function(){if(base.options.slideshow)
base.autoPlay();base.showTarget($(this));},function(){});}else{this._$allItems.click(function(){if(base.options.slideshow)
base.autoPlay();base.showTarget($(this));});}},buildCarousel:function(){this._$carousel=$("div.carousel",this._$gallery);if(!this._$carousel.length)
this._$carousel=$("<div class='carousel'>").prependTo(this._$gallery);var $ul=$("ul",this._$carousel);if(!$ul.length)
$ul=$("<ul class='thumbs'>").prependTo(this._$carousel);this._$thumbs=$('li',$ul);if(this._$thumbs.length==0)
if(this.options.showThumbImages)
this._$panelImages.clone().wrap('<li>').parent().appendTo($ul);else{var a=Array(this._$panelImages.length);for(var i=0;i<this._$panelImages.length;i++)
a.push("<li></li>");$ul.append(a.join(""));}else{if(!this.options.showThumbImages)
this._$thumbs.empty();}
this._$thumbs=$('li',$ul);var alt=0;this._$thumbs.each(function(){$(this).attr('value',alt++)});this._$carousel=$('.carousel',$gallery);this._$carousel.bbCarousel(this.options);this.buildCarouselEvents();},buildPanels:function(){var self=this;self._$panelWrapper.css({'width':self._galleryWidth+'px','height':self._galleryHeight+'px','position':'absolute','overflow':'hidden','top':0,'left':0});this._$panelImages.each(function(i){var $this=$(this);this.index=i;this.initPanel=function(){$this=$(this);function getOriginalDim(img_element,isWidth){var t=new Image();t.src=(img_element.getAttribute?img_element.getAttribute("src"):false)||img_element.src;return isWidth?t.width:t.height;}
var imgH=getOriginalDim(this,false);var imgW=getOriginalDim(this,true);var scale;if(self.options.cropPanels){scale=Math.max(self._galleryHeight/imgH,self._galleryWidth/imgW);}else{scale=Math.min(self._galleryHeight/imgH,self._galleryWidth/imgW);}
imgH*=scale;imgW*=scale;var imgTop=(self._galleryHeight-imgH)/2+'px';var imgLeft=(self._galleryWidth-imgW)/2+'px';$this.css({'height':imgH,'width':imgW,'position':'absolute','display':self.options.allowCurvyCorners?'none':($this.get(0)!=self._$currentPanel.get(0))?'none':'','top':imgTop,'left':imgLeft});if(self.options.allowCurvyCorners){var size=imgW+"px "+imgH+"px";self._bkgCss[i]={'backgroundImage':'url('+$this.attr("src")+')','backgroundRepeat':'no-repeat','backgroundPosition':imgLeft+" "+imgTop};var bkSizeProp=jQuery.browser.mozilla?'-moz-background-size':jQuery.browser.webkit?'-webkit-background-size':'background-size';self._bkgCss[i][bkSizeProp]=size;var $parent=$this.parent();if($this.parent().length)
{if($parent.get(0).tagName=='A')
self._bkgHref[i]=$parent.attr("href");}
if(self.options.showLoading)
{self.element.find('li[value='+this.index+'] > span.load').remove();}}
if($this.get(0)==self._$currentPanel.get(0))
self.changePanel(i);};$(this).bind("load",function(){this.initPanel();}).each(function(){if(this.complete||(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6)){$(this).trigger("load");}});});$(window).load(function(){self.element.find('li[value=0] > span.load').remove();self._$panelImages.each(function(i){self.isImageLoaded($(this));if(jQuery.browser.msie&&self.options.showLoading)
{self.element.find('li > span.load').remove();}});});},autoPlay:function(){var self=this;if(self._autoPlayId)
self.clearInterval(self._autoPlayId);self._autoPlayId=setInterval(function(){self.move(false);},this.options.slideshow+self._speed);},move:function(prev){var i=prev?(--this._curr<0?this._itemCount-1:this._curr):(++this._curr>=this._itemCount?0:this._curr);if(this.options.showCarousel)
this.showTarget($(this._$thumbs[i]));else
this.changePanel(i);},buildSlideshow:function(){this.autoPlay();$(this.options.btnPrev).click(function(){this.move(true);this.autoPlay();})
$(this.options.btnNext).click(function(){this.move(false)
this.autoPlay();})
this.options.btnPrev=this.options.btnNext=null;},buildGallery:function(){this._$panelWrapper=$("div.panels",this._$gallery);if(!this._$panelWrapper.length)
this._$panelWrapper=$("<div class='panels'>").prependTo(this._$gallery);this._$panelImages=$('div.panels img',this._$gallery);if(this._$panelImages.length==0){this._$panelImages=$('img',this._$gallery);this._$panelWrapper.append(this._$panelImages.clone());}
this._$panelImages=$('div.panels img',this._$gallery).stop(true,true).fadeOut(0);$('>img',this._$gallery).remove();this._itemCount=this._$panelImages.length;this._curr=(this.options.start>=this._itemCount)?this._itemCount-1:(this.options.start<0)?0:this.options.start;this._$currentPanel=$(this._$panelImages.get(this._curr));this._galleryHeight=this._$gallery.innerHeight();this._galleryWidth=this._$gallery.innerWidth();if(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6)
document.execCommand('BackgroundImageCache',false,true);if(this.options.allowCurvyCorners){this._bkgCss[this._itemCount]={'backgroundImage':this._$panelWrapper.css('backgroundImage'),'backgroundRepeat':'no-repeat','backgroundPosition':'center center'}
var bkSizeProp=jQuery.browser.mozilla?'-moz-background-size':jQuery.browser.webkit?'-webkit-background-size':'background-size';this._bkgCss[this._itemCount][bkSizeProp]="";}else{var base=this;$(window).load(function(){base._$panelWrapper.css('backgroundImage','none');});}
if(this.options.slideshow)
this.buildSlideshow();else if(this._itemCount<=this.options.visible){$(this.options.btnPrev).css("visibility","hidden");$(this.options.btnNext).css("visibility","hidden");}
this.buildPanels();},open:function(){this._isOpen=true;if(this._trigger("beforeopen")===false){return;}
$.each(this._getOtherInstances(),function(){var $this=$(this);if($this.cgallery("isOpen")){$this.cgallery("close");}});this._trigger("open");return this;},close:function(){this._isOpen=false;this._trigger("close");return this;},isOpen:function(){return this._isOpen;},destroy:function(){var element=this.element,position=$.inArray(element,$.ui.cgallery.instances);if(position>-1){$.ui.cgallery.instances.splice(position,1);}
$.Widget.prototype.destroy.call(this);},_getOtherInstances:function(){var element=this.element;return $.grep($.ui.cgallery.instances,function(el){return el!==element;});},_setOption:function(key,value){this.options[key]=value;}});$.extend($.ui.cgallery,{instances:[]});})(jQuery);;
/*
 * jQuery UI Widget 1.8.11
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function($,undefined){if($.cleanData){var _cleanData=$.cleanData;$.cleanData=function(elems){for(var i=0,elem;(elem=elems[i])!=null;i++){$(elem).triggerHandler("remove");}
_cleanData(elems);};}else{var _remove=$.fn.remove;$.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).length){$("*",this).add([this]).each(function(){$(this).triggerHandler("remove");});}}
return _remove.call($(this),selector,keepData);});};}
$.widget=function(name,base,prototype){var namespace=name.split(".")[0],fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
$.expr[":"][fullName]=function(elem){return!!$.data(elem,name);};$[namespace]=$[namespace]||{};$[namespace][name]=function(options,element){if(arguments.length){this._createWidget(options,element);}};var basePrototype=new base();basePrototype.options=$.extend(true,{},basePrototype.options);$[namespace][name].prototype=$.extend(true,basePrototype,{namespace:namespace,widgetName:name,widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);$.widget.bridge(name,$[namespace][name]);};$.widget.bridge=function(name,object){$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_"){return returnValue;}
if(isMethodCall){this.each(function(){var instance=$.data(this,name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,name);if(instance){instance.option(options||{})._init();}else{$.data(this,name,new object(options,this));}});}
return returnValue;};};$.Widget=function(options,element){if(arguments.length){this._createWidget(options,element);}};$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){$.data(element,this.widgetName,this);this.element=$(element);this.options=$.extend(true,{},this.options,this._getCreateOptions(),options);var self=this;this.element.bind("remove."+this.widgetName,function(){self.destroy();});this._create();this._trigger("create");this._init();},_getCreateOptions:function(){return $.metadata&&$.metadata.get(this.element[0])[this.widgetName];},_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(key,value){var options=key;if(arguments.length===0){return $.extend({},this.options);}
if(typeof key==="string"){if(value===undefined){return this.options[key];}
options={};options[key]=value;}
this._setOptions(options);return this;},_setOptions:function(options){var self=this;$.each(options,function(key,value){self._setOption(key,value);});return this;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget()
[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",value);}
return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_trigger:function(type,event,data){var callback=this.options[type];event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};})(jQuery);;(function($){$.widget("ui.select2ul",{options:{startIndex:0,onClick:null,onMouseEnter:null,onMouseLeave:null,ulClass:"",liClass:"",updateOnMouseEnter:false},_afterLoad:function(){var o=this.options;this.options._childrenLoaded=true;$("select",this.element).each(function(){var $sel=$(this)
$ul=$("<ul"+(o.ulClass!=""?" class='"+o.ulClass+"'":"")+"/>").insertBefore($sel);o._selectID=$sel.attr("id");$sel.css({"visibility":"hidden","position":"absolute","width":0});$("option",$sel).each(function(index){if(index>=o.startIndex){$this=$(this);$("<li"+(o.liClass!=""?" class='"+o.liClass+"'":"")+"/>").data("value",$this.attr("value")).append($this.contents().clone()).appendTo($ul);}});var events=(o.onClick||!o.updateOnMouseEnter?"click":"");events+=(o.onMouseEnter||o.onMouseLeave||o.updateOnMouseEnter?" hover":"")
$ul.delegate("li",events,function(e){var $li=$(e.currentTarget),updateSel=false;switch(e.type){case"click":updateSel=(o.onClick?o.onClick(e):true)&&!o.updateOnMouseEnter;break;case"mouseenter":updateSel=(o.onMouseEnter?o.onMouseEnter(e):true)&&o.updateOnMouseEnter;break;case"mouseleave":if(o.onMouseLeave)
o.onMouseLeave(e);break;}
if(updateSel)
{$sel.attr("selectedIndex",$li.index()+o.startIndex);$sel.val($sel.find('option:eq('+($li.index()+o.startIndex)+')').attr('value'));}
if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))||(navigator.userAgent.match(/iPad/i))||(navigator.userAgent.match(/Android/i)))
if(('#product-options-wrapper').length)
$('#btn-cart').click();});});},_create:function(){this.options._childrenLoaded=false;if(!this.options._childrenLoaded&&!this.element.complete)
this.element.load(this._afterLoad());else
this._afterLoad();},_init:function(){},getSelectId:function(){return this.element.options._selectID;},destroy:function(){$.Widget.prototype.destroy.apply(this);$ul.unbind("mouseenter mouseleave click");}});})(jQuery);;(function($){$.widget("betabrand.buybar",function(){var self;return{options:{$ulSel:"",$buyButtonSel:"",buyButtonText:"Add to Cart",headClassesClosed:"closed",headContentClosed:"",headClassesOpen:"open",headContentOpen:"",footContent:"",footBoxFormID:"",footBoxFormClass:"",triggerOpenPadding:"0 0 160px 100px",triggerClosePadding:"16px 16px 40px 130px",hasFootbox:true,footBoxTitle:"",footBoxSubtitle:"Sign up for a resupply alert",footBoxHiddenInputName:"product-name",footBoxHiddenInputValue:"",footBoxEmailTextClass:"",footBoxButtonClass:"curvy button",footBoxButtonHTML:"Go!",responseSuccess:"Thanks! We'll be in touch.",responseError:"Please enter a valid email address.",postInit:null,_$trigger:null,_$btn:null,_$btnInfo:null,_$head:null,_$ul:null,_$foot:null,_$footBox:null,_$email:null,_barWidth:0,_btnWidth:0,_opening:false,_init:true},_createFootBox:function(){var o=self.options;o._$footBox=$("<div class='footbox'></div>").appendTo(o._$foot);var $form=$("<form id='"+o.footBoxFormID+"' class='"+o.footBoxFormClass+"'></form>").appendTo(o._$footBox);$("<div class='title'>"+o.footBoxTitle+"</div>").appendTo($form);$("<div class='subtitle'>"+o.footBoxSubtitle+"</div>").appendTo($form);var $controls=$("<div class='controls'></div>").appendTo($form);o._$email=$("<input type='text' value='' name='email' autocomplete='off' class='emailbox "+o.footBoxEmailTextClass+"'>").appendTo($controls);$("<input type='hidden' name='"+o.footBoxHiddenInputName+"' value='"+o.footBoxHiddenInputValue+"'>").appendTo($controls);$("<button value='' name='go' type='submit' class='"+o.footBoxButtonClass+"'>"+o.footBoxButtonHTML+"</button>").appendTo($controls);$("<div class='spinner'></div>").appendTo($controls);$("<div class='response'> </div>").appendTo($form);},_showEl:function($el,show){$el.css({"visibility":show?"visible":"hidden"});},_overlayBtn:function($el){var o=self.options,pos=$el.offset();o._$btnInfo.html($el.html());o._$btn.offset({top:Math.round(pos.top),left:$ul.offset().left+o._barWidth-o._btnWidth});},_openHead:function(){var o=self.options;if(o._$head){o._$head.removeClass(o.headClassesClosed).addClass(o.headClassesOpen);o._$head.html(o.headContentOpen);}},_closeHead:function(){var o=self.options;if(o._$head){o._$head.removeClass(o.headClassesOpen).addClass(o.headClassesClosed);o._$head.html(o.headContentClosed);}},_openBar:function(){var o=self.options;o._opening=true;o._$ul.stop(true,true);self._openHead();o._$trigger.css("overflow","visible");o._$ul.slideDown(500,function(){o._opening=false;});},_closeBar:function(){var o=self.options;if(!o._opening){self._showEl(o._$btn,false);o._$ul.stop(true,true).slideUp(o._init?0:300,function(){o._$trigger.css("overflow","hidden");self._closeHead();if(o._init){o._$wrap.css("padding",o.triggerClosePadding);o._$trigger.css({"padding":o.triggerOpenPadding,"visibility":"visible"}).width(o._$trigger.width()).height(o._$trigger.height());o._init=false;}});}},_create:function(){self=this;var o=self.options,$btnInfoBox=$(".price-box",o._$btn);o._$btn=$(o.$buyButtonSel);if($(".price",$btnInfoBox).length>1)
{$btnInfoBox.html('<div class="price"></div>');}
o._$btnInfo=$(".price",$btnInfoBox);this.element.select2ul({startIndex:1,onMouseEnter:function(e){if($(e.currentTarget).hasClass("foot")){self._showEl(o._$btn,false);if(o.hasFootbox){o._$footBox.stop(true,true).fadeIn(100,function(){});}
return false;}
else{self._overlayBtn($(e.currentTarget));self._showEl(o._$btn,true);return true;}},updateOnMouseEnter:true,preventSelection:false});o._$ul=$(o.$ulSel);if(!o._$ul.length)
return false;o._$ul.wrap("<div class='trigger-box buybar'><div class='wrap'></div></div>");o._$wrap=o._$ul.parent();o._$trigger=o._$wrap.parent();o._$trigger.hover(self._openBar,self._closeBar);var h=o.headContentClosed;if(h!=""){o._$head=$("<div class='head'></div>").prependTo(o._$wrap);if($.type(h)==="object")
o._$head.append(h);else
o._$head.html(h);o._$head.hover(function(){self._showEl(o._$btn,false);},$.noop);}
o._$head.click(self._openBar);var f=o.footContent;if(f!=""){o._$foot=$("<li class='foot'></li>").appendTo(o._$ul);if($.type(f)==="object")
o._$foot.append(f);else
o._$foot.html(f);self._createFootBox();o._$foot.hover($.noop,function(){o._$footBox.stop(true,true).fadeOut(500);});}
var $btnText=$("#cart-button-text");if(o.buyButtonText!="")$btnText.text(o.buyButtonText);$btnText.wrap("<div class='btn-text'></div>");self._openHead();o._barWidth=o._$head.outerWidth();o._$ul.width(o._barWidth);self._closeHead();$btnInfoBox.width(o._barWidth);if(!$.browser.msie){o._$trigger.width("900px").append(o._$btn.css({"position":"absolute","right":"auto"}));}else{if($.browser.version<=8)
o._$trigger.width("900px").append(o._$btn.css({"position":"absolute","right":"15px",'width':'330px'}));else
o._$trigger.width("900px").append(o._$btn.css({"position":"absolute","right":"15px",'width':'300px'}));}
o._btnWidth=o._$btn.width();self._overlayBtn($(":first",o._$ul));if(!($.browser.msie&&$.browser.version<=7))
o._$trigger.width("auto").width(o._$trigger.width());var top=(o._$foot.outerHeight()-o._$footBox.outerHeight())/2
o._$footBox.css({"top":top,"right":o._barWidth-2,"padding-right":12});self._closeBar();},_init:function(){var o=self.options;if(o.postInit)o.postInit(self);},destroy:function(){$.Widget.prototype.destroy.apply(this);o._$trigger.unbind("mouseenter mouseleave");o._$head.unbind("click mouseenter mouseleave");o._$foot.unbind("mouseenter mouseleave");}}}());})(jQuery);;(function($){$.widget("ui.bbCarousel",{options:{btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,sizeAfterLoad:false,hoverTop:null,hoverFunction:function(){},speed:600,easing:'swing',vertical:false,circular:true,maxLength:0,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null,showLoading:true,fnordForce:false,fnordThreshold:7,fnordField:null,fnordClip:null},_create:function(){var self=this;if(self.options.fnordForce&&self.options.fnordField!=null){self.options.circular=false;self.options.mouseWheel=false;self.options.btnPrev=null;self.options.btnNext=null;self.options.btnGo=null;var $mouseRegion=$(self.options.fnordField);var $clipRegion=$(self.element);var $containerRegion=$clipRegion.find('ul');var $listRegions=$containerRegion.find('li');if(self.options.fnordClip!=null)
{$clipRegion=$(self.options.fnordClip);}
if(self.options.vertical)
{if($listRegions.length>self.options.fnordThreshold)
{$containerRegion.css('width','auto');var totalHeight=$listRegions.outerHeight()*($listRegions.length+2);$containerRegion.css('height',totalHeight+'px');if($containerRegion.outerHeight()>$clipRegion.height())
{$mouseRegion.mousemove(function(e){var objOffset=$mouseRegion.offset();var objHeight=$mouseRegion.height();var objTop=objOffset.top;var objBottom=objTop+objHeight;var mouseY=e.pageY;var mousePercent=parseInt(parseInt((mouseY-objTop)*100)/objHeight);$clipRegion.addClass('clipRegion');$containerRegion.addClass('containerRegion');var thrust=parseInt((parseInt(($containerRegion.outerHeight()-$clipRegion.height())*mousePercent))/100);$containerRegion.stop().animate({top:-thrust},523,'easeOutCirc');});}}else{var totalHeight=(($listRegions.outerHeight()+$listRegions.outerHeight(true))*($listRegions.length+1))-10;$(self.options.fnordField).css('height',totalHeight);}}else{if($listRegions.length>self.options.fnordThreshold)
{$containerRegion.css('height','auto');var totalLength=$listRegions.outerWidth()*($listRegions.length+2);$containerRegion.css('width',totalLength+'px');if($containerRegion.outerWidth()>$clipRegion.width())
{$mouseRegion.mousemove(function(e){var objOffset=$mouseRegion.offset();var objWidth=$mouseRegion.width();var objLeft=objOffset.left;var objRight=objLeft+objWidth;var mouseX=e.pageX;var mousePercent=parseInt(parseInt((mouseX-objLeft)*100)/objWidth);var thrust=parseInt((parseInt(($containerRegion.outerWidth()-$clipRegion.width())*mousePercent))/100)-25;$containerRegion.stop().animate({left:-thrust},523,'easeOutCirc');});}}else{var totalWidth=(($listRegions.outerWidth()+$listRegions.outerWidth(true))*($listRegions.length+1))-10;$(self.options.fnordField).css('width',totalWidth);}}}
self._childrenLoaded=false;self._offsets=new Array();self._running=false;self._animCss=self.options.vertical?"top":"left";self._sizeCss=self.options.vertical?"height":"width";self._v=null;self._curr=null;self._$div=null;self._$ul=null;self._$li=null;self._origSize=null;self._totSize=null;self.element.each(function(){self._$div=self.element,self._$ul=$("ul",self._$div),self._$li=$("li",self._$ul)
self._origSize=self._totSize=self._$li.length;if(self.origSize==0)
return;self._$div.css("visibility","hidden");self._curr=(self.options.start>=self._origSize)?self._origSize-1:(self.options.start<0)?0:self.options.start;self._v=self.options.visible=(self.options.visible>self._origSize)?self._origSize:(self.options.visible<1)?1:self.options.visible;self.options.scroll=(self.options.scroll>=self._origSize)?self._origSize-1:(self.options.scroll<0)?0:self.options.scroll;if(self.options.circular&&self._v<self._origSize){self._$ul.append(self._$li.clone(true)).append(self._$li.slice(0,self._v-2).clone(true));self._$li=$("li",self._$ul)
self._totSize=self._$li.size();}
if(self.options.showLoading)
{self._$li.not(':first').each(function(i,x){x=$(x);x.html('<span class="load"></span>');});}
self._$li.css({overflow:"hidden",'float':self.options.vertical?"none":"left"});if(!self.options.fnordForce)
{self._$ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none"});}else{self._$ul.css({position:"relative","list-style-type":"none"});}
self._$div.css({overflow:"hidden",position:"relative",left:"0px"});self.setEventHandlers();function afterLoad(){self._childrenLoaded=true;self.positionCarousel();}
if(self.options.sizeAfterLoad&&!self._childrenLoaded&&!self.complete)
self._$div.load(afterLoad());else
afterLoad();});$.ui.bbCarousel.instances.push(this.element);},_init:function(){},vis:function(){return this._$li.slice(this._curr).slice(0,this._v);},go:function(to){var self=this;if(!self._running){if(self.options.beforeStart)
self.options.beforeStart.call(self,self.vis());if(self.options.circular){if(to<0){self._$ul.css(self._animCss,-(self._offsets[self._curr+self._origSize])+"px");self._curr=self._origSize+to;}else if(to>=self._totSize-self._v){self._$ul.css(self._animCss,-(self._offsets[self._curr-self._origSize])+"px");self._curr=to-self._origSize;}else self._curr=to;}else{if(to<0||to>self._totSize)return this;else self._curr=to;}
self._running=true;self._$ul.stop(true,true).animate(self._animCss=="left"?{left:-(self._offsets[self._curr])}:{top:-(self._offsets[self._curr])},self.options.speed,self.options.easing,function(){if(self.options.afterEnd)
self.optinos.afterEnd.call(self,self.vis());self._running=false;});if(!self.options.circular){$(self.options.btnPrev+","+self.options.btnNext).removeClass("disabled");$((self._curr-self.options.scroll<0&&self.options.btnPrev)||(self._curr+self.options.scroll>self._totSize-self._v&&self.options.btnNext)||[]).addClass('disabled');}}
return this;},reset:function(){this.go(0);},positionCarousel:function(){var self=this;self._offsets[0]=0;self._$li.each(function(i){var base=$(this);self._offsets[i+1]=(self.options.vertical?base.outerHeight(true):base.outerWidth(true))+self._offsets[i];});var length=self._offsets[self._curr+this._v]-self._offsets[self._curr];if(this.options.circular)
{self._$div.css(self._sizeCss,self.options.maxLength!=0&&length>self.options.maxLength?self.options.maxLength:length+"px");}
if(this.options.circular)
{self._$ul.css(self._sizeCss,self._offsets[self._$li.length]*2+"px").css(self._animCss,-(self._offsets[self._curr])+"px");}
self._$div.fadeOut(0);self._$div.css("visibility","visible");self._$div.fadeIn(10);},setEventHandlers:function(){var self=this;if(self.options.hoverTop){var $hover=$(self.options.hoverTop);if($hover.length)
{$hover.hover(function(){self.options.hoverFunction();return self.go(0);},function(){});}}
if(self.options.btnPrev){$(self.options.btnPrev).click(function(){return self.go(self._curr-self.options.scroll);});}
if(self.options.btnNext)
$(self.options.btnNext).click(function(){return self.go(self._curr+self.options.scroll);});if(self.options.btnGo)
$.each(self.options.btnGo,function(i,val){$(val).click(function(){return self.go(self.options.circular?self.options.visible+i:i);});});if(self.options.mouseWheel&&self._$div.mousewheel)
self._$div.mousewheel(function(e,d){return d>0?self.go(self._curr-self.options.scroll):go(self._curr+self.options.scroll);});if(self.options.auto)
setInterval(function(){self.go(self._curr+self.options.scroll);},self.options.auto+self.options.speed);},_findPos:function(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curtop,curleft];},destroy:function(){var element=this.element,position=$.inArray(element,$.ui.bbCarousel.instances);if(position>-1){$.ui.bbCarousel.instances.splice(position,1);}
$.Widget.prototype.destroy.call(this);},_getOtherInstances:function(){var element=this.element;return $.grep($.ui.bbCarousel.instances,function(el){return el!==element;});},_setOption:function(key,value){this.options[key]=value;}});$.extend($.ui.bbCarousel,{instances:[]});})(jQuery);;(function($){$.fn.bbjCarousel=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,sizeAfterLoad:false,speed:600,easing:'swing',vertical:false,circular:true,maxLength:0,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});var childrenLoaded=false;var offsets=new Array();var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var v,curr;var $div,$ul,$li;var origSize,totSize;function vis(){return $li.slice(curr).slice(0,v);}
function go(to){if(!running){if(o.beforeStart)
o.beforeStart.call(this,vis());if(o.circular){if(to<0){$ul.css(animCss,-(offsets[curr+origSize])+"px");curr=origSize+to;}else if(to>=totSize-v){$ul.css(animCss,-(offsets[curr-origSize])+"px");curr=to-origSize;}else curr=to;}else{if(to<0||to>totSize)return this;else curr=to;}
running=true;$ul.stop(true,true).animate(animCss=="left"?{left:-(offsets[curr])}:{top:-(offsets[curr])},o.speed,o.easing,function(){if(o.afterEnd)
o.afterEnd.call(this,vis());running=false;});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>totSize-v&&o.btnNext)||[]).addClass("disabled");}}
return this;}
function positionCarousel(){offsets[0]=0;$li.each(function(i){offsets[i+1]=(o.vertical?$(this).outerHeight(true):$(this).outerWidth(true))+offsets[i];})
var length=offsets[curr+v]-offsets[curr];$div.css(sizeCss,o.maxLength!=0&&length>o.maxLength?o.maxLength:length+"px");$ul.css(sizeCss,offsets[$li.length]*2+"px").css(animCss,-(offsets[curr])+"px");$div.fadeOut(0);$div.css("visibility","visible");$div.fadeIn(10);}
function setEventHandlers(){if(o.btnPrev){$(o.btnPrev).click(function(){return go(curr-o.scroll);});}
if(o.btnNext)
$(o.btnNext).click(function(){return go(curr+o.scroll);});if(o.btnGo)
$.each(o.btnGo,function(i,val){$(val).click(function(){return go(o.circular?o.visible+i:i);});});if(o.mouseWheel&&$div.mousewheel)
$div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});if(o.auto)
setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);}
return this.each(function(){$div=$(this),$ul=$("ul",$div),$li=$("li",$ul)
origSize=totSize=$li.length;if(origSize==0)
return;$div.css("visibility","hidden");curr=(o.start>=origSize)?origSize-1:(o.start<0)?0:o.start;v=o.visible=(o.visible>origSize)?origSize:(o.visible<1)?1:o.visible;o.scroll=(o.scroll>=origSize)?origSize-1:(o.scroll<0)?0:o.scroll;if(o.circular&&v<origSize){$ul.append($li.clone(true)).append($li.slice(0,v-2).clone(true));$li=$("li",$ul)
totSize=$li.size();}
$li.css({overflow:"hidden",'float':o.vertical?"none":"left"});$ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none"});$div.css({overflow:"hidden",position:"relative",left:"0px"});setEventHandlers();function afterLoad(){childrenLoaded=true;positionCarousel();}
if(o.sizeAfterLoad&&!childrenLoaded&&!this.complete)
$div.load(afterLoad());else
afterLoad();});};})(jQuery);;;(function($){$(function(){var $scrollTo=$.scrollTo=function(target,duration,settings){$(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};$scrollTo.window=function(scope){return $(window)._scrollable();};$.fn._scrollable=function(){return this.map(function(){var elem=this,isWin=!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)
return elem;var doc=(elem.contentWindow||elem).document||elem.ownerDocument||elem;return $.browser.safari||doc.compatMode=='BackCompat'?doc.body:doc.documentElement;});};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0;}
if(typeof settings=='function')
settings={onAfter:settings};if(target=='max')
target=9e9;settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)
duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this._scrollable().each(function(){var elem=this,$elem=$(elem),targ=target,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;}
targ=$(targ,this);case'object':if(targ.is||targ.style)
toff=(targ=$(targ)).offset();}
$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,old=elem[key],max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos))||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'))||0;}
attr[key]+=settings.offset[pos]||0;if(settings.over[pos])
attr[key]+=targ[axis=='x'?'width':'height']()*settings.over[pos];}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)=='%'?parseFloat(val)/100*max:val;}
if(/^\d+$/.test(attr[key]))
attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&settings.queue){if(old!=attr[key])
animate(settings.onAfterFirst);delete attr[key];}});animate(settings.onAfter);function animate(callback){$elem.stop(true,true).animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target,settings);});};}).end();};$scrollTo.max=function(elem,axis){var Dim=axis=='x'?'Width':'Height',scroll='scroll'+Dim;if(!$(elem).is('html,body'))
return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,html=elem.ownerDocument.documentElement,body=elem.ownerDocument.body;return Math.max(html[scroll],body[scroll])
-Math.min(html[size],body[size]);};function both(val){return typeof val=='object'?val:{top:val,left:val};};})})(jQuery);
