﻿/*!
 * jQuery UI Touch Punch 0.1.0
 *
 * Copyright 2010, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 *  jquery.ui.widget.js
 *  jquery.ui.mouse.js
 */
(function(c){c.support.touch=typeof Touch==="object";if(!c.support.touch){return;}var f=c.ui.mouse.prototype,g=f._mouseInit,a=f._mouseDown,e=f._mouseUp,b={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};function d(h){var i=h.originalEvent.changedTouches[0];return c.extend(h,{type:b[h.type],which:1,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY});}f._mouseInit=function(){var h=this;h.element.bind("touchstart."+h.widgetName,function(i){return h._mouseDown(d(i));});g.call(h);};f._mouseDown=function(j){var h=this,i=a.call(h,j);h._touchMoveDelegate=function(k){return h._mouseMove(d(k));};h._touchEndDelegate=function(k){return h._mouseUp(d(k));};c(document).bind("touchmove."+h.widgetName,h._touchMoveDelegate).bind("touchend."+h.widgetName,h._touchEndDelegate);return i;};f._mouseUp=function(i){var h=this;c(document).unbind("touchmove."+h.widgetName,h._touchMoveDelegate).unbind("touchend."+h.widgetName,h._touchEndDelegate);return e.call(h,i);};})(jQuery);
/*
 * 	easyAccordion 0.1 - jQuery plugin
 *	 	
 *	written by Andrea Cima Serniotti	
 *
 *	Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
 *	Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 *	Built for jQuery library http://jquery.com
 */(function(jQuery){jQuery.fn.easyAccordion=function(options){var transitionSpeed=50;var timeThru=1;var defaults={slideNum:true,autoStart:false,slideInterval:4000};this.each(function(){var settings=jQuery.extend(defaults,options);jQuery(this).find('dl').addClass('easy-accordion');jQuery.fn.setVariables=function(){dlWidth=968;dlHeight=522;dtWidth=47;spacing=8;dtHeight=dlHeight;slideTotal=4
ddWidth=748;ddHeight=dlHeight;};jQuery(this).setVariables();jQuery(this).find('dt').each(function(){jQuery(this).css({'width':dtWidth,'height':dtHeight});});if(jQuery(this).find('.active').size()){jQuery(this).find('.active').next('dd').addClass('active');}else{jQuery(this).find('dt:first').addClass('active').next('dd').addClass('active');}
jQuery(this).find('dt:first').css({'left':'0'}).next('dd').css({'left':dtWidth+spacing});jQuery(this).find('dd').css({'width':ddWidth,'height':ddHeight});function findActiveSlide(){var activeID;var noMoreActiveID;var i=1;jQuery('dl.easy-accordion').find('dt').each(function(){if(jQuery(this).hasClass('active')){activeID=i;}else if(jQuery(this).hasClass('no-more-active')){noMoreActiveID=i;}
i++;});var ids={activeID:activeID,noMoreActiveID:noMoreActiveID}
return ids;};function calculateSlidePos(activeID,noMoreActiveID){if(timeThru!==1)transitionSpeed=350;var u=2;jQuery('dl.easy-accordion').find('dt').not(':first').each(function(){var activeDtPos=(dtWidth+spacing)*activeID;if(u<=activeID){var leftDtPos=(dtWidth+spacing)*(u-1);jQuery(this).animate({'left':leftDtPos},transitionSpeed);if(u<activeID){jQuery(this).next('dd').css({'left':leftDtPos+dtWidth},transitionSpeed);}else{jQuery(this).next('dd').animate({'left':activeDtPos},transitionSpeed);}}else{var rightDtPos=dlWidth-((dtWidth+spacing)*(slideTotal-u+1));jQuery(this).animate({'left':rightDtPos},transitionSpeed);var rightDdPos=rightDtPos+dtWidth;jQuery(this).next('dd').animate({'left':rightDdPos},transitionSpeed);}
u++;});setTimeout(function(){jQuery('dl.easy-accordion').find('dd').not('.active').each(function(){jQuery(this).css({'visibility':'hidden'});});},350);timeThru++;};jQuery.fn.activateSlide=function(){jQuery('dl.easy-accordion').find('dd').css({'visibility':'visible'});jQuery('dl.easy-accordion').find('dd.plus').removeClass('plus');jQuery('dl.easy-accordion').find('.no-more-active').removeClass('no-more-active');jQuery('dl.easy-accordion').find('.active').removeClass('active').addClass('no-more-active');this.addClass('active').next('dd').addClass('active');var ids=findActiveSlide();var activeID=ids.activeID;var noMoreActiveID=ids.noMoreActiveID;if(activeID<noMoreActiveID){this.parent('dl').find('dd.no-more-active').addClass('plus');}
calculateSlidePos(activeID,noMoreActiveID);};jQuery.fn.clear=function(){clearTimeout(timerInstance.value);}
function trackerObject(){this.value=null}
var timerInstance=new trackerObject();findActiveSlide();calculateSlidePos();if(!(jQuery.browser.msie&&jQuery.browser.version==6.0)){jQuery('dt').hover(function(){jQuery(this).addClass('hover');},function(){jQuery(this).removeClass('hover');});}});};})(jQuery);/*
 * jQuery hashchange event - v1.3 - 7/21/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
/**
 * jQuery Reel
 * ===========
 * 360° projection plugin for jQuery
 *
 * @license Copyright (c) 2009-2010 Petr Vostrel (http://petr.vostrel.cz/)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * jQuery Reel
 * http://jquery.vostrel.cz/reel
 * Version: 1.1
 * Updated: 2010-11-27
 *
 * Requires jQuery 1.4.2 or higher
 */
