/***
 * Widgets and behaviors for the Hero Products pages.
 * @author Adam J. McIntyre -- adam.mcintyre@isobar.net.
 */

if(typeof MOLECULAR==='undefined'){MOLECULAR={};}
(RotatingPromos=function($){var $els;var ROTATE_INTVL=4500;var intvl=null;var idx=0;return{init:function(){var o=this;$(document).ready(function(){$els=$('#rotating_teasers li').fadeOut(0);});},rotatePromos:function(){var o=this;this._animate();$els.parents('#rotating_teasers').bind('mouseenter',function(){clearInterval(intvl);}).bind('mouseleave',function(){o._rotate();});this._rotate();},_rotate:function(){var o=this;intvl=setInterval(function(){o._animate();},ROTATE_INTVL);},_animate:function(){$els.filter($els.filter('.selected').length>0?'.selected':':last').fadeOut('slow',function(){$(this).removeClass('selected')
$els.filter(':eq('+idx+')').fadeIn('slow',function(){idx++;if(idx>$els.length-1){idx=0;}}).addClass('selected');});}}}(jQuery)).init();(PageTransitions=function($){var h3;var HEADER_DURATION=2000;var allItemsIntvl=null;var VISITED_COOKIE='viewed-hero-intro';return{init:function(){var o=this;$(document).ready(function(){if(MOLECULAR.browser.ie6){setTimeout(function(){DD_belatedPNG.fix('#hero_product h2.title');$('#hero_product h2.moved').hide();},100);}
h3=$('#hero_product h3.subtitle').fadeOut();setTimeout(function(){o._animateHeaders();},HEADER_DURATION)
$('.initial_hide').fadeOut(0);allItemsIntvl=setTimeout(function(){o._showAll();},2*HEADER_DURATION);$('#hero_product').one('mouseenter',function(){clearTimeout(allItemsIntvl);o._showAll();});o.initPAN();$('#hero_product a.videoplayer').each(function(){var vidEl=$(this);vidEl.nyroModal({width:vidEl.attr('data-videowidth')||400,height:vidEl.attr('data-videoheight')||300,mediaPlayer:vidEl.attr('data-mediaplayer')||null,videoPreview:vidEl.attr('data-preview')||null,showIcon:vidEl.attr('data-showicon')||false,showIconEnd:vidEl.attr('data-showiconend')||false,showPreviewAtEnd:vidEl.attr('data-showpreviewatend')||false,autoPlay:vidEl.attr('data-autoplay')||false,playText:vidEl.attr('data-playtext')||false,playTextHover:vidEl.attr('data-playtexthover')||false,playTextColor:vidEl.attr('data-playtextcolor')||false,playIconY:vidEl.attr('data-playicony')||false});});});},_animateHeaders:function(){if(MOLECULAR.browser.ie7||MOLECULAR.browser.ie6){$('#hero_product h2.title:not(.moved)').css({filter:'',display:'none'});h3.css('filter','').show().filter('.moved').hide();}
else{$('#hero_product h2.title:not(.moved)').fadeOut('slow',function(){h3.fadeIn('slow').filter('.moved').hide();});}},moveHeaders:function(idx){if(idx==0){this.returnHeaders();}
else if($('#hero_product .moved').length>0&&!MOLECULAR.browser.ie6){$('#hero_product .moved').show();return true;}
else{if(MOLECULAR.browser.ie6){$headers=$('#hero_product .header').hide();setTimeout(function(){$('#hero_product .moved').fadeIn();},1000);}
else{$headers=$('#hero_product .header').fadeOut();setTimeout(function(){$headers.addClass('moved').fadeIn();},1000);}}},returnHeaders:function(){var o=this;$('#hero_product .moved').hide();if(!MOLECULAR.browser.ie6){$('#hero_product .moved').removeClass('moved');}
setTimeout(function(){o._animateHeaders();},1100);},_showAll:function(){$('.initial_hide').fadeIn();$('#hero_product').unbind('mouseenter');if($('#buy_now_promo').hasClass('preorder')){$('#buy_now_promo .bd:first').width($('#buy_now_promo .button_container').get(0).offsetWidth);$('#buy_now_promo, #preorder-flyout').width($('#buy_now_promo .bd:first').get(0).offsetWidth);}
RotatingPromos.rotatePromos();},initPAN:function(){if($('#buyNowWithPanModule').length>0){$('#buy_now > div.button_container, #buy_now > strong').appendTo('#buy_now div.bd');$('#buyNowWithPanModule').wrap('<div id="pan_flyout" class="hidden"><div class="flyout_content gradient constrained no_top"></div></div>');$('#buy_now_promo button').bind('click',this._togglePAN);}
else if($('#buy_now').hasClass('preorder')){$('#buy_now button').bind('click',this._togglePreorder);if(MOLECULAR.browser.ie6){$('#buy_now button h3, #buy_now button hd').bind('click',function(e){e.stopPropagation();this._togglePreorder();});}}
else{$('#buy_now > div.button_container, #buy_now > strong').remove();$box=$('#witb');if($box.length>0){var o=this;$box.get(0).onclick=function(){};$box.bind('click',function(e){o._toggleBox(e);});}}},_togglePreorder:function(e){e.preventDefault();var $self=$(this);if(!$('#preorder-flyout').hasClass('hero_layer')){var $pf=$('#preorder-flyout');$pf.addClass('hero_layer').fadeOut(0).removeClass('hidden').hide();setTimeout(function(){if(MOLECULAR.browser.ie6){$pf.fadeIn('slow',function(){$pf.find('.hero_layer_hd_corner').each(function(){$(this).height($(this).parent().get(0).offsetHeight);})});}
else{$pf.fadeIn('slow');}},550);$('#pan_countrydropdown').bind('change',function(){var val=$(this).val();if(val.length>0){window.location.href=val;}});$pf.find('.hero_layer_hd').bind('click',function(){$(this).parent().fadeOut('slow',function(){$('#buy_now_promo > div:not(.hero_layer)').fadeIn();});});}
else{$('#buy_now_promo div.hero_layer').fadeIn();}
$('#buy_now_promo > div:not(.hero_layer)').fadeOut(0);},_toggleBox:function(e){e.preventDefault();$ar=$('#allresults');if($ar.hasClass('open')){$('#allresults').removeClass('open').addClass('closed').animate({height:0},150);}
else{if(!$ar.hasClass('animated-results')){$ar.addClass('animated-results').wrapInner('<div id="allresults_container"></div>').removeAttr('style');}
$('#allresults').addClass('open').removeClass('closed').animate({height:$('#allresults_container').get(0).offsetHeight},150);}},_togglePAN:function(e){e.preventDefault();var $self=$(this);if($('#buy_now_promo div.hero_layer').length==0){var panApp=$('#pan_flyout');panApp.find('.ppBnPANfieldItem').removeClass('ppBnPANfieldItem').addClass('form_row clearfix');var $bn=$('#buy_now_button button');if($bn.length>0){$('#pan_submit').wrap('<div class="form_row"></div>').replaceWith($('#buy_now_button button'));}
if(typeof ctrlBnDisplay==='function'){if(typeof fixNSButton==='function'){fixNSButton();}
if(typeof fixPrivacyPolicy==='function'){fixPrivacyPolicy();}
if(typeof fixLocalization==='function'){fixLocalization();}}
$('#buyNowWithPanModule').show()
panApp.addClass('hero_layer').prepend('<div class="hero_layer_hd">'+$self.find('h3').html()+'</div>').append('<div class="hero_layer_ft"></div>').find('div.flyout_content').addClass('hero_layer_bd clearfix').end().fadeOut(0).removeClass('hidden').appendTo('#buy_now_promo').fadeIn('slow');var hd=$('#buy_now_promo div.hero_layer div.hero_layer_hd').bind('click',function(){$(this).parent().fadeOut('slow',function(){$('#buy_now_promo > div:not(.hero_layer)').fadeIn();});});$().bind('ajaxComplete',function(e,xhr){if(xhr&&xhr.reponseXML&&$(xhr.responseXML).find('Success').text().indexOf('pan_head')>-1){setTimeout(function(){hd.click();},3000);}});}
else{$('#buy_now_promo div.hero_layer').fadeIn();}
$('#buy_now_promo > div:not(.hero_layer)').fadeOut(0);}}}(jQuery)).init();(ImageManager=function($){var VISIBLE_SHOTS_INDEX=2;var VISIBLE_VIDS_INDEX=1;return{init:function(){var o=this;$(document).ready(function(){$('#product_views li:gt('+VISIBLE_SHOTS_INDEX+')').fadeOut(100);$('#product_views li:eq('+VISIBLE_SHOTS_INDEX+')').addClass('last');o._bindProductViewEvents();o._toggleEmbed();$('#right_promo li:gt('+VISIBLE_VIDS_INDEX+')').fadeOut(100);$('#right_promo li:eq(0)').addClass('first');o._bindVidThumbEvents();var color=window.location.search.match(/[\?&]?color=([^&]+)/);var image=window.location.search.match(/[\?&]?image=([^&]+)/);if((color&&color.length>1)&&(image&&image.length>1)){o._loadHeroImage(color[1],image[1]);}
var vidEl=$('#hero_video');vidEl.nyroModal({width:vidEl.attr('data-videowidth')||400,height:vidEl.attr('data-videoheight')||300,mediaPlayer:vidEl.attr('data-mediaplayer')||null,videoPreview:vidEl.attr('data-preview')||null,showIcon:vidEl.attr('data-showicon')||false,showIconEnd:vidEl.attr('data-showiconend')||false,showPreviewAtEnd:vidEl.attr('data-showpreviewatend')||false,autoPlay:vidEl.attr('data-autoplay')||false,playText:vidEl.attr('data-playtext')||false,playTextHover:vidEl.attr('data-playtexthover')||false,playTextColor:vidEl.attr('data-playtextcolor')||false,playIconY:vidEl.attr('data-playicony')||false});});},_loadHeroImage:function(colorIndex,imageIndex){var $hb=$('#hero_background');MOLECULAR.ProductPage.swapper.showHeroLoading($hb);var $oldColor=$('#color_picker li.on').removeClass('on');var $color=$('#color_picker li:eq('+colorIndex+')').addClass('on');$('#product_shots li.selected').removeClass('selected');var $newImage=$('#product_shots li:eq('+imageIndex+')').addClass('selected');var imgSrc=$newImage.find('a').attr('href').replace(/604x604/g,'755x497');var newSrc=MOLECULAR.ProductPage.picker.getSrc($oldColor.attr('data-swatch'),$oldColor.attr('data-path'),imgSrc,$color.attr('data-swatch'),$color.attr('data-path'));setTimeout(function(){$hb.one('load',function(){MOLECULAR.ProductPage.swapper.hideLoading($hb);$('#hero_link').attr('href',newSrc);if(imageIndex>0){PageTransitions.moveHeaders();}}).attr('src',newSrc);},250);},_bindProductViewEvents:function(){$('#product_shots').bind('mouseenter',function(){$('#product_views li:eq('+VISIBLE_SHOTS_INDEX+')').removeClass('last');$('#product_views').addClass('active').find('div.ft').show().end().find('li:gt('+VISIBLE_SHOTS_INDEX+')').fadeIn('fast');});$('#product_views').bind('mouseleave',function(e){$('#product_views li:eq('+VISIBLE_SHOTS_INDEX+')').addClass('last');$(this).removeClass('active').find('div.ft').hide().end().find('li:gt('+VISIBLE_SHOTS_INDEX+')').fadeOut(100);}).find('div.ft').hide();},_bindVidThumbEvents:function(){$('#right_promo').bind('mouseenter',function(){var $this=$(this);var $hidden=$this.find('li:gt('+VISIBLE_VIDS_INDEX+')');var $first=$this.find('.first');$this.addClass($hidden.length>1?'active double':'active').find('div.extras-layer').width(($first.get(0).offsetWidth*$this.find('li').length)-(2*parseInt($first.css('border-left-width')))).fadeIn('fast').end();$hidden.fadeIn('fast');}).bind('mouseleave',function(e){var $this=$(this);$this.find('div.extras-layer').fadeOut(100).end().find('li:gt('+VISIBLE_VIDS_INDEX+')').fadeOut(100,function(){$this.removeClass('active');});}).find('div.extras-layer').hide().end().find('.youtube-player').nyroModal();},_toggleEmbed:function(){$('#embed_image').bind('click',function(e){e.preventDefault();if($('#embed_layer').hasClass('hidden')){var $ps=$('#product_shots li');var $active=$ps.filter('.selected');var current_shot=$ps.index($ps.filter('.selected'));var $color=$('#color_picker li');var current_color=$color.index($color.filter('.on'));var imageSrc=$active.find('a').attr('href').replace(/604x604/g,'302x302');var $ed=$('#embed_data');$ed.val($ed.attr('data-linktemplate').replace(/\/"/g,'"').replace('{image}',current_shot).replace('{color}',current_color).replace('{src}',imageSrc));$('#embed_layer').find('div.flyout_content').addClass('hero_layer_bd clearfix').end().fadeOut(0).css('left',$ps.parent().parent().position().left+$ps.filter(':eq(3)').position().left).removeClass('hidden').fadeIn('slow',function(){var clip=new ZeroClipboard.Client();clip.setHandCursor(true);clip.setCSSEffects(false);clip.addEventListener('mouseDown',function(){var $ed=$('#embed_data');clip.setText($ed.val());$ed.css('backgroundColor','#FFFFCF').animate({backgroundColor:'#FFF'},600);});clip.addEventListener('complete',function(){clip.destroy();});clip.setText('')
clip.glue('copy');});$('#embed_layer div.hero_layer_hd').bind('click',function(){$('#embed_layer').fadeOut('slow').addClass('hidden');});}
else{$('#embed_layer').fadeOut().addClass('hidden');}});}}}(jQuery)).init();;(MOLECULAR.ContentOverlay=function($){var $ov=null;return{init:function(){var o=this;$(document).ready(function(){if($('#content-overlay').length>0){$('#hero_product h3.subtitle a').bind('click',function(e){o.showOverlay(e);});}});},showOverlay:function(e){e.preventDefault();if(!$ov){var o=this;$ov=$('#content-overlay').prependTo('body').show();$ov.data('content-height',$ov.find('.container').get(0).offsetHeight+$ov.find('.ft').get(0).offsetHeight).find('a.close').bind('click',function(e){e.preventDefault();o.hideOverlay();});if(MOLECULAR.browser.ie6){$ov.addClass('ie6');}}
var pos=$('#hero_product').offset();$ov.show().css({left:pos.left,top:pos.top}).animate({height:$ov.data('content-height')},250,'swing');},hideOverlay:function(){$ov.animate({height:0},250,'swing',function(){$ov.hide();});}}}(jQuery)).init();;(MOLECULAR.Gallery=function($){var $tabs;return{init:function(){var o=this;$(document).ready(function(){if($('#content-gallery').length>0){$('#content-gallery .gallery-panel').fadeOut(0);o._initTabs()._initVideos();}});},_initTabs:function(){$tabs=$('#top-tabs li');var o=this;var max=0;$tabs.bind('mouseenter',function(){o.highlightTab(this);}).bind('mouseleave',function(){o.removeHighlight(this);}).filter(':not(.active)').find('.footer').each(function(){var h=$(this).get(0).offsetHeight;if(h>max){max=h;}}).each(function(){var $el=$(this);if(max>$el.height()){$el.height(max).addClass('fixed-height');}}).end().end().filter('.active').each(function(){$(this).find('.footer').each(function(){o._setHeight(this);})}).end().find('a').bind('click',function(e){e.preventDefault();o.swapTabs(this);if(window.location.href.indexOf('galleryTab')>-1){window.location.href=window.location.href.replace(/galleryTab=([^&#]*)/,'galleryTab='+this.href.substr(this.href.indexOf('#')+1));}
else{window.location.href=window.location.href+'#galleryTab='+this.href.substr(this.href.indexOf('#')+1);}});this._loadDefaultTab();return this;},_loadDefaultTab:function(){var queryString=window.location.href.match(/galleryTab=([^&#]*)/);if(queryString&&queryString.length>1){$tabs.removeClass('active').find('a[href=#'+queryString[1]+']:first').click();}
else{$tabs.filter('.active').find('a').click();}
if(MOLECULAR.browser.ie6){setTimeout(function(){$('#gallery-panels').css('display','none').css('display','block');},550);}},_setHeight:function(el){$el=$(el);var o=this;$el.removeClass('fixed-height').css('height','auto').each(function(){$(this).height(el.offsetHeight).addClass('fixed-height');});},highlightTab:function(el){$this=$(el);var o=this;if($this.hasClass('current-tab')){return false;}
else if(!$this.hasClass('hover')){$this.addClass('hover active').each(function(){$(this).find('.footer').each(function(){o._setHeight(this);});});}},removeHighlight:function(el){$this=$(el);var o=this;if($this.hasClass('current-tab')){return false;}
else if($this.hasClass('hover')){$this.removeClass('hover active').each(function(){$(this).find('.footer').each(function(){o._setHeight(this);});});}},swapTabs:function(el){$this=$(el);var o=this;$tabs.filter('.current-tab').removeClass('active current-tab').each(function(){$(this).find('.footer').each(function(){o._setHeight(this);});});$this.parent().addClass('active current-tab').each(function(){$(this).find('.footer').each(function(){o._setHeight(this);});});var oldPanel=$('#gallery-panels > .active');var newPanel=$('#gallery-'+el.href.substr(el.href.indexOf('#')+1));if(!newPanel.data('height')){newPanel.addClass('offscreen').fadeIn(0);var carousels=newPanel.find('.carousel-widget');if(!(newPanel.attr('id')=='gallery-product-views')&&carousels.length>0&&!(MOLECULAR.browser.ie6&&MOLECULAR.direction)){carousels.removeClass('carousel-widget').each(function(){var $this=$(this);if(MOLECULAR.direction&&MOLECULAR.browser.ie7){$this.find('li').each(function(){$(this).prependTo($(this).parent());});}
$this.addClass('pre-ie-load').jcarousel({visible:parseInt($this.attr('data-visible')),scroll:parseInt($this.attr('data-scroll'))||parseInt($this.attr('data-visible')),size:$this.find('li').length,easing:'swing',start:MOLECULAR.direction?$this.find('li').length:0,initCallback:function(carousel){o._addPaginator($this,carousel);$this.data('carousel',carousel);carousel.scroll();},itemLastInCallback:{onAfterAnimation:function(carousel,li,idx,action){o._updatePaginator($this,idx);}},buttonNextCallback:function(carousel,button,enabled){if(!enabled){$(button).unbind('click');}},buttonPrevCallback:function(carousel,button,enabled){if(!enabled){$(button).unbind('click');}}});newPanel.data('carouselEl',$this);if(MOLECULAR.browser.ie6){$this.data('width',$this.width()+20);}
else if(MOLECULAR.browser.ie7){$this.data('width',$this.width());}});}
else if(newPanel.attr('id')=='gallery-product-views'){newPanel.find('ul.carousel').each(function(){MOLECULAR.ProductPage.init_carousel(this);});}
newPanel.data('height',newPanel.get(0).offsetHeight).hide().removeClass('offscreen');}
if(oldPanel.length>0){$('#content-gallery').removeClass('no-bg product-gallery');oldPanel.removeClass('active').fadeOut(250,function(){if(MOLECULAR.direction&&MOLECULAR.browser.ie6){$('#gallery-panels').css('height','auto');o._setupTab(newPanel);}
else{$('#gallery-panels').animate({height:newPanel.data('height')},450,'swing',function(){o._setupTab(newPanel);});}});}
else{$('#content-gallery').removeClass('no-bg product-gallery');var newPanel=$('#gallery-'+el.href.substr(el.href.indexOf('#')+1));$('#gallery-panels').animate({height:newPanel.data('height')},450,'swing',function(){o._setupTab(newPanel);});}},_setupTab:function(newPanel){var o=this;newPanel.addClass('active');var isLoaded=newPanel.hasClass('loaded');if(newPanel.attr('id')=='gallery-videos'&&!isLoaded){$('#video-list li:first a').click();if(MOLECULAR.browser.ie6){newPanel.find('.reflect').reflect();}
else{newPanel.find('.reflect').fisheyeZoom().reflect();}}
else if(newPanel.attr('id')=='gallery-device-content'&&!isLoaded){if(MOLECULAR.browser.ie6){$('#device-content-list .content').find('a').nyroModal().end().find('img').reflect({height:0.2})}
else{$('#device-content-list .content').find('a').nyroModal().end().find('img').fisheyeZoom().reflect({height:0.2})}}
else if(!isLoaded){newPanel.find('.reflect').reflect();}
newPanel.fadeIn('fast',function(){if(newPanel.hasClass('has-background')){$('#content-gallery').addClass('no-bg');}
else if(newPanel.attr('id')=='gallery-product-views'){$('#content-gallery').addClass('product-gallery');}
newPanel.addClass('loaded');if($.browser.msie){newPanel.get(0).style.removeAttribute('filter');}
if(MOLECULAR.browser.ie6&&MOLECULAR.direction){newPanel.find('.carousel-widget').removeClass('carousel-widget').each(function(){var $this=$(this);$this.find('li').each(function(){$(this).prependTo($(this).parent());});$this.jcarousel({visible:parseInt($this.attr('data-visible')),scroll:parseInt($this.attr('data-scroll'))||parseInt($this.attr('data-visible')),size:$this.find('li').length,easing:'swing',start:0,initCallback:function(carousel){o._addPaginator($this,carousel);$this.data('carousel',carousel);},itemLastInCallback:{onAfterAnimation:function(carousel,li,idx,action){o._updatePaginator($this,idx);}},buttonNextCallback:function(carousel,button,enabled){if(!enabled){$(button).unbind('click');}},buttonPrevCallback:function(carousel,button,enabled){if(!enabled){$(button).unbind('click');}}});newPanel.data('carouselEl',$this);$this.data('width',$this.width()+20);});}
if(newPanel.data('carouselEl')&&(MOLECULAR.browser.ie6||MOLECULAR.browser.ie7)){newPanel.data('carouselEl').width(newPanel.data('carouselEl').data('width')+100);if(MOLECULAR.direction){newPanel.find('ul').data('carousel').scroll(newPanel.find('ul li').length);if(!MOLECULAR.browser.ie6){setTimeout(function(){newPanel.find('ul.jcarousel-list').css('left',0).removeClass('pre-ie6-load');},450);}}}});},_initVideos:function(){var o=this;$('#video-list').find('li').bind('mouseenter',function(){o._highlightVidThumb(this);}).bind('mouseleave',function(){o._removeHighlightVidThumb(this);}).find('a').bind('click',function(e){o.setVideo(e,this);});return this;},_highlightVidThumb:function(el){var $this=$(el);if($this.hasClass('selected')){return false;}
$this.addClass('active');},_removeHighlightVidThumb:function(el){var $this=$(el);if($this.hasClass('selected')){return false;}
$this.removeClass('active');},setVideo:function(e,el){e.preventDefault();var $this=$(el);if($this.hasClass('selected')){return false;}
$('#video-list .selected').removeClass('active selected');$this.addClass('active selected');this.loadVideo(this.getVideoId(el.href));},loadVideo:function(vidID){if(vidID){var vid='<object width="640" height="385">'
+'<param name="movie" value="http://www.youtube.com/v/'+vidID+'&fs=1&rel=0"></param>'
+'<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>'
+'<embed src="http://www.youtube.com/v/'+vidID+'&fs=1&rel=0" type="application/x-shockwave-flash"'
+'allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';$('#video-container').fadeOut('fast',function(){$(this).html(vid).fadeIn('fast');});}},getVideoId:function(url){var vidParam=url.match(/v=([^&]*)/);var vidID;if(vidParam&&vidParam.length>1){vidID=vidParam[1];}
else{vidID=url.substr(url.lastIndexOf('/')+1);if(vidID.length==0||vidID===''||vidID==null){return false;}}
return vidID;},_addPaginator:function($el,carousel){var pages=Math.ceil($el.find('li').length/$el.attr('data-visible'));if(pages>1){var html='<ul class="paginator">'
for(var i=0;i<pages;i++){var className=i==0?' class="active"':'';html+='<li'+className+'>&nbsp;</li>';}
html+='</ul>';var $h=$(html);var $p=$el.parents('.gallery-panel');$h.appendTo($p).css('left',($p.get(0).offsetWidth-$h.get(0).offsetWidth)/2).data('per-page',$el.attr('data-visible'));$el.data('paginator',$h);this._bindPaginatorEvents($h,carousel);}},_bindPaginatorEvents:function($page,carousel){$page.find('li').bind('click',function(){var $this=$(this);if($this.hasClass('active')){return false;}
else{var idx=$page.find('li').index($this);carousel.scroll(idx*$page.data('per-page')+1);$page.find('.active').removeClass('active')
$this.addClass('active');}});},_updatePaginator:function($page,idx){$paginator=$page.data('paginator');if($paginator){var page=Math.ceil(idx/$page.attr('data-visible'));$paginator.find('li').removeClass('active').filter(':eq('+(page-1)+')').addClass('active');}}}}(jQuery)).init();;(function($){$.fn.fisheyeZoom=function(){return this.each(function(){$(this).bind('mouseenter',function(e){$this=$(this);var pos=$this.offset();if(!$this.attr('data-height')){$this.data('original-height',$this.height()).data('original-width',$this.width());}
var width=$this.data('original-width')/0.75;$clone=$('<img src="'+$this.attr('src')+'">');$clone.css({opacity:0,position:'absolute',zIndex:1001,left:pos.left,top:pos.top,height:$this.data('original-height'),width:$this.data('original-width'),cursor:'pointer'}).appendTo('body').bind('click',function(e){e.preventDefault();if($this.parents('a').length>0){$this.parents('a').eq(0).click();}
else{$this.click();}});$this.data('clone',$clone);var newHeight=$this.data('original-height')*1.10;var newWidth=$this.data('original-width')*1.10;$clone.one('mouseleave',function(e){$clone.stop().animate({height:$this.data('original-height'),left:pos.left,width:$this.data('original-width')},100,'swing',function(){$(this).remove();});}).stop().animate({width:newWidth,height:newHeight,opacity:1,left:pos.left-((($this.data('original-width')*1.10)-$this.data('original-width'))/2)},250);}).bind('mouseleave',function(e){$this=$(this);if($this.data('clone')&&e.relatedTarget==$this.data('clone').get(0)){return false;}
if($this.data('clone')){var pos=$this.offset();$this.data('clone').stop().animate({height:$this.data('original-height'),left:pos.left,width:$this.data('original-width')},100,'swing',function(){if($this.data('clone')){$this.data('clone').remove();}});}});});}}(jQuery));/*!
  jQuery Color Animations
  Copyright 2007 John Resig
  Released under the MIT and GPL licenses.
 */(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery);
