(function(a){a.fn.infinitescroll=function(n,i){function f(){b.debug&&window.console&&console.log.call(console,arguments)}function k(){return b.localMode?a(c.container)[0].scrollHeight&&a(c.container)[0].scrollHeight:a(document).height()}function l(){c.loadingMsg.find("img").hide().parent().find("div").html(b.donetext).animate({opacity:1},2E3,function(){a(this).parent().fadeOut("normal")});b.errorCallback()}function o(){if(c.isDone){l();return false}else{var d=g.children().get();if(d.length==0)return a.event.trigger("ajaxError",[{status:404}]);for(;g[0].firstChild;)j.appendChild(g[0].firstChild);a(b.contentSelector)[0].appendChild(j);c.loadingMsg.fadeOut("normal");if(b.animate){var e=a(window).scrollTop()+a("#infscr-loading").height()+b.extraScrollPx+"px";a("html,body").animate({scrollTop:e},800,function(){c.isDuringAjax=false})}i.call(a(b.contentSelector)[0],d);if(!b.animate)c.isDuringAjax=false}}a.browser.ie6=a.browser.msie&&a.browser.version<7;var b=a.extend({},a.infinitescroll.defaults,n),c=a.infinitescroll,g,j;i=i||function(){};if(!function(d){for(var e in d){if(e.indexOf&&e.indexOf("Selector")>-1&&a(d[e]).length===0){f("Your "+e+" found no elements.");return false}return true}}(b))return false;c.container=b.localMode?this:document.documentElement;b.contentSelector=b.contentSelector||this;b.loadMsgSelector=b.loadMsgSelector||b.contentSelector;var m=/(.*?\/\/).*?(\/.*)/,h=a(b.nextSelector).attr("href");if(h){h=function(d){d.match(m)&&d.match(m);if(d.match(/^(.*?)\b2\b(.*?$)/))d=d.match(/^(.*?)\b2\b(.*?$)/).slice(1);else if(d.match(/^(.*?)2(.*?$)/)){if(d.match(/^(.*?page=)2(\/.*|$)/))return d=d.match(/^(.*?page=)2(\/.*|$)/).slice(1);f("Trying backup next selector parse technique. Treacherous waters here, matey.");d=d.match(/^(.*?)2(.*?$)/).slice(1)}else{if(d.match(/^(.*?page=)1(\/.*|$)/))return d=d.match(/^(.*?page=)1(\/.*|$)/).slice(1);f("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");c.isInvalidPage=true}return d}(h);if(b.localMode)a(c.container)[0].scrollTop=0;c.pixelsFromNavToBottom=k()+(c.container==document.documentElement?0:a(c.container).offset().top)-a(b.navSelector).offset().top;c.loadingMsg=a('<div id="infscr-loading" style="text-align: center;"><img alt="Loading..." src="'+b.loadingImg+'" /><div>'+b.loadingText+"</div></div>");(new Image).src=b.loadingImg;a(document).ajaxError(function(d,e){f("Page not found. Self-destructing...");if(e.status==404){l();c.isDone=true;a(b.localMode?this:window).unbind("scroll.infscr")}});a(b.localMode?this:window).bind("scroll.infscr",function(){if(!(c.isDuringAjax||c.isInvalidPage||c.isDone)){var d=0+k()-(b.localMode?a(c.container).scrollTop():a(c.container).scrollTop()||a(c.container.ownerDocument.body).scrollTop())-a(b.localMode?c.container:window).height();f("math:",d,c.pixelsFromNavToBottom);d-b.bufferPx<c.pixelsFromNavToBottom&&a(document).trigger("retrieve.infscr")}}).trigger("scroll.infscr");a(document).bind("retrieve.infscr",function(){c.isDuringAjax=true;c.loadingMsg.appendTo(b.loadMsgSelector).show();a(b.navSelector).hide();c.currPage++;f("heading into ajax",h);g=a(b.contentSelector).is("table")?a("<tbody/>"):a("<div/>");j=document.createDocumentFragment();g.load(h.join(c.currPage)+" "+b.itemSelector,null,o)});return this}else f("Navigation selector not found")};a.infinitescroll={defaults:{debug:false,preload:false,nextSelector:"div.navigation a:first",loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"<em>Loading the next set of posts...</em>",donetext:"<em>Congratulations, you've reached the end of the internet.</em>",navSelector:"div.navigation",contentSelector:null,loadMsgSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,localMode:false,bufferPx:40,errorCallback:function(){}},loadingImg:undefined,loadingMsg:undefined,container:undefined,currPage:1,currDOMChunk:null,isDuringAjax:false,isInvalidPage:false,isDone:false}})(jQuery);;(function($){var event=$.event,resizeTimeout;event.special.smartresize={setup:function(){$(this).bind("resize",event.special.smartresize.handler);},teardown:function(){$(this).unbind("resize",event.special.smartresize.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartresize";if(resizeTimeout){clearTimeout(resizeTimeout);}
resizeTimeout=setTimeout(function(){jQuery.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartresize=function(fn){return fn?this.bind("smartresize",fn):this.trigger("smartresize",["execAsap"]);};$.fn.masonry=function(options,callback){var msnry={getBricks:function($wall,props,opts){var hasItemSelector=(opts.itemSelector===undefined);if(opts.appendedContent===undefined){props.$bricks=hasItemSelector?$wall.children():$wall.find(opts.itemSelector);}else{props.$bricks=hasItemSelector?opts.appendedContent:opts.appendedContent.filter(opts.itemSelector);}},placeBrick:function($brick,setCount,setY,props,opts){var minimumY=Math.min.apply(Math,setY),setHeight=minimumY+$brick.outerHeight(true),i=setY.length,shortCol=i,setSpan=props.colCount+1-i;while(i--){if(setY[i]==minimumY){shortCol=i;}}
var position={left:props.colW*shortCol+props.posLeft,top:minimumY};$brick.applyStyle(position,$.extend(true,{},opts.animationOptions));for(i=0;i<setSpan;i++){props.colY[shortCol+i]=setHeight;}},setup:function($wall,opts,props){msnry.getBricks($wall,props,opts);if(props.masoned){props.previousData=$wall.data('masonry');}
if(opts.columnWidth===undefined){props.colW=props.masoned?props.previousData.colW:props.$bricks.outerWidth(true);}else{props.colW=opts.columnWidth;}
props.colCount=Math.floor($wall.width()/props.colW);props.colCount=Math.max(props.colCount,1);},arrange:function($wall,opts,props){var i;if(!props.masoned||opts.appendedContent!==undefined){props.$bricks.css('position','absolute');}
if(!props.masoned){$wall.css('position','relative');var $cursor=$(document.createElement('div'));$wall.prepend($cursor);props.posTop=Math.round($cursor.position().top);props.posLeft=Math.round($cursor.position().left);$cursor.remove();}else{props.posTop=props.previousData.posTop;props.posLeft=props.previousData.posLeft;}
if(props.masoned&&opts.appendedContent!==undefined){props.colY=props.previousData.colY;for(i=props.previousData.colCount;i<props.colCount;i++){props.colY[i]=props.posTop;}}else{props.colY=[];i=props.colCount;while(i--){props.colY.push(props.posTop);}}
$.fn.applyStyle=(props.masoned&&opts.animate)?$.fn.animate:$.fn.css;if(opts.singleMode){props.$bricks.each(function(){var $brick=$(this);msnry.placeBrick($brick,props.colCount,props.colY,props,opts);});}else{props.$bricks.each(function(){var $brick=$(this),colSpan=Math.ceil($brick.outerWidth(true)/props.colW);colSpan=Math.min(colSpan,props.colCount);if(colSpan===1){msnry.placeBrick($brick,props.colCount,props.colY,props,opts);}else{var groupCount=props.colCount+1-colSpan,groupY=[];for(i=0;i<groupCount;i++){var groupColY=props.colY.slice(i,i+colSpan);groupY[i]=Math.max.apply(Math,groupColY);}
msnry.placeBrick($brick,groupCount,groupY,props,opts);}});}
props.wallH=Math.max.apply(Math,props.colY);var wallCSS={height:props.wallH-props.posTop};$wall.applyStyle(wallCSS,$.extend(true,[],opts.animationOptions));if(!props.masoned){setTimeout(function(){$wall.addClass('masoned');},1);}
callback.call(props.$bricks);$wall.data('masonry',props);},resize:function($wall,opts,props){props.masoned=!!$wall.data('masonry');var prevColCount=$wall.data('masonry').colCount;msnry.setup($wall,opts,props);if(props.colCount!=prevColCount){msnry.arrange($wall,opts,props);}}};return this.each(function(){var $wall=$(this),props={};props.masoned=!!$wall.data('masonry');var previousOptions=props.masoned?$wall.data('masonry').options:{},opts=$.extend({},$.fn.masonry.defaults,previousOptions,options),resizeOn=previousOptions.resizeable;props.options=opts.saveOptions?opts:previousOptions;callback=callback||function(){};msnry.getBricks($wall,props,opts);if(!props.$bricks.length){return this;}
msnry.setup($wall,opts,props);msnry.arrange($wall,opts,props);if(!resizeOn&&opts.resizeable){$(window).bind('smartresize.masonry',function(){msnry.resize($wall,opts,props);});}
if(resizeOn&&!opts.resizeable){$(window).unbind('smartresize.masonry');}});};$.fn.masonry.defaults={singleMode:false,columnWidth:undefined,itemSelector:undefined,appendedContent:undefined,saveOptions:true,resizeable:true,animate:false,animationOptions:{}};})(jQuery);(function($){var defaultOptions={preloadImg:true};var jqTransformImgPreloaded=false;var jqTransformPreloadHoverFocusImg=function(strImgUrl){strImgUrl=strImgUrl.replace(/^url\((.*)\)/,'$1').replace(/^\"(.*)\"$/,'$1');var imgHover=new Image();imgHover.src=strImgUrl.replace(/\.([a-zA-Z]*)$/,'-hover.$1');var imgFocus=new Image();imgFocus.src=strImgUrl.replace(/\.([a-zA-Z]*)$/,'-focus.$1');};var jqTransformGetLabel=function(objfield){var selfForm=$(objfield.get(0).form);var oLabel=objfield.next();if(!oLabel.is('label')){oLabel=objfield.prev();if(oLabel.is('label')){var inputname=objfield.attr('id');if(inputname){oLabel=selfForm.find('label[for="'+inputname+'"]');}}}
if(oLabel.is('label')){return oLabel.css('cursor','pointer');}
return false;};var jqTransformHideSelect=function(oTarget){var ulVisible=$('.jqTransformSelectWrapper ul:visible');ulVisible.each(function(){var oSelect=$(this).parents(".jqTransformSelectWrapper:first").find("select").get(0);if(!(oTarget&&oSelect.oLabel&&oSelect.oLabel.get(0)==oTarget.get(0))){$(this).hide();}});};var jqTransformCheckExternalClick=function(event){if($(event.target).parents('.jqTransformSelectWrapper').length===0){jqTransformHideSelect($(event.target));}};var jqTransformAddDocumentListener=function(){$(document).mousedown(jqTransformCheckExternalClick);};var jqTransformReset=function(f){var sel;$('.jqTransformSelectWrapper select',f).each(function(){sel=(this.selectedIndex<0)?0:this.selectedIndex;$('ul',$(this).parent()).each(function(){$('a:eq('+sel+')',this).click();});});$('a.jqTransformCheckbox, a.jqTransformRadio',f).removeClass('jqTransformChecked');$('input:checkbox, input:radio',f).each(function(){if(this.checked){$('a',$(this).parent()).addClass('jqTransformChecked');}});};$.fn.jqTransInputButton=function(){return this.each(function(){var newBtn=$('<button id="'+this.id+'" name="'+this.name+'" type="'+this.type+'" class="'+this.className+' jqTransformButton"><span><span>'+$(this).attr('value')+'</span></span>').hover(function(){newBtn.addClass('jqTransformButton_hover');},function(){newBtn.removeClass('jqTransformButton_hover')}).mousedown(function(){newBtn.addClass('jqTransformButton_click')}).mouseup(function(){newBtn.removeClass('jqTransformButton_click')});$(this).replaceWith(newBtn);});};$.fn.jqTransInputText=function(){return this.each(function(){var $input=$(this);if($input.hasClass('jqtranformdone')||!$input.is('input')){return;}
$input.addClass('jqtranformdone');var oLabel=jqTransformGetLabel($(this));oLabel&&oLabel.bind('click',function(){$input.focus();});var inputSize=$input.width();if($input.attr('size')){inputSize=$input.attr('size')*10;$input.css('width',inputSize);}
$input.addClass("jqTransformInput").wrap('<div class="jqTransformInputWrapper"><div class="jqTransformInputInner"><div></div></div></div>');var $wrapper=$input.parent().parent().parent();$wrapper.css("width",inputSize+10);$input.focus(function(){$wrapper.addClass("jqTransformInputWrapper_focus");}).blur(function(){$wrapper.removeClass("jqTransformInputWrapper_focus");}).hover(function(){$wrapper.addClass("jqTransformInputWrapper_hover");},function(){$wrapper.removeClass("jqTransformInputWrapper_hover");});$.browser.safari&&$wrapper.addClass('jqTransformSafari');$.browser.safari&&$input.css('width',$wrapper.width()+16);this.wrapper=$wrapper;});};$.fn.jqTransCheckBox=function(){return this.each(function(){if($(this).hasClass('jqTransformHidden')){return;}
var $input=$(this);var inputSelf=this;var oLabel=jqTransformGetLabel($input);oLabel&&oLabel.click(function(){aLink.trigger('click');});var aLink=$('<a href="#" class="jqTransformCheckbox"></a>');$input.addClass('jqTransformHidden').wrap('<span class="jqTransformCheckboxWrapper"></span>').parent().prepend(aLink);$input.change(function(){this.checked&&aLink.addClass('jqTransformChecked')||aLink.removeClass('jqTransformChecked');return true;});aLink.click(function(){if($input.attr('disabled')){return false;}
$input.trigger('click').trigger("change");return false;});this.checked&&aLink.addClass('jqTransformChecked');});};$.fn.jqTransRadio=function(){return this.each(function(){if($(this).hasClass('jqTransformHidden')){return;}
var $input=$(this);var inputSelf=this;oLabel=jqTransformGetLabel($input);oLabel&&oLabel.click(function(){aLink.trigger('click');});var aLink=$('<a href="#" class="jqTransformRadio" rel="'+this.name+'"></a>');$input.addClass('jqTransformHidden').wrap('<span class="jqTransformRadioWrapper"></span>').parent().prepend(aLink);$input.change(function(){inputSelf.checked&&aLink.addClass('jqTransformChecked')||aLink.removeClass('jqTransformChecked');return true;});aLink.click(function(){if($input.attr('disabled')){return false;}
$input.trigger('click').trigger('change');$('input[name="'+$input.attr('name')+'"]',inputSelf.form).not($input).each(function(){$(this).attr('type')=='radio'&&$(this).trigger('change');});return false;});inputSelf.checked&&aLink.addClass('jqTransformChecked');});};$.fn.jqTransTextarea=function(){return this.each(function(){var textarea=$(this);if(textarea.hasClass('jqtransformdone')){return;}
textarea.addClass('jqtransformdone');oLabel=jqTransformGetLabel(textarea);oLabel&&oLabel.click(function(){textarea.focus();});var strTable='<table cellspacing="0" cellpadding="0" border="0" class="jqTransformTextarea">';strTable+='<tr><td id="jqTransformTextarea-tl"></td><td id="jqTransformTextarea-tm"></td><td id="jqTransformTextarea-tr"></td></tr>';strTable+='<tr><td id="jqTransformTextarea-ml">&nbsp;</td><td id="jqTransformTextarea-mm"><div></div></td><td id="jqTransformTextarea-mr">&nbsp;</td></tr>';strTable+='<tr><td id="jqTransformTextarea-bl"></td><td id="jqTransformTextarea-bm"></td><td id="jqTransformTextarea-br"></td></tr>';strTable+='</table>';var oTable=$(strTable).insertAfter(textarea).hover(function(){!oTable.hasClass('jqTransformTextarea-focus')&&oTable.addClass('jqTransformTextarea-hover');},function(){oTable.removeClass('jqTransformTextarea-hover');});textarea.focus(function(){oTable.removeClass('jqTransformTextarea-hover').addClass('jqTransformTextarea-focus');}).blur(function(){oTable.removeClass('jqTransformTextarea-focus');}).appendTo($('#jqTransformTextarea-mm div',oTable));this.oTable=oTable;if($.browser.safari){$('#jqTransformTextarea-mm',oTable).addClass('jqTransformSafariTextarea').find('div').css('height',textarea.height()).css('width',textarea.width());}});};$.fn.jqTransSelect=function(){return this.each(function(index){var $select=$(this);if($select.hasClass('jqTransformHidden')){return;}
if($select.attr('multiple')){return;}
var oLabel=jqTransformGetLabel($select);var $wrapper=$select.addClass('jqTransformHidden').wrap('<div class="jqTransformSelectWrapper"></div>').parent().css({zIndex:10-index});$wrapper.prepend('<div><span></span><a href="#" class="jqTransformSelectOpen"></a></div><ul></ul>');var $ul=$('ul',$wrapper).css('width',$select.width()).hide();$('option',this).each(function(i){var oLi=$('<li><a href="#" index="'+i+'">'+$(this).html()+'</a></li>');$ul.append(oLi);});$ul.find('a').click(function(){$('a.selected',$wrapper).removeClass('selected');$(this).addClass('selected');if($select[0].selectedIndex!=$(this).attr('index')&&$select[0].onchange){$select[0].selectedIndex=$(this).attr('index');$select[0].onchange();}
$select[0].selectedIndex=$(this).attr('index');$('span:eq(0)',$wrapper).html($(this).html());$ul.hide();return false;});$('a:eq('+this.selectedIndex+')',$ul).click();$('span:first',$wrapper).click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});oLabel&&oLabel.click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});this.oLabel=oLabel;var oLinkOpen=$('a.jqTransformSelectOpen',$wrapper).click(function(){if($ul.css('display')=='none'){jqTransformHideSelect();}
if($select.attr('disabled')){return false;}
$ul.slideToggle('fast',function(){var offSet=($('a.selected',$ul).offset().top-$ul.offset().top);$ul.animate({scrollTop:offSet});});return false;});var iSelectWidth=$select.outerWidth();var oSpan=$('span:first',$wrapper);var newWidth=(iSelectWidth>oSpan.innerWidth())?iSelectWidth+oLinkOpen.outerWidth():$wrapper.width();$wrapper.css('width',newWidth);$ul.css('width',newWidth-2);oSpan.css({width:iSelectWidth});$ul.css({display:'block',visibility:'hidden'});var iSelectHeight=($('li',$ul).length)*($('li:first',$ul).height());(iSelectHeight<$ul.height())&&$ul.css({height:iSelectHeight,'overflow':'hidden'});$ul.css({display:'none',visibility:'visible'});});};$.fn.jqTransform=function(options){var opt=$.extend({},defaultOptions,options);return this.each(function(){var selfForm=$(this);if(selfForm.hasClass('jqtransformdone')){return;}
selfForm.addClass('jqtransformdone');$('input:checkbox',this).jqTransCheckBox();if($('select',this).jqTransSelect().length>0){jqTransformAddDocumentListener();}
selfForm.bind('reset',function(){var action=function(){jqTransformReset(this);};window.setTimeout(action,10);});});};})(jQuery);(function($){var ver="2.88";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,(!opts2.rev&&!opts.backwards));},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,(!opts.rev&&!opts.backwards));}}}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}else{if(opts.backwards){opts.startingSlide=els.length-1;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=false;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false};})(jQuery);(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);(function($){$.fn.quicksand=function(collection,customOptions){var options={duration:750,easing:'swing',attribute:'data-id',adjustHeight:true,preCallback:null};$.extend(options,customOptions);options.selector=null;$.extend(options,{selector:'> *'});var callbackFunction;if(typeof(arguments[1])=='function'){var callbackFunction=arguments[1];}else if(typeof(arguments[2]=='function')){var callbackFunction=arguments[2];}
function cssPath(node){var nodes=[]
if($(node).get(0)==undefined){return"";}
var name=$(node).get(0).nodeName.toLowerCase();if($(node).attr('id')){name+='#'+$(node).attr('id');}
nodes.push(name);var parents=[]
while(!($(node).get(0).nodeName.toLowerCase()=='html')){parents.push(node);node=node.parent();}
$(parents).each(function(){name=$(this).get(0).nodeName.toLowerCase();if($(this).attr('id')){name+='#'+$(this).attr('id');}
nodes.push(name);});return nodes.reverse().join(' > ');}
return this.each(function(i){var $collection=$(collection).clone();var $sourceParent=$(this);var sourceHeight=$(this).css('height');var offset=$($sourceParent).offset();var offsets=[];var $source=$(this).find(options.selector);if($.browser.msie&&$.browser.version.substr(0,1)<7){$sourceParent.html('').append($collection);return;}
var postCallbackPerformed=0;var postCallback=function(){if(!postCallbackPerformed){$sourceParent.html($dest.html());$("[data-quicksand-owner="+cssPath($sourceParent)+"]").remove();if(typeof callbackFunction=='function'){callbackFunction.call(this);}
postCallbackPerformed=1;}};var $correctionParent=$sourceParent.offsetParent();var correctionOffset=$correctionParent.offset();if($correctionParent.css('position')=='relative'){if($correctionParent.get(0).nodeName.toLowerCase()=='body'){}else{correctionOffset.top+=parseFloat($correctionParent.css('border-top-width'));correctionOffset.left+=parseFloat($correctionParent.css('border-left-width'));}}else{correctionOffset.top-=parseFloat($correctionParent.css('border-top-width'));correctionOffset.left-=parseFloat($correctionParent.css('border-left-width'));correctionOffset.top-=parseFloat($correctionParent.css('margin-top'));correctionOffset.left-=parseFloat($correctionParent.css('margin-left'));}
$sourceParent.css('height',$(this).height());$source.each(function(i){offsets[i]=$(this).offset();});$(this).stop();$source.each(function(i){$(this).stop();$(this).css('position','absolute').css('margin',0).css('top',offsets[i].top-parseFloat($(this).css('margin-top'))-correctionOffset.top).css('left',offsets[i].left-parseFloat($(this).css('margin-left'))-correctionOffset.left);});var $dest=$($sourceParent).clone().html('').attr('id','').attr("data-quicksand-owner",$sourceParent.selector).css('height','auto').css('width',$sourceParent.width()+'px').append($collection);$dest.insertBefore($sourceParent).css('z-index',1).css('opacity',0.0).css('margin',0.0).css('position','absolute').css('top',offset.top-correctionOffset.top).css('left',offset.left-correctionOffset.left).attr('data-quicksand-owner',cssPath($sourceParent));if(options.adjustHeight){$sourceParent.animate({height:$dest.height()},options.duration,options.easing);}
$source.each(function(i){var destElement=$collection.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');if(destElement.length){if($.browser.msie){$(this).animate({top:destElement.offset().top-correctionOffset.top,left:destElement.offset().left-correctionOffset.left,opacity:1.0},options.duration,options.easing,postCallback);}else{$(this).animate({top:destElement.offset().top-correctionOffset.top,left:destElement.offset().left-correctionOffset.left,opacity:1.0,scale:'1.0'},options.duration,options.easing,postCallback);}}else{if($.browser.msie){$(this).animate({opacity:'0.0'},options.duration,options.easing,postCallback);}else{$(this).animate({opacity:'0.0',scale:'0.0'},options.duration,options.easing,postCallback);}}});$collection.each(function(i){var sourceElement=$source.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');var destElement=$collection.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');var animationOptions;if(sourceElement.length===0){if($.browser.msie){animationOptions={opacity:'1.0'};}else{animationOptions={opacity:'1.0',scale:'1.0'};}
destElement.clone().css('position','absolute').css('margin',0.0).css('top',destElement.offset().top-correctionOffset.top).css('left',destElement.offset().left-correctionOffset.left).css('opacity',0.0).css('transform','scale(0.0)').appendTo($sourceParent).animate(animationOptions,options.duration,options.easing,postCallback);}});if(typeof options.preCallback=='function'){options.preCallback();}});};})(jQuery);;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function')
options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}
url=url||window.location.href||'';options=$.extend({url:url,type:this.attr('method')||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
a.push({name:n,value:options.data[n][k]});}
else
a.push({name:n,value:options.data[n]});}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){$(options.target).html(data).each(oldSuccess,arguments);});}
else if(options.success)
callbacks.push(options.success);options.success=function(data,status,xhr){for(var i=0,max=callbacks.length;i<max;i++)
callbacks[i].apply(options,[data,status,xhr||$form,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;var multipart=false;if((files.length&&options.iframe!==false)||options.iframe||found||multipart){if(options.closeKeepAlive)
$.get(options.closeKeepAlive,fileUpload);else
fileUpload();}
else
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="'+opts.iframeSrc+'" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src',opts.iframeSrc);}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}
if(xhr.aborted)
return;var cbInvoked=0;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){opts.extraData=opts.extraData||{};opts.extraData[n]=sub.value;if(sub.type=="image"){opts.extraData[name+'.x']=form.clk_x;opts.extraData[name+'.y']=form.clk_y;}}}
function doSubmit(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')
form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)
form.setAttribute('action',opts.url);if(!opts.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(opts.extraData)
for(var n in opts.extraData)
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+opts.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.submit();}
finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}};if(opts.forceSync)
doSubmit();else
setTimeout(doSubmit,10);var domCheckCount=50;function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;var isXml=opts.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){cbInvoked=0;setTimeout(cb,100);return;}
log('Could not access iframe DOM after 50 tries.');return;}
xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];if(ta)
xhr.responseText=ta.value;else{var pre=doc.getElementsByTagName('pre')[0];if(pre)
xhr.responseText=pre.innerHTML;}}
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
data=$.httpData(xhr,opts.dataType);}
catch(e){ok=false;$.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(options);return false;}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0)
return;target=t[0];}
var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);});};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
continue;}
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:n,value:v});}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
a.push({name:n,value:v[i]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)
v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
this.value='';else if(t=='checkbox'||t=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)
window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''));};})(jQuery);;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);jQuery(document).ready(function($){function setHeights(){var delivery=$('#cart .delivery'),deliverySpan=$('#cart .delivery span'),hgroup=$('#cart hgroup'),hgroupH1=$('#cart hgroup h1'),hgroupH2=$('#cart hgroup h2'),section=$('#cart section'),details=$('#cart .details'),buttons=$('#cart .buttons'),cartH=$('#cart .inner').height();max=Math.max($(details).height(),$(buttons).height());$(details).height(max);$(buttons).height(max);$(hgroupH1).css('margin-top',cartH/2-(($(hgroupH1).height()+$(hgroupH2).height())/2));$(deliverySpan).css('margin-top',cartH/2-8);$(delivery).height(cartH);$(hgroup).height(cartH);$(section).height(cartH);};setHeights();});(function($){var SCROLLTIMER=600;$(function(){var overlay=$('<div>').attr('id','overlay').append('<div>'),throbber=$('<div>').attr('id','throbber').text('Thinking');$('body').append(overlay).append(throbber);overlay.css({height:$('#container').height()+'px'});throbber.css({left:(($(window).width()-throbber.width())/2)+'px',top:(($(window).height()-throbber.height())*0.4)+'px'});Cufon.refresh();function removeFunc(){$('.winedetail-ajax').fadeOut(function(){$('.winedetail-ajax').remove();});overlay.fadeOut();$('.cartnotifier').fadeOut('fast',function(){$('.cartnotifier').remove();});return false;};overlay.click(removeFunc);var throbTimer;function showThrobber(){clearTimeout(throbTimer);throbTimer=setTimeout(function(){throbber.show();overlay.show();},100);};function hideThrobber(){clearTimeout(throbTimer);throbber.fadeOut('fast');};function moreDetailsInit(){if(!$.browser.msie||parseInt($.browser.version)!=6){$('.wine a').click(function(){showThrobber();overlay.fadeIn('fast');$.get($(this).attr('href'),function(data){var el=$(data);hideThrobber();$('.winedetail-ajax').remove();el.find('.backlink a').click(removeFunc);$('#container').append(el);var top=Math.max(($(window).height()-el.height())/2,0)+$(window).scrollTop();el.css({top:top+'px'}).hide();Cufon.refresh();el.fadeIn();overlay.fadeIn('fast');setHeights();});return false;});}};moreDetailsInit();function makecartnotifier(data){var cartnotifier=$('<div>').addClass('cartnotifier'),closelink=$('<a>').addClass('button').text('Continue browsing'),checkoutlink=$('<a>').addClass('button').attr('href',data['checkout_url']).text('Checkout & Pay');if($.browser.msie){closelink.attr('href',window.location);}
else{closelink.click(removeFunc);}
cartnotifier.append('<p>').append(closelink).append('or').append(checkoutlink);cartnotifier.find('p').text(data['product_quantity_added']+' bottle'+(data['product_quantity_added']==1?'':'s')+' of '+
data['product_name']+' has been successfully added to your cart.');$('body').append(cartnotifier);var top=Math.max(($(window).height()-cartnotifier.height())*0.4,0)+$(window).scrollTop();cartnotifier.css({left:(($(window).width()-cartnotifier.width())/2)+'px',top:top+'px'});return cartnotifier;};function formInit(){$('.wine form').submit(function(){var form=$(this),quantity_single=$(this).find('input[name$=quantity_single]'),quantity_case=$(this).find('input[name$=quantity_case]');quantity_single.val(parseInt(quantity_single.val())||'');quantity_case.val(parseInt(quantity_case.val())||'');if(!parseInt(quantity_single.val())&&!parseInt(quantity_case.val())){quantity_single.parent().addClass('error');}
else{showThrobber();form.ajaxSubmit({success:function(data){var cartnotifier=makecartnotifier(data);cartnotifier.fadeIn('fast');overlay.fadeIn('fast');hideThrobber();$.get(data['cart_url'],function(html){$('#cart').html(html);Cufon.refresh();cartHeight();setHeights();});form.clearForm();},dataType:'json'});}
return false;});};formInit();function cartHeight(){$('#cart hgroup').css({height:($('#cart .inner').height()-28)+'px'});};cartHeight();if(!$.browser.msie){function navInit(){$('nav#main section a, nav#main > a').click(function(){showThrobber();$.get($(this).attr('href'),function(data){var collection=$(data);for(var i=0;i<collection.length;i++){var id=$(collection[i]).attr('data-id');if(id&&!$('#wines_container *[data-id='+id+']').length){$('#wines_container').append($(collection[i]));}}
Cufon.refresh();hideThrobber();overlay.hide();$('#wines_container').quicksand(collection,{},function(){formInit();moreDetailsInit();Cufon.refresh();$.localScroll({duration:SCROLLTIMER});});});return false;});};navInit();}});})(jQuery);(function($){$('.height-equal').each(function(){if(!this.equalHeight_check){var me=$(this),height=me.height();me.siblings('.height-equal').each(function(){this.equalHeight_check=true;height=Math.max(height,$(this).height());});me.css({minHeight:height+'px'});me.siblings('.height-equal').css({minHeight:height+'px'});}});})($);(function($){$.fn.heightEqual=function(){return this.each(function(){if(!this.equalHeight_check){var me=$(this),height=me.height();this.equalHeight_check=true;me.siblings('.height-equal').each(function(){this.equalHeight_check=true;height=Math.max(height,$(this).height());});me.css({minHeight:height+'px'});me.siblings('.height-equal').css({minHeight:height+'px'});};});};})($);(function(a){jQuery.fn.widowFix=function(d){var c={linkFix:false};var b=a.extend(c,d);return this.each(function(){if(b.linkFix){a(this).find("a:last").wrap("<var>");var e=a("var").html();a("var").each(function(){a(this).find("a").contents().unwrap()})}var h="";var g=a(this).html().split(" ");var i=g.pop();function f(){if(i===""){i=g.pop();f()}}f();h=g.join(" ")+"&nbsp;"+i;a(this).html(h);if(b.linkFix){a("var").each(function(){a(this).contents().replaceWith(e);a(this).contents().unwrap()})}})}})(jQuery);(function($){var SCROLLTIMER=600;$(function(){$('a').each(function(i,item){if(item.href==(''+window.location).replace(/#.*$/,'').replace(/\?.*$/,'')){$(item).addClass('current');}});Cufon.refresh();$('input.required, select.required, textarea.required').parent('li, tr').find('label, th').addClass('required');$('input[type=checkbox]').addClass('checkbox');$.localScroll({duration:SCROLLTIMER});setTimeout(function(){$('.notifications').slideUp('slow');},5000);});})(jQuery);function detectBrowser(){var userAgent=navigator.userAgent.toLowerCase();$.browser.chrome=/chrome/.test(navigator.userAgent.toLowerCase());if($.browser.msie){return"IE";}
if($.browser.chrome){$.browser.safari=false;return"CHROME";}
if($.browser.safari){return"SAFARI";}
if($.browser.mozilla){if(navigator.userAgent.toLowerCase().indexOf('firefox')!=-1){return"FF";}
else{return"MOZILLA";}}
if($.browser.opera){return"OPERA";}}
jQuery(document).ready(function($){$('form').jqTransform({imgPath:'media/j/lib/jqtransformplugin/img/'});$('article.article p, body.clubhouse .latest-news p').widowFix({linkFix:true});$('nav li a').click(function(){$(this).css('text-decoration','none');});function preload(imgs){var pic=[];for(var i in imgs){pic[i]=new Image(100,25);pic[i].src=imgs[i];};};$('body.ourpeople .image').hover(function(){$(this).find('.over').fadeIn(400);},function(){$(this).find('.over').fadeOut(400);});$('body.home .commodore .images').cycle({speed:1000,timeout:5000});$('body.cafe .images').cycle({speed:1000,timeout:3000});if(detectBrowser()!='FF'){$('.cufon-active header a').hover(function(){var title=$(this).children('.title').get(0);Cufon.replace($(title),{fontFamily:'Stag Book'});},function(){var title=$(this).children('.title').get(0);Cufon.replace($(title),{fontFamily:'Stag Book'});});};if($('body.contact').length){$('.agents a').click(function(e){$('.country_details .replaced').remove();oldH3=$('#heading h3');$(oldH3).addClass('old');newH3=$('<h3>').addClass('new').addClass('cufon-book').hide();$(newH3).text($(this).text());$('#heading').append(newH3);$(this).siblings('.agent').each(function(i){var agent=$('.agent_details').clone();$(agent).removeClass('agent_details').addClass('replaced');address=$(this).find('.address').html();contact=$(this).find('.contact').html();$(agent).children('.address').html($(this).find('.address').html());$(agent).children('.contact').html(contact);$('.country_details span').after(agent);});$('.country_details .replaced .replaced, .country_details h3').remove();speed=$('.country_details:hidden').length?500:0;$('#agents h3.old').fadeOut(speed,function(){$(this).remove();});$('#heading p').fadeOut(speed,function(){$(this).remove();});Cufon.refresh();$('#agents .new').fadeIn(speed);if($('.country_details:hidden').length){$('.country_details').slideDown(500);};$('#heading h3').removeClass('new');return false;});};$('body.contact h3 a.enquiry').click(function(){$(this).parent('h3').siblings('form').slideDown(1000,function(){$('.height-equal').heightEqual();});return false;});$('body.contact form').submit(function(){var overlay=$('<div>').attr('id','overlay').text('test'),loader=$('<img/>').attr('src','/media/i/throbber.gif'),fields=[],height=$(this).height(),width=$(this).width();$('body.contact form #overlay').css({'opacity':0.8,'height':height}).show().append(loader);$('input, textarea',this).each(function(){fields.push(this.name+'='+escape(this.value));});$.ajax({type:"POST",data:fields.join('&'),url:'/contact-us/',timeout:45000,error:function(data){$(overlay).remove();return false;},success:function(data){$('body.contact form #overlay').fadeIn(1000,function(){$(this).find('img').fadeOut(100);$('body.contact form .form').hide();$('body.contact form .messages').show();$(this).fadeOut(500);});return false;}});return false;});var max=0;$('body.ourpeople .peoplecontent').each(function(){max=Math.max(max,$(this).height());});$('body.ourpeople .peoplecontent').each(function(){$(this).height(max);});$('#clubhouse-section2').masonry({itemSelector:'.article:visible'});function animateLoadMore(){var columns={'left':$('#clubhouse-section2').find('.article').filter(function(){return parseInt($(this).css('left'))==0;}),'middle':$('#clubhouse-section2').find('.article').filter(function(){return parseInt($(this).css('left'))==333;}),'right':$('#clubhouse-section2').find('.article').filter(function(){return parseInt($(this).css('left'))==666;})},heights={'left':0,'middle':0,'right':0},loadmoreH=$('#load-more').height(),marginTop=0,marginBottom=0;for(i in columns){$(columns[i]).each(function(j){heights[i]+=$(this).height()+10;});};var max=Math.max(Math.max(heights.left,heights.middle),heights.right);if(columns.middle.length){if(heights.middle>Math.max(heights.left,heights.right)){marginTop=heights.middle+40;marginBottom=40;}else{marginTop=heights.middle+((max-heights.middle)/2);marginTop+=marginTop<40?40:0;};if(marginTop<=heights.middle){marginTop+=40;marginBottom=40;}}else{max=Math.max(heights.left,heights.right);marginTop=max/2-loadmoreH/2;};$('#load-more').css({'margin-top':marginTop+'px','margin-bottom':marginBottom+'px'});$('#clubhouse-section2').height(Math.max(max,marginTop+marginBottom+14));};animateLoadMore();$('#clubhouse-section2').infinitescroll({navSelector:'#navigation',nextSelector:'#navigation a',itemSelector:'.article',loadingImg:'',donetext:'',debug:false,errorCallback:function(){$('#load-more a').replaceWith('No more news articles to load');$('#infscr-loading').animate({opacity:.8},2000).fadeOut('normal');}},function(newElements){$('#clubhouse-section2 article').each(function(){$(this).removeClass('added');});$(newElements).each(function(){$(this).addClass('added');$(this).css('visibility','hidden');});Cufon.replace('.cufon-light',{fontFamily:'Stag Light'});$(this).masonry({appendedContent:$(newElements)});$(newElements).each(function(){$(this).hide().css('visibility','visible').fadeIn(500);});animateLoadMore();});$(window).unbind('.infscr');$('#load-more a').click(function(){$(document).trigger('retrieve.infscr');return false;});var timer=setTimeout(function(){$('.height-equal').heightEqual();},200);});