jQuery.reel||(function($,window,document,undefined){$.reel={version:'1.1',def:{footage:6,frame:1,frames:36,hint:'',horizontal:true,hotspot:undefined,indicator:0,klass:'',loops:true,reversed:undefined,spacing:0,stitched:undefined,suffix:'-reel',tooltip:'',area:undefined,brake:0.5,clickfree:false,cw:false,delay:-1,directional:false,draggable:true,entry:undefined,graph:undefined,image:undefined,images:[],inversed:false,laziness:8,monitor:undefined,opening:0,orbital:0,path:'',preloader:4,rebound:0.5,revolution:undefined,row:1,rows:0,speed:0,step:undefined,steps:undefined,tempo:36,timeout:2,throwable:true,vertical:false,wheelable:true}}
$.fn.reel=function(options){var
opt=$.extend({},$.reel.def,options),applicable=(function(tags){var
pass=[]
tags.filter(_img_).each(function(ix){var
$this=$(this),src=opt.images.length&&opt.images||opt.image||$this.attr(_src_),width=number($this.css(_width_)),height=number($this.css(_height_))
if(!src||src==__||!width||!height)return;pass.push($this);});tags.filter(_div_+dot(klass)).each(function(ix){pass.push($(this));});return $(pass);})(this),instances=[],tempo=opt.tempo=opt.tempo/(lazy?opt.laziness:1),ticker_timeout=1000/tempo
opt.reversed&&(opt.cw=true);opt.tooltip&&(opt.hint=opt.tooltip);opt.hotspot&&(opt.area=opt.hotspot);ticker=ticker||(function tick(){pool.trigger(_tick_);return setTimeout(tick,ticker_timeout);})();applicable.each(function(){var
t=$(this),set=function(name,value){t.data(name,value);t.trigger('store',[name,value]);return value;},get=function(name){var
value=t.data(name)
t.trigger('recall',[name,value]);return value;},on={setup:function(e){if(t.hasClass(klass))return cleanup.call(e);var
src=t.attr(_src_),id=t.attr(_id_),styles=t.attr('style'),images=opt.images,stitched=opt.stitched,loops=opt.loops,size={x:number(t.css(_width_)),y:number(t.css(_height_))},frames=set(_frames_,opt.orbital&&opt.footage||opt.rows<=1&&images.length||opt.frames),rows=stitched?1:ceil(frames/opt.footage),style={display:'block',width:size.x,height:size.y},stage_id='#'+id+opt.suffix,classes=t.attr('className'),overlay_css={position:'relative',width:size.x,height:size.y},$overlay=$(_div_tag_,{id:stage_id.substr(1),className:classes+___+overlay_klass,css:overlay_css}),$instance=t.wrap($overlay).attr({className:klass}).css(style).bind(on),instances_count=instances.push($instance[0])
set(_image_,images.length&&images.length||opt.image||src.replace(/^(.*)\.(jpg|jpeg|png|gif)$/,'$1'+opt.suffix+'.$2'));set(_classes_,classes);set(_frame_,opt.frame);set(_spacing_,opt.spacing);set(_dimensions_,size);set(_fraction_,0);set(_steps_,opt.steps||opt.frames);set(_revolution_,opt.revolution||stitched/2||size.x*2);set(_rows_,rows);set(_bit_,1/(frames-(loops&&!stitched?0:1)));set(_wheel_step_,1/max(frames,get(_steps_)));set(_stitched_,stitched);set(_stitched_travel_,stitched-(loops?0:size.x));set(_stage_,stage_id);set(_backwards_,set(_speed_,opt.speed)<0);set(_velocity_,0);set(_vertical_,opt.vertical);set(_row_,(opt.row-1)/(opt.rows-1));set(_cwish_,negative_when(1,!opt.cw&&!stitched));set(_backup_,{src:src,style:styles||__});ticker&&pool.bind(_tick_,on.tick);cleanup.call(e);t.trigger('start');},teardown:function(e){t.unbind(ns).unbind(on);var
events=t.data('events'),$original=t.clone().attr(t.data(_backup_)).removeClass(klass).addClass(get(_classes_));for(var type in events)$.each(events[type],function(ix,handler){$original.bind(type+'.'+handler.namespace,handler.handler,handler.data);});$('img:hidden',t.parent()).remove();$(get(_stage_)).before($original).detach();no_bias();pool.unbind(_mouseup_).unbind(_mousemove_).unbind(_tick_,on.tick).unbind(_tick_,on.opening_tick);cleanup.call(e);},start:function(e){var
space=get(_dimensions_),frames=get(_frames_),resolution=max(frames,get(_steps_)),fraction=set(_fraction_,1/resolution*((opt.step||opt.frame)-1)),frame=set(_frame_,fraction*frames+1),loaded=0,id=t.attr('id'),$overlay=t.parent(),$hi=$(_div_tag_,{className:hi_klass,css:{position:_absolute_,left:0,top:0,width:space.x,height:space.y,background:_hex_black_,opacity:0}}).appendTo($overlay),area=set(_area_,$(opt.area||$hi))
if(touchy){t.css({WebkitUserSelect:'none',WebkitBackgroundSize:opt.images.length?'auto':(get(_stitched_)&&get(_stitched_)+'px '+space.y+'px')||(space.x*opt.footage)+'px '+(space.y*get(_rows_)*(opt.rows||1)*(opt.directional?2:1))+'px'});area.bind(_touchstart_,function(e){$('div#featureCallout p.pointer').hide();t.trigger('down',[finger(e).clientX,finger(e).clientY,true]);return false}).bind(_touchmove_,function(e){t.trigger('slide',[finger(e).clientX,finger(e).clientY,true]);return false}).bind(_touchend_,function(e){t.trigger('up',[true]);return false}).bind(_touchcancel_,function(e){t.trigger('up',[true]);return false})}else{area.css({cursor:'url('+drag_cursor+'), '+failsafe_cursor}).bind(_mousewheel_,function(e,delta){t.trigger('wheel',[delta]);return false}).bind(_dblclick_,function(e){t.trigger('play')}).bind(opt.clickfree?_mouseenter_:_mousedown_,function(e){$('div#featureCallout p.pointer').hide();t.trigger('down',[e.clientX,e.clientY]);return false}).bind(opt.clickfree?_mouseleave_:'',function(e){t.trigger('up');return false}).disableTextSelect();}
(opt.hint)&&area.attr(_title_,opt.hint);opt.monitor&&$overlay.append($monitor=$(_div_tag_,{className:monitor_klass,css:{position:_absolute_,left:0,top:0}}))||($monitor=$());opt.indicator&&$overlay.append(indicator('x'));opt.rows>1&&opt.indicator&&$overlay.append(indicator('y'));t.trigger('preload');},preload:function(e){var
space=get(_dimensions_),$overlay=t.parent(),image=get(_image_),images=opt.images,preload=!images.length?[image]:new Array().concat(images),img_tag=t[0],img_frames=img_tag.frames=preload.length,img_preloaded=img_tag.preloaded=0
t.trigger('stop');$overlay.append($preloader=$(_div_tag_,{className:preloader_klass,css:{position:_absolute_,left:0,top:space.y-opt.preloader,height:opt.preloader,background:_hex_black_}}));while(preload.length){var
url=opt.path+preload.shift(),$img=$(new Image()).bind('load'+ns,function update_preloader(){img_tag.preloaded++
$(this).unbind(ns);$preloader.css({width:1/img_tag.frames*img_tag.preloaded*space.x})
if(img_tag.frames==img_tag.preloaded){$preloader.remove();var timer = setTimeout(function(){$('p.pointer').fadeIn(400);},600);t.trigger(opt.rows>1&&!opt.stitched?'rowChange':'frameChange');t.attr({src:transparent}).trigger('loaded');t.trigger('opening');cleanup.call(e);}});$overlay.append($img.hide().attr({src:url}));}},tick:function(e){var
velocity=get(_velocity_)
if(breaking)var
breaked=lofi(velocity-(tick_brake*breaking)),done=velocity*breaked<=0||velocity<abs(breaked),velocity=!done&&set(_velocity_,velocity>abs(get(_speed_))?breaked:(breaking=operated=0))
$monitor.text(get(opt.monitor));velocity&&breaking++;operated&&operated++;to_bias(0);slidable=true;if(operated&&!velocity)return cleanup.call(e);if(get(_clicked_))return cleanup.call(e,unidle());var
backwards=get(_cwish_)*negative_when(1,get(_backwards_)),step=(get(_stopped_)?velocity:abs(get(_speed_))+velocity)/opt.tempo,was=get(_fraction_),fraction=set(_fraction_,was-step*backwards)
cleanup.call(e);if(fraction==was)return;t.trigger('fractionChange');},opening:function(e){var
speed=opt.entry||opt.speed,end=get(_fraction_),duration=opt.opening,start=set(_fraction_,end-speed*opt.opening),ticks=set(_opening_ticks_,duration*tempo)
pool.bind(_tick_,on.opening_tick);},opening_tick:function(e){var
speed=opt.entry||opt.speed,step=speed/opt.tempo*(opt.cw?-1:1),was=get(_fraction_),fraction=set(_fraction_,lofi(was+step)),ticks=set(_opening_ticks_,get(_opening_ticks_)-1)
t.trigger('fractionChange');cleanup.call(e);if(ticks>1)return;pool.unbind(_tick_,on.opening_tick);delay_play();},play:function(e,direction){var
playing=set(_playing_,true),stopped=set(_stopped_,!playing)
idle();cleanup.call(e);},pause:function(e){var
playing=set(_playing_,false)
unidle();cleanup.call(e);},stop:function(e){var
stopped=set(_stopped_,true),playing=set(_playing_,!stopped)
cleanup.call(e);},down:function(e,x,y,touched){if(opt.draggable){var
clicked=set(_clicked_,true),velocity=set(_velocity_,0),origin=last=recenter_mouse(x,y,get(_fraction_),get(_revolution_),get(_row_))
unidle();no_bias();if(!touched){pool.css({cursor:url(drag_cursor_down)+', '+failsafe_cursor}).bind(_mousemove_,function(e){$('div#featureCallout p.pointer').hide();t.trigger('slide',[e.clientX,e.clientY]);cleanup.call(e);return false})
opt.clickfree||pool.bind(_mouseup_,function(e){t.trigger('up');cleanup.call(e)})}}
cleanup.call(e);},up:function(e,touched){if(!opt.draggable)return cleanup.call(e);var
clicked=set(_clicked_,false),velocity=set(_velocity_,!opt.throwable?0:abs(bias[0]+bias[1])/60),breaks=breaking=velocity?1:0
velocity?idle():unidle();no_bias();!touched&&pool.unbind(_mouseup_).unbind(_mousemove_)&&get(_area_).css({cursor:url(drag_cursor)+', '+failsafe_cursor});cleanup.call(e);},slide:function(e,x,y,touched){if(opt.draggable&&slidable){slidable=false;unidle();var
delta={x:x-last.x,y:y-last.y}
if(abs(delta.x)>0||abs(delta.y)>0){last={x:x,y:y};var
revolution=get(_revolution_),origin=get(_clicked_location_),vertical=get(_vertical_),fraction=set(_fraction_,graph(vertical?y-origin.y:x-origin.x,get(_clicked_on_),revolution,get(_lo_),get(_hi_),get(_cwish_))),motion=to_bias(vertical?delta.y:delta.x||0),backwards=motion&&set(_backwards_,motion<0)
if(opt.orbital)var
orbital=opt.orbital,footage=opt.footage,frame=get(_frame_)
if(opt.orbital&&(frame<=orbital||frame>=footage-orbital+2&&frame<=footage+orbital-1||frame==2*footage-orbital+2))var
vertical=set(_vertical_,abs(y-origin.y)>abs(x-origin.x)),origin=recenter_mouse(x,y,fraction,revolution,get(_row_))
if(opt.rows>1)var
space_y=get(_dimensions_).y,start=get(_clicked_row_),lo=-start*space_y,row=set(_row_,lofi($.reel.math.envelope(y-origin.y,start,space_y,lo,lo+space_y,-1)))
var
origin=!(fraction%1)&&!opt.loops&&recenter_mouse(x,y,fraction,revolution,get(_row_))
t.trigger('fractionChange');}}
cleanup.call(e);},wheel:function(e,distance){if(!opt.wheelable)return cleanup.call(e);var
delta=ceil(sqrt(abs(distance))/2),delta=negative_when(delta,distance>0),revolution=0.2*get(_revolution_),origin=recenter_mouse(undefined,undefined,get(_fraction_),revolution,get(_row_)),fraction=set(_fraction_,graph(delta,get(_clicked_on_),revolution,get(_lo_),get(_hi_),get(_cwish_))),backwards=delta&&set(_backwards_,delta<0),velocity=set(_velocity_,0)
unidle();cleanup.call(e);t.trigger('fractionChange');return false;},fractionChange:function(e,fraction){var
fraction=!fraction?get(_fraction_):set(_fraction_,fraction),fraction=opt.loops?fraction-floor(fraction):min_max(0,1,fraction),fraction=set(_fraction_,lofi(fraction)),was=get(_frame_),frame=set(_frame_,1+floor(fraction/get(_bit_)))
if(!opt.loops&&opt.rebound)var
edgy=!operated&&!(fraction%1)?on_edge++:(on_edge=0),bounce=on_edge>=opt.rebound*1000/opt.tempo,backwards=bounce&&set(_backwards_,!get(_backwards_))
var
space=get(_dimensions_),travel=(get(_vertical_)?space.y:space.x)-opt.indicator,indicator=min_max(0,travel,round($.reel.math.interpolate(fraction,-1,travel+2))),indicator=!opt.cw||opt.stitched?indicator:travel-indicator,$indicator=$(dot(indicator_klass+'.x'),get(_stage_)).css(get(_vertical_)?{left:0,top:indicator}:{left:indicator,top:space.y-opt.indicator});if(opt.rows>1)var
ytravel=get(_dimensions_).y-opt.indicator,yindicator=min_max(0,ytravel,round($.reel.math.interpolate(get(_row_),-1,ytravel+2))),$yindicator=$(dot(indicator_klass+'.y'),get(_stage_)).css({top:yindicator})
if(frame==was)return cleanup.call(e);t.trigger(opt.rows>1?'rowChange':'frameChange');cleanup.call(e);},rowChange:function(e,row){var
frame=floor(get(_fraction_)/get(_bit_))+1,row=set(_row_,min_max(0,1,lofi(row!=undefined?(row-1)/(opt.rows-1):get(_row_)))),frame=set(_frame_,frame+(opt.rows<=1?0:round(row*(opt.rows-1))*opt.frames))
cleanup.call(e);t.trigger('frameChange');},frameChange:function(e,frame){var
fraction=!frame?get(_fraction_):set(_fraction_,lofi(get(_bit_)*(frame-1))),frame=set(_frame_,round(frame?frame:get(_frame_))),images=opt.images,footage=opt.footage,space=get(_dimensions_),horizontal=opt.horizontal
if(get(_vertical_))var
frame=opt.inversed?footage+1-frame:frame,frame=frame+footage
if(images.length){var
sprite=images[frame-1]
t.attr({src:opt.path+sprite})}else{if(!opt.stitched)var
minor=(frame%footage)-1,minor=minor<0?footage-1:minor,major=floor((frame-0.1)/footage),major=major+(opt.rows>1?0:(get(_backwards_)?0:get(_rows_))),spacing=get(_spacing_),a=major*((horizontal?space.y:space.x)+spacing),b=minor*((horizontal?space.x:space.y)+spacing),shift=images.length?[0,0]:horizontal?[-b+_px_,-a+_px_]:[-a+_px_,-b+_px_]
else var
x=round(fraction*get(_stitched_travel_)),y=0,shift=[-x+_px_,y+_px_]
var
sprite=get(_image_)
t.css({background:url(opt.path+sprite)+___+shift.join(___)});}
cleanup.call(e);}},cleanup=function(pass){ie||delete this;return pass},operated,breaking=0,idle=function(){return operated=0},unidle=function(){clearTimeout(delay);pool.unbind(_tick_,on.opening_tick);t.trigger('play');return operated=-opt.timeout*opt.tempo},delay,delay_play=function(){delay=setTimeout(function play(){t.trigger('play');},opt.delay*1000||0);},$monitor,$preloader,indicator=function(axis){return $(_div_tag_,{className:[indicator_klass,axis].join(___),css:{width:opt.indicator,height:opt.indicator,top:get(_dimensions_).y-opt.indicator,left:0,position:_absolute_,background:_hex_black_}})},on_edge=0,last={x:0,y:0},to_bias=function(value){return bias.push(value)&&bias.shift()&&value},no_bias=function(){return bias=[0,0]},bias=no_bias(),tick_brake=opt.brake/opt.tempo,graph=opt.graph||$.reel.math[opt.loops?'hatch':'envelope'],recenter_mouse=function(x,y,fraction,revolution,row){set(_clicked_on_,fraction);set(_clicked_row_,row);set(_lo_,opt.loops?0:-fraction*revolution);set(_hi_,opt.loops?revolution:revolution-fraction*revolution);return x&&set(_clicked_location_,{x:x,y:y})||undefined}
on.setup();});return $(instances);}
$.reel.math={envelope:function(x,start,revolution,lo,hi,cwness){return start+max(lo,min(hi,-x*cwness))/revolution},hatch:function(x,start,revolution,lo,hi,cwness){var
x=(x<lo?hi:0)+x%hi,fraction=start+(-x*cwness)/revolution
return fraction-floor(fraction)},interpolate:function(fraction,lo,hi){return lo+fraction*(hi-lo)}}
double_for('mousewheel disableTextSelect enableTextSelect'.split(/ /));var
pool=$(document),agent=navigator.userAgent,touchy=(/iphone|ipod|ipad|android/i).test(agent),lazy=(/iphone|ipod|ipad/i).test(agent),ie=$.browser.msie,failsafe_cursor='ew-resize',ticker,klass='jquery-reel',overlay_klass=klass+'-overlay',indicator_klass=klass+'-indicator',preloader_klass=klass+'-preloader',monitor_klass=klass+'-monitor',hi_klass=klass+'-interface',transparent='data:image/gif;base64,R0lGODlhCAAIAIAAAAAAAAAAACH5BAEAAAAALAAAAAAIAAgAAAIHhI+py+1dAAA7',drag_cursor='data:image/gif;base64,R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAQAI3lC8AeBDvgosQxQtne7yvLWGStVBelXBKqDJpNzLKq3xWBlU2nUs4C/O8cCvU0EfZGUwt19FYAAA7',drag_cursor_down='data:image/gif;base64,R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAQAIslI95EB3MHECxNjBVdE/5b2zcRV1QBabqhwltq41St4hj5konmVioZ6OtEgUAOw==',round=Math.round,floor=Math.floor,ceil=Math.ceil,min=Math.min,max=Math.max,abs=Math.abs,sqrt=Math.sqrt,number=parseInt,_area_='area',_backup_='backup',_backwards_='backwards',_bit_='bit',_classes_='classes',_clicked_='clicked',_clicked_location_='clicked_location',_clicked_on_='clicked_on',_clicked_row_='clicked_row',_cwish_='cwish',_dimensions_='dimensions',_fraction_='fraction',_frame_='frame',_frames_='frames',_hi_='hi',_image_='image',_opening_ticks_='opening_ticks',_lo_='lo',_playing_='playing',_revolution_='revolution',_row_='row',_rows_='rows',_spacing_='spacing',_speed_='speed',_stage_='stage',_steps_='steps',_stitched_='stitched',_stitched_travel_='stitched_travel',_stopped_='stopped',_velocity_='velocity',_vertical_='vertical',_wheel_step_='wheel_step',ns='.reel',_dblclick_='dblclick'+ns,_mousedown_='mousedown'+ns,_mouseenter_='mouseenter'+ns,_mouseleave_='mouseleave'+ns,_mousemove_='mousemove'+ns,_mouseup_='mouseup'+ns,_mousewheel_='mousewheel'+ns,_tick_='tick'+ns,_touchcancel_='touchcancel'+ns,_touchend_='touchend'+ns,_touchstart_='touchstart'+ns,_touchmove_='touchmove'+ns,__='',___=' ',_absolute_='absolute',_div_='div',_div_tag_=tag(_div_),_height_='height',_hex_black_='url("images/loading.gif") no-repeat',_id_='id',_img_='img',_px_='px',_src_='src',_title_='title',_width_='width'
function tag(string){return'<'+string+'/>'}
function dot(string){return'.'+string}
function url(location){return'url('+location+')'}
function lofi(number){return+number.toFixed(4)}
function min_max(minimum,maximum,number){return max(minimum,min(maximum,number))}
function double_for(methods){$.each(methods,pretend);function pretend(){if(!$.fn[this])$.fn[this]=function(){return this}}}
function negative_when(value,condition){return abs(value)*(condition?-1:1)}
function finger(e){return e.originalEvent.touches[0]}})(jQuery,window,document);
/*******************************************************************************
*
*
* Timberland PRO plugin
*
*
*********************************************************************************/
(function($){$.fn.pro=function(){autoSizePosition();$(window).resize(function(){autoSizePosition()});$('#accordion').easyAccordion({autoStart:false,slideNum:false});var accordionLoaded=true;$('div.mainAreaDiv').click(function(){location.hash=$(this).attr('id');$(window).reload;});$('dt').click(function(){var className=$(this).attr('class');var classArray=className.split(' ');var hash=classArray[0];location.hash=hash;window.reload;});$(function(){$(window).hashchange();})
$(function(){if(location.hash=='')location.hash='#home';})
var IE=$.browser.msie;var IE7=false;if(IE&&$.browser.version==7.0)IE7=true;var currentlyHome=false;var currentlyInAccordion=false;var alreadyShowedAccordion=false;var currentlyOtherPage=false;var sectionLoadCheck={about:false,timeline:false,contact:false,whereToBuy:false,fiveStarLearn:false,fiveStarLearnThankYou:false,industrial:false,industrialendurance:false,industrialhelix:false,industrialwomen:false,renova:false,renovacaregiver:false,valor:false,fiveStar:false}
$('#featureClickArea p').live('click',function(){var temp=$(this).attr('class');var order=$('#featureClickArea p').index(this);order++;var currentClass=temp.split(' ');var feature={section:currentClass[1],height:currentClass[2]*1,width:currentClass[3]*1,frame:currentClass[4]*1}
changeFeature(order,feature.height,feature.width);pointerMove(feature.frame,feature.section);});function showAccordion(delay,section){$('#accordion').addClass('visible');currentlyInAccordion=true;var timer=setTimeout(function(){if(delay==null)delay=0;$('#accordion').show();$('a.proLogo').css('background-position','bottom');changeSection(section);alreadyShowedAccordion=true;clearTimeout(timer);},delay);}
function hideAccordion(){$('#accordion div.'+prevSection).remove();$('#accordion').hide();currentlyInAccordion=false;$('#accordion').removeClass('visible');}
function showInitialPage(delay){document.title='Timberland PRO®';if(delay==null)delay=0;currentlyHome=true;var timer=setTimeout(function(){$('#initialPage').css({opacity:'0',display:'block'});$('#subMainArea').css({opacity:'0',display:'block'});$('#initialPage').animate({'opacity':'1'},500);$('#subMainArea').animate({'opacity':'1'},500);$('a.proLogo').css('background-position','top');clearTimeout(timer);},delay);}
function hideInitialPage(){$('#subMainArea').fadeOut(300);$('#initialPage').fadeOut(300);currentlyHome=false;}
function loadPage(section){var page=$('<div id="'+section+'" class="otherPage roundCorners">').load('ajaxIncludes/'+section+'.html');$('#wrapper').append(page);makeSectionTrue(section);}
function showPage(section){currentlyOtherPage=true;$('a.proLogo').css('background-position','top');var timer=setTimeout(function(){$('#'+section).fadeIn(400);},500)}
function hideCurrentPage(){if(currentlyHome)hideInitialPage();else if(currentlyInAccordion)hideAccordion();else if(currentlyOtherPage){$('div.otherPage').hide();currentlyOtherPage=false;}}
var arrayObject={industrial:[],industrialendurance:[],industrialhelix:[],industrialwomen:[],renova:[],valor:[],fiveStar:[],renovacaregiver:[]};var totalFrames=24;var currentFrame=1;var currentShoeName="";var firstTime={industrial:true,industrialendurance:true,industrialhelix:true,industrialwomen:true,renova:true,valor:true,fiveStar:true,renovacaregiver:true}
function loadSpinner(containerSection,subSection){currentShoeName=subSection;if(typeof arrayObject[subSection][0]==='undefined'||arrayObject[subSection][0]===''){for(var x=1;x<=totalFrames;x++){arrayObject[subSection].push("shoeImages/"+containerSection+"/"+subSection+"/pro_"+x+".png");}}
currentShoeName=subSection;}
function changeFeature(currentClass,height,width){$('#featureClickArea p').css('background-position','bottom left');$('#featureClickArea p:eq('+--currentClass+')').css('background-position','top left');$('#featureCallout div.active').removeClass('active').addClass('notActive');$('#featureCallout div:eq('+currentClass+')').removeClass('notActive').addClass('active');$('p.pointer').hide();$('p.pointer').css('margin-top',height);$('p.pointer').css('width',width);var marginLeft=width+9;marginLeft='-'+marginLeft;marginLeft=parseInt(marginLeft);$('p.pointer').css('margin-left',marginLeft);}
function resetFeatureCallout(){$('#featureCallout > div').addClass('notActive').removeClass('active');$('#featureCallout div:eq(0)').removeClass('notActive').addClass('active');}
function pointerMove(endFrame,section,openingSpeed){if(openingSpeed==null)openingSpeed=.25;$('div.'+section+' div.imageContainer').empty();var size=450;if(IE7){$('div.'+section+' div.imageContainer').append('<img id="'+section+'" class="image"  src="http://timberlandpro.com/images/transparency.png" width="'+size+'" height="'+size+'" alt="Timberland PRO&reg;'+section+'" />');}
else $('div.'+section+' div.imageContainer').append('<img id="'+section+'" class="image"  src="images/transparency.png" width="'+size+'" height="'+size+'" alt="Timberland PRO&reg;'+section+'" />');$('img#'+section).fadeIn(500);if(firstTime[section])$('img#'+section).reel({images:arrayObject[section],frames:totalFrames,wheelable:false,cw:true,preloader:19,opening:openingSpeed,entry:6,frame:endFrame-3});else $('img#'+section).reel({images:arrayObject[section],frames:totalFrames,wheelable:false,cw:true,preloader:19,opening:openingSpeed,entry:6,frame:endFrame-3});currentFrame=endFrame-3;var t=setTimeout(function(){firstTime[section]=false;},800);}
function loadSection(containerSection,subSection){$('<div class="'+subSection+'">').load('ajaxIncludes/'+subSection+'.html',function(){loadSpinner(containerSection,subSection);$('#'+containerSection+'Container').append($(this));var timer=setTimeout(function(){$('.featureContent').fadeIn(500);var t=setTimeout(function(){$('#featureClickArea p:eq(0)').trigger('click');},50);stButtons.locateElements();},1000);});}
function changeSection(section){if(currentlyInAccordion&&accordionLoaded){$('#'+section+'Container > div').hide();$('#'+section+'Container div.'+section).show();$('dt#accordion'+section).activateSlide();resetFeatureCallout();}
else if(!currentlyInAccordion&&accordionLoaded){hideCurrentPage();showAccordion(500,section);}
else{$('dt#accordion'+section).addClass('active');hideCurrentPage();showAccordion(500);}}
function makeSectionTrue(section){switch(section){case'industrial':sectionLoadCheck.industrial=true;break;case'valor':sectionLoadCheck.valor=true;break;case'renova':sectionLoadCheck.renova=true;break;case'fiveStar':sectionLoadCheck.fiveStar=true;break;case'industrialendurance':sectionLoadCheck.industrialendurance=true;break;case'industrialhelix':sectionLoadCheck.industrialhelix=true;break;case'industrialwomen':sectionLoadCheck.industrialwomen=true;break;case'renovacaregiver':sectionLoadCheck.renovacaregiver=true;break;case'about':sectionLoadCheck.about=true;break;case'timeline':sectionLoadCheck.timeline=true;break;case'contact':sectionLoadCheck.contact=true;break;case'whereToBuy':sectionLoadCheck.whereToBuy=true;break;case'fiveStarLearn':sectionLoadCheck.fiveStarLearn=true;break;}}
function sectionToggle(containerSection,subSection){$('div.'+subSection).show();}
function reloadSection(section){location.hash=section;changeSection(section);}
function hashSubSectionToggle(subSection,parentSection){if(prevSection!=='')$('#accordion div.'+prevSection).remove();loadSection(parentSection,subSection);if((prevSection.indexOf(parentSection)!==-1)&&(subSection.indexOf(parentSection)!==-1)){sectionToggle(parentSection,subSection);}else{changeSection(parentSection);sectionToggle(parentSection,subSection);}
var parentSectionTitle=capitaliseFirstLetter(parentSection);if(parentSection==='renova')var subSectionTitle=subSection.slice(6,subSection.length);parentSectionTitle='Renova™';if(parentSection==='industrial')var subSectionTitle=subSection.slice(10,subSection.length);parentSectionTitle='Industrial';subSectionTitle=capitaliseFirstLetter(subSectionTitle);document.title='Timberland PRO® :: '+parentSectionTitle+' - '+subSectionTitle;}
function hashSectionChange(section,prevSection){if(prevSection!=='')$('#accordion div.'+prevSection).remove();loadSection(section,section);changeSection(section);}
function capitaliseFirstLetter(string){return string.charAt(0).toUpperCase()+string.slice(1);}
function autoSizePosition(){var currentWindowHeight=$(window).height();if(currentWindowHeight<660||IE){$('#wrapper').css('top','51px');$('#globalFooter').addClass('footerAbsolute');}
else{var top=(($(window).height()-61)-522)/2;$('#wrapper').css('top',top);$('#globalFooter').removeClass('footerAbsolute');}}
var prevSection="";$(window).hashchange(function(){var hash=location.hash;var hashSection=hash.replace(/^#/,'');if(hash=='#home'){hideCurrentPage();showInitialPage(250);}
if(hash=='#industrial'){if(prevSection=='industrialwomen'||prevSection=='industrialhelix'||prevSection=='industrialendurance'){hashSubSectionToggle('industrial','industrial');}
else{hashSectionChange('industrial',prevSection);}
document.title='Timberland PRO® :: Industrial - Workboots';}
if(hash=='#renova'){if(prevSection=='renovacaregiver'){hashSubSectionToggle('renova','renova');}
else{hashSectionChange('renova',prevSection);}
document.title='Timberland PRO® :: Renova™ - Professional';}
if(hash=='#valor'){hashSectionChange('valor',prevSection);document.title='Timberland PRO® :: Valor™ - Duty';}
if(hash=='#fiveStar'){hashSectionChange('fiveStar',prevSection);document.title='Timberland PRO® :: Five Star - Hospitality';}
if(hash=='#industrialendurance'){if(prevSection==''){location.hash='industrial';/*window.location.reload();*/window.reload();}else hashSubSectionToggle('industrialendurance','industrial');}
if(hash=='#industrialhelix'){if(prevSection==''){location.hash='industrial';/*window.location.reload();*/window.reload();}else hashSubSectionToggle('industrialhelix','industrial');}
if(hash=='#industrialwomen'){if(prevSection==''){location.hash='industrial';/*window.location.reload();*/window.reload();}else hashSubSectionToggle('industrialwomen','industrial');}
if(hash=='#renovacaregiver'){if(prevSection==''){location.hash='renova';/*window.location.reload();*/window.reload();}
hashSubSectionToggle('renovacaregiver','renova');}
if(hash=='#about'){hideCurrentPage();if(!sectionLoadCheck.about)loadPage('about');showPage('about');document.title='Timberland PRO® :: About';}
if(hash=='#timeline'){hideCurrentPage();if(!sectionLoadCheck.timeline)loadPage('timeline');showPage('timeline');if(sectionLoadCheck.timeline){$('#timelineWrapper #top p.clickTrigger').trigger('click');$('#slideWrap p.clickTrigger').trigger('click');}
document.title='Timberland PRO® :: Timeline';}
if(hash=='#contact'){hideCurrentPage();if(!sectionLoadCheck.contact)loadPage('contact');showPage('contact');document.title='Timberland PRO® :: Contact';}
if(hash=='#whereToBuy'){hideCurrentPage();if(!sectionLoadCheck.whereToBuy)loadPage('whereToBuy');showPage('whereToBuy');document.title='Timberland PRO® :: Where To Buy';}
if(hash=='#fiveStarLearn'){hideCurrentPage();if(!sectionLoadCheck.fiveStarLearn)loadPage('fiveStarLearn');showPage('fiveStarLearn');document.title='Timberland PRO® :: Learn more about Five Star';if(IE)$('#fiveStarLearn').css('filter','progid:DXImageTransform.Microsoft.gradient(startColorstr="#80643d", endColorstr="#3b2607")');}
if(hash=='#fiveStarLearnThankYou'){hideCurrentPage();if(!sectionLoadCheck.fiveStarLearnThankYou)loadPage('fiveStarLearnThankYou');showPage('fiveStarLearnThankYou');document.title='Timberland PRO® :: Learn more about Five Star : Thank You';}
$('ul.nav a').each(function(){var that=$(this);that[that.attr('href')===hash?'addClass':'removeClass']('selected');});if(($('li.endurance a').hasClass('selected'))||($('li.helix a').hasClass('selected'))||($('li.women a').hasClass('selected'))){$('ul.navLeft li.industrial > a').addClass('selected');}
if($('li.caregiver a').hasClass('selected')){$('ul.navLeft li.renova > a').addClass('selected');}
if(hashSection=='industrial'||hashSection=='industrialendurance'||hashSection=='industrialhelix'||hashSection=='industrialwomen'||hashSection=='renova'||hashSection=='renovacaregiver'||hashSection=='valor'||hashSection=='fiveStar'){$('a.proLogo').hover(function(){$(this).css('background-position','top');},function(){$(this).css('background-position','bottom');});}
else{$('a.proLogo').hover(function(){$(this).css('background-position','top');},function(){$(this).css('background-position','top');});}
prevSection=hashSection;})
$('#top p.year').live('click',function(){$('#top p.year').removeClass('activeYear');$(this).addClass('activeYear');var slideWidth=850;var c=$(this).attr('class');var current=c.split(' ');if(current[0]!=='first'){$('p.timelinePointer').hide();var slidePosition=7650-(slideWidth*current[0]);$('#slideWrap').animate({left:slidePosition},1000);var timelinePointerPosition=(current[0]*85)+28;var timer=setTimeout(function(){$('p.timelinePointer').css('left',timelinePointerPosition);$('p.timelinePointer').fadeIn(300);},700);}else{$('p.timelinePointer').hide();$('#slideWrap').animate({left:7650},800);var timer=setTimeout(function(){$('p.timelinePointer').css('left',28);$('p.timelinePointer').fadeIn(300);},700);}});$('#slideWrap').live('mousedown',function(){$('p.timelinePointer').hide();});$('#slideWrap').live('touchstart',function(){$('p.timelinePointer').hide();});$('#slideWrap div.toggleArea').live('mousedown',function(event){event.stopPropagation();});$('#slideWrap div.toggleArea p').live('mousedown',function(){var clicked=$(this).index();clicked--;$(this).parent('div').children('p').css('background-position','left bottom');$(this).css('background-position','left top');$(this).parent('div').next('div').children('div').removeClass('active').hide().addClass('notActive');$(this).parent('div').siblings('div.sectionWrap').children('div:eq('+clicked+')').fadeIn(600).addClass('active');});};})(jQuery);
