/* Source: /mnt/home/genome/public_html/site/custom/packages/thomas-direct/1.0.0alpha1/js/app.min.js */

MMI.Util.namespace('ThomasDirect.App');document.write=function(){};window.ThomasDirect.App=MMI.App.Core.extend({_currentPageItemId:0,hideShowOption:'fade',showBackButton:false,_pageLoadXhr:null,__construct:function(){this._parent();this.registerLiveEvents(['mousemove','click']);this._swapSourceElement=null;this._jqel_currentGalleryItem=null;this._scrollableSettings={allowFailsafe:false};},handleMousemoveGallery:function(event,app,jqel,data){var ulWidth=0;},handleDocumentReady:function(event,app,jqel,data){jQuery(document).oneTime(500,'startup',function(){var jqel_scrollable=jQuery('.contentBody:first .content');jqel_scrollable.scrollable(app._scrollableSettings);setTimeout(function(){jqel_scrollable.scrollable(app._scrollableSettings);},1000);app.initializeDialogLinks();app.scrollSlider(0);app.internetExplorerJsFixes();});},initializeDialogLinks:function(){var jqel_dialogLinks=jQuery('a[href*="#dialog"]');jqel_dialogLinks.each(function(){var jqel=jQuery(this);if(!jqel.data('thomasDialogLink')){var jqel_span=jQuery('<span>'+jqel.html()+'</span>');jqel_span.data({thomasDialogLink:jqel.attr('href'),live_click_handler:'live_dialogLinkClicked'}).addClass('live_click fakeLink');jqel.replaceWith(jqel_span);}});jqel_dialogLinks.data();},bioImageThumbnailClicked:function(event,app,jqel,data){var jqelBioWrapper=jQuery('#bioGalleryLayoutWrapper');var jqelLargeImage=jQuery(".largeImage",jqelBioWrapper);var largeImageOptions={width:328,height:464,field:'html_large_image',quality:65,extension:'jpg'};var largeImageSrc=MMI.Util.getDynamicImageUrl(data.item_id,largeImageOptions);jqelLargeImage.attr("src",largeImageSrc);jQuery('.textWrapper').hide();jQuery('#employee'+data.item_id).show();var smallImageOptions={width:100,height:100,field:'html_thumbnail',quality:65,extension:'jpg'};var smallImageSrc=MMI.Util.getDynamicImageUrl(data.item_id,smallImageOptions);jqelSmallImage.attr("src",smallImageSrc);},bioBackButtonClicked:function(event,app,jqel,data){var jqelLargeImage=jQuery(".largeImage",jqelBioWrapper);var largeImageOptions={width:328,height:464,field:'html_large_image',quality:65,extension:'jpg'};var largeImageSrc=MMI.Util.getDynamicImageUrl(data.page_item_id,largeImageOptions);jqelLargeImage.attr("src",largeImageSrc);jQuery('.textWrapper').hide();jQuery('#defaultBioPageText').show();},handleClientPageCreating:function(event,app,jqel,data){var jqelLogoGrid=jQuery('.logoGridWrapper');var jqelLogoGridContent=jqelLogoGrid.children('.content');var jqelLogoGridColumns=jqelLogoGridContent.find('.column');var numberOfColumns=jqelLogoGridColumns.size();var newContentWidth=numberOfColumns*jqelLogoGridColumns.first().outerWidth(true);jqelLogoGridContent.width(newContentWidth);var containsMultiplePages=jqelLogoGrid.width()<jqelLogoGridContent.width()?true:false;if(containsMultiplePages){jqelLogoGrid.children('#logoButtons').show();}},handleClientButtonClicked:function(event,app,jqel,data){var jqelLogoGrid=jQuery('.logoGridWrapper');var jqelLogoGridContent=jqelLogoGrid.children('.content');var jqelLogoButtons=jQuery('#logoButtons');var gridWindowSize=jqelLogoGrid.width();var jqelLogoGridColumns=jqelLogoGridContent.find('.column');var numberOfColumns=jqelLogoGridColumns.size();var columnsPerPage=3;var numberOfPages=Math.floor(numberOfColumns/columnsPerPage)+1;var columnWidth=jqelLogoGridColumns.first().outerWidth(true);var columnsToMove=3;var distanceToMove=columnWidth*columnsToMove;if(jqel.hasClass('next')){jqelLogoGridContent.animate({"left":"-="+distanceToMove+"px"},function(){currentPage=jqelLogoGridContent.position().left/-gridWindowSize;MMI.App.getInstance()._clientPageAnimationFinished(jqelLogoGridContent,gridWindowSize,numberOfPages);});}else if(jqel.hasClass('previous')){jqelLogoGridContent.animate({"left":"+="+distanceToMove+"px"},function(){currentPage=jqelLogoGridContent.position().left/-gridWindowSize;MMI.App.getInstance()._clientPageAnimationFinished(jqelLogoGridContent,gridWindowSize,numberOfPages);});}},_clientPageAnimationFinished:function(jqelLogoGridContent,gridWindowSize,numberOfPages){var currentPage=Math.ceil((jqelLogoGridContent.position().left*-1+gridWindowSize)/gridWindowSize);var jqelLogoGrid=jQuery('.logoGridWrapper');var jqelLogoButtons=jqelLogoGrid.children('#logoButtons');jQuery.each(jqelLogoButtons.children(),function(){jQuery(this).stop().show(this.hideShowOption);});if(currentPage<=1){jqelLogoButtons.children('.previous').stop().hide(this.hideShowOption);}else if(currentPage>=numberOfPages){jqelLogoButtons.children('.next').stop().hide(this.hideShowOption);}},hideGalleryContent:function(data){var jqel_galleryMedia=jQuery('.contentMedia:first');if(jqel_galleryMedia.is(':visible')){jqel_galleryMedia.hide('fade',{complete:function(){jQuery(this).find('.content:first').html('');jQuery('.contentBody:first, .contentPhoto:first').show(MMI.App.getInstance().hideShowOption);}});}else{this.loadPageContent(data);}},nextGalleryItem:function(){if(this._jqel_currentGalleryItem){var jqel_nextGalleryItem=this._jqel_currentGalleryItem.next();jqel_nextGalleryItem.trigger('click');}},previousGalleryItem:function(){if(this._jqel_currentGalleryItem){var jqel_previousGalleryItem=this._jqel_currentGalleryItem.prev();jqel_previousGalleryItem.trigger('click');}},thumbnailContentClicked:function(jqel,data){this._swapSourceElement=jqel;jQuery('.contentBody:first').hide(this.hideShowOption);jQuery('.contentPhoto:first').hide('fade',{complete:jQuery.proxy(this.thumbnailContentFaded,this)});jQuery('.contentMedia:first').height('auto').hide('fade',{complete:jQuery.proxy(this.thumbnailMediaContentFaded,this)});this.showBackButton=data.showBackButton;if(this.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show(this.hideShowOption);}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide(this.hideShowOption);}},thumbnailContentFaded:function(){var jqel=this._swapSourceElement;var newPhotoContent=jqel.find('.contentPhoto').html();var newBodyContent=jqel.find('.contentBody').html();var jqel_target=jQuery();if(newPhotoContent){jqel_target=jQuery('.contentPhoto:first');jqel_target.html(newPhotoContent);jqel_target.show(this.hideShowOption);}
if(newBodyContent){jqel_target=jQuery('.contentBody:first');jqel_target.html(newBodyContent);jqel_target.show(this.hideShowOption);}
if(this.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show(this.hideShowOption);}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide(this.hideShowOption);}
var jqel_scrollable=jQuery('.contentBody:first .content');jqel_scrollable.scrollable(this._scrollableSettings);this._jqel_currentGalleryItem=jqel;},thumbnailMediaContentFaded:function(){var jqel=this._swapSourceElement;var jqel_content=jQuery('.contentMedia:first');if(jqel.data('item_type')=='gallery_video'){var itemKey=jqel.find('.data').data('video_key');var itemName=jqel.find('.data').data('item_name');jqel_content.html('<div class="close live_click" data-live_click_handler="live_hideGalleryContent"></div><div class="content"><div class="botrVideo" id="botr_'+itemKey+'_div"></div><div class="title">'+itemName+'</div></div>');var script=jQuery('<script></script>');script.attr('type',"text/javascript");script.attr('src',"http://content.bitsontherun.com/players/"+itemKey.replace('_','-')+".js");jqel_content.append(script);if(this.hideShowOption){jqel_content.show(this.hideShowOption,function(){var app=MMI.App.getInstance();if(app.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show(app.hideShowOption);}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide(app.hideShowOption);}});}else{jqel_content.show();if(this.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show();}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide();}}}else{if(this.hideShowOption){jqel_content.html(jqel.find('.contentMedia').html()).show(this.hideShowOption,function(){var app=MMI.App.getInstance();if(app.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show(app.hideShowOption);}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide(app.hideShowOption);}});}else{jqel_content.html(jqel.find('.contentMedia').html()).show(this.hideShowOption);if(this.showBackButton){jQuery('.sliderBackButton:first, .contentMedia .close').show();}else{jQuery('.sliderBackButton:first, .contentMedia .close').hide();}}}
var jqel_scrollable=jQuery('.contentBody:first .content');jqel_scrollable.scrollable(this._scrollableSettings);var hidePrevious=false;var hideNext=false;if(!jqel.prev().size()||jqel.prev().data('item_type')!='gallery_image'){hidePrevious=true;}
if(!jqel.next().size()||jqel.next().data('item_type')!='gallery_image'){hideNext=true;}
if(hidePrevious){jqel_content.find('.previousGalleryItemButton').hide();}else{jqel_content.find('.previousGalleryItemButton').show();}
if(hideNext){jqel_content.find('.nextGalleryItemButton').hide();}else{jqel_content.find('.nextGalleryItemButton').show();}},loadPageContent:function(data){if(this._pageLoadXhr){this._pageLoadXhr.abort();}
if(data.item_id==this._currentPageItemId){return;}
this._currentPageItemId=data.item_id;jQuery('.floatyImageWrapper').hide(this.hideShowOption);var postData={id:data.item_id};var trackingUrl='/?id='+data.item_id;if(typeof(data.item_seo_name)!='undefined'&&data.item_seo_name){trackingUrl='/content/'+data.item_seo_name;}
this._pageLoadXhr=this.ajax({done:this._handlePageContentLoaded,data:postData,_gaTrackingUrl:trackingUrl});var jqel_content=jQuery('.pageContentContainer');jqel_content.hide(this.hideShowOption);},_handlePageContentLoaded:function(result){var app=MMI.App.getInstance();var jqel=jQuery('.pageContentContainer');var backgroundImageUrl='';if(typeof(this._gaTrackingUrl)!='undefined'){_gaq.push(['_trackPageview',this._gaTrackingUrl]);}
if(typeof(result.html_main_background_image)!='undefined'){backgroundImageUrl=result.html_main_background_image;}else if(typeof(result.form_main_background_image)!='undefined'){backgroundImageUrl=result.form_main_background_image;}
var jqel_imageContainer=jQuery('.outerContentBackground');var jqel_newImageContainer=jQuery('<div class="outerContentImage"></div>');jqel_newImageContainer.css({'visibility':'hidden'});jqel_imageContainer.append(jqel_newImageContainer);var jqel_image=jQuery('<img src="" />');jqel_newImageContainer.append(jqel_image);jqel_image.bind('load',app.backgroundImageLoaded);jqel_image.attr('src',backgroundImageUrl);var floatingImageUrl=result.html_secondary_background_image;if(floatingImageUrl){jqel_imageContainer=jQuery('.floatyImageWrapper');jqel_image=jqel_imageContainer.find('img:first');if(!jqel_image.size()){jqel_image=jQuery('<img/>');jqel_imageContainer.append(jqel_image);}
jqel_image.unbind('load');if(jqel_image.attr('src')!=floatingImageUrl){jqel_image.bind('load',app.floatingImageLoaded);jqel_image.attr('src',floatingImageUrl);}else{jqel_imageContainer.show(app.hideShowOption);}}
var jqel_newContent=jQuery(result.result);jqel_newContent.hide();var jqel_parent=jqel.parent();jqel.hide('fade',{complete:function(){jQuery(this).remove();jqel_parent.append(jqel_newContent).find('.live_creating').trigger('creating');if(app.hideShowOption){jqel_newContent.show(app.hideShowOption,function(){var jqel_scrollable=jQuery('.contentBody:first .content');jqel_scrollable.scrollable(app._scrollableSettings);app.initializeDialogLinks();app.scrollSlider(0);app.internetExplorerJsFixes();});}else{jqel_newContent.show();var jqel_scrollable=jQuery('.contentBody:first .content');jqel_scrollable.scrollable(app._scrollableSettings);app.initializeDialogLinks();app.scrollSlider(0);app.internetExplorerJsFixes();}}});},scrollContent:function(percentage){var jqel=jQuery('.contentBody');var jqel_inner=jqel.find('.contentBodyInner');jqel.css({height:Math.min(jqel_inner.height(),465)+'px'});var difference=Math.max(0,jqel_inner.height()-jqel.height());jqel_inner.css({top:(difference*percentage)+'px'});},scrollSlider:function(percentage){var jqel=jQuery('.contentSlider');if(!jqel.size()){return;}
var jqel_inner=jqel.find('.contentSliderInner');var jqel_items=jqel.find('.sliderItem');var numItems=jqel_items.size();var jqel_item=jqel_items.first();var itemWidth=jqel_item.width();var buffer=jqel_item.outerWidth(true)-itemWidth;var fadeOutGraphicsBuffer=48;var innerWidth=numItems*(itemWidth+buffer)+buffer+fadeOutGraphicsBuffer;var difference=Math.max(0,innerWidth-jqel.width());var newLeftPosition=(difference*percentage)+(fadeOutGraphicsBuffer/2);var currentLeftPosition=jqel_inner.position().left;var newCssOptions={left:newLeftPosition+'px',width:innerWidth+'px'};if(this.showHideOption&&Math.abs(currentLeftPosition-newLeftPosition)>40){var animateOptions={duration:1000,easing:'easeOutCubic'};jqel_inner.stop().animate(newCssOptions,animateOptions);}else{jqel_inner.stop().css(newCssOptions);}
if(percentage<-0.05){jqel.parent().find('.leftArrow').show();}else{jqel.parent().find('.leftArrow').hide();}
if(percentage>-0.95){jqel.parent().find('.rightArrow').show();}else{jqel.parent().find('.rightArrow').hide();}},backgroundImageLoaded:function(){var jqel=jQuery(this);var jqel_container=jqel.parent();jqel_container.css({visibility:'visible'});jqel_container.hide();var showOptions={complete:function(){jQuery(this).siblings().remove();}};jqel_container.show('fade',showOptions);},floatingImageLoaded:function(){jQuery('.floatyImageWrapper').show(this.hideShowOption);},internetExplorerJsFixes:function(){var userAgent=jQuery.browser;var version=userAgent.version.slice(0,1);if(userAgent.msie){this.hideShowOption=undefined;if(version=='6'){jQuery('.mmiFormInnerWrapper').removeClass('mmiFormInnerWrapper');jQuery(document).supersleight({apply_positioning:false});}}}});window.ThomasDirectApp=new ThomasDirect.App();

/* Source: /mnt/home/genome/public_html/site/custom/packages/thomas-direct/1.0.0alpha1/js/liveevents.min.js */

MMI.Util.namespace('ThomasDirect.LiveEvents');window.ThomasDirect.LiveEvents={handleAppInstanceCreated:function(app){app.registerHandlerClass(ThomasDirect.LiveEvents);},makeTooltip:function(event,app,jqel,data){jqel.qtip({adjust:{method:'flip',x:0,y:0}});},live_showLogInButton:function(event,app,jqel,data){if(jqel.find('.silk-lock')){jqel.find('.silk-lock').show().stop().animate({opacity:0.6});}},live_hideLogInButton:function(event,app,jqel,data){if(jqel.find('.silk-lock')){jqel.find('.silk-lock').stop().animate({opacity:0,complete:function(){jQuery(this).hide();}});}},live_awardsPageCreated:function(event,app,jqel,data){jqel.find('.sliderItem:first').trigger('click');},live_hideOnHover:function(event,app,jqel,data){if(app.hideShowOption){jqel.find('.colorImage').css({display:'none',visibility:'visible'}).show();jqel.find('.monochromeImage').stop(true,true).hide('fade',{speed:'slow',easing:'easeOutCubic'});}else{jqel.find('.colorImage').css({display:'none',visibility:'visible'}).show();jqel.find('.monochromeImage').stop(true,true).hide();}},live_showOnHover:function(event,app,jqel,data){if(app.hideShowOption){jqel.find('.monochromeImage').stop(true,true).show('fade',{speed:'slow',easing:'easeOutCubic'});}else{jqel.find('.monochromeImage').stop(true,true).show();}},live_fadeColorUp:function(event,app,jqel,data){if(app.hideShowOption){jqel.find('.colorImage').stop(true,true).css({display:'none',visibility:'visible'}).show('fade',{speed:'slow',easing:'easeOutCubic'});}else{jqel.find('.colorImage').css({display:'none',visibility:'visible'}).show();}},live_fadeColorDown:function(event,app,jqel,data){if(app.hideShowOption){jqel.find('.colorImage').stop(true,true).hide('fade',{speed:'slow',easing:'easeOutCubic'});}else{jqel.find('.colorImage').hide();}},live_sliderUpdatePosition:function(event,app,jqel,data){var percentage=(jqel.offset().left-event.pageX)/jqel.width();app.scrollSlider(percentage);},live_contentScroll:function(event,app,jqel,data){var percentage=(jqel.offset().top-event.pageY)/jqel.height();app.scrollContent(percentage);},live_hideGalleryContent:function(event,app,jqel,data){jQuery('.sliderBackButton, .contentMedia .close').hide('fade');app.hideGalleryContent(data);jQuery('#_mmiEditPage').data('item_id',data.item_id);app._currentPageItemId=data.item_id;},live_loadPageContent:function(event,app,jqel,data){app.loadPageContent(data);jQuery('#_mmiEditPage').data('item_id',data.item_id);app._currentPageItemId=data.item_id;return false;},live_thumbnailContentClicked:function(event,app,jqel,data){app.thumbnailContentClicked(jqel,data);jQuery('#_mmiEditPage').data('item_id',data.item_id);app._currentPageItemId=data.item_id;},live_demoReelPageLoaded:function(event,app,jqel,data){clog('live_demoReelPageLoaded');app.thumbnailContentClicked(jqel,data);},handleThomasMenuHoverStart:function(event,app,jqel,data){if(jqel.hasClass('thomasMenuItem')){var jqelSubMenu=jqel.find('.thomasSubMenu:first');var subMenuCss;jqelSubMenu.css('position','absolute');if(jqelSubMenu.data('thomasMenuDepth')==1){var parentPositionType=jqel.parent().css('position');var newLeftPosition;if(parentPositionType=='relative'||parentPositionType=='absolute'){newLeftPosition=jqel.offset().left;}else{newLeftPosition=jqel.position().left;}
var parentMenuItemWidth=jqel.outerWidth(true);var subMenuItemWidth=jqelSubMenu.outerWidth(true);newLeftPosition=Math.floor(newLeftPosition-(Math.abs((parentMenuItemWidth/2)-(subMenuItemWidth/2))));subMenuCss={top:jqel.innerHeight(),left:newLeftPosition};jqelSubMenu.css(subMenuCss);}else if(jqelSubMenu.data('thomasMenuDepth')>1){var offset=jqel.offset();subMenuCss={top:offset.top-jqel.innerHeight(),left:jqel.innerWidth()-1};jqelSubMenu.css(subMenuCss);}
jqelSubMenu.stop(true,true).delay(180).slideDown('fast');}},handleThomasMenuHoverEnd:function(event,app,jqel,data){if(jqel.hasClass('thomasMenuItem')){jqel.find('.thomasSubMenu:first').stop(true,true).delay(300).slideUp('fast','swing');}},handleAddressClicked:function(event,app,jqel,data){var content='<iframe width="375" height="425" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=33+Plymouth+Street,+Montclair,+NJ+07042&amp;aq=&amp;sll=37.0625,-95.677068&amp;sspn=58.033539,69.433594&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=33+Plymouth+St,+Montclair,+New+Jersey+07042&amp;t=m&amp;ll=40.81277,-74.220886&amp;spn=0.027608,0.032187&amp;z=14&amp;iwloc=near&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=33+Plymouth+Street,+Montclair,+NJ+07042&amp;aq=&amp;sll=37.0625,-95.677068&amp;sspn=58.033539,69.433594&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=33+Plymouth+St,+Montclair,+New+Jersey+07042&amp;t=m&amp;ll=40.81277,-74.220886&amp;spn=0.027608,0.032187&amp;z=14&amp;iwloc=near" target="_blank">View Larger Map</a></small>';var lightboxOptions={width:424,height:484,lightboxKeepCentered:true};app.dialog(content,lightboxOptions);},live_dialogLinkClicked:function(event,app,jqel,data){if(jqel.get(0).tagName.toLowerCase()=='span'){var url=jqel.data('thomasDialogLink');var ajaxOptions={url:url,mmiAjaxDone:app.internetExplorerFormFix};var lightboxOptions={width:390,height:394+32};app.ajaxDialog(ajaxOptions,'',lightboxOptions);return false;}},openSelectChildItemType:function(event,app,jqel,data){var allowedTypes={};var toUpper=function(str){return(str+'').replace(/^([a-z])|[\s_]+([a-z])/g,function($1){return $1.toUpperCase();});};var dialogContent='<div class="newSliderChildTypeSelectionBox" data-item_id="'+data.item_id+'"><div class="title">What do you want to add?</div><div class="selectionBox"><select name="sliderTypeSelection">';for(var i in data.childTypes){if(data.childTypes.hasOwnProperty(i)){var value=data.childTypes[i];var friendlyText=toUpper(data.childTypes[i]).replace(/_/,' ');dialogContent+='<option value="'+value+'">'+friendlyText+'</option>';}}
dialogContent+='</select></div><input type="button" class="nextButton live_click" value="Continue" data-live_click_handler="continueSliderChildCreateProcess" /></div>';app.dialog(dialogContent,{width:250,height:130,lightboxClass:'newSliderChildTypeSelectionBoxDialog',lightboxDestroyOnClose:true,lightboxRemoveOnDestroy:true});},continueSliderChildCreateProcess:function(event,app,jqel,data){jQuery('.newSliderChildTypeSelectionBoxDialog').lightbox('close');var itemType=jqel.parents('.newSliderChildTypeSelectionBox').find('select[name="sliderTypeSelection"]').val();var lightboxOptions={width:924,lightboxFullscreen:false};MMI.Edit.openCreateItemDialog({itemType:itemType,itemParent:data.item_id,lightboxOptions:lightboxOptions});},handleGalleryPreviousClicked:function(event,app,jqel,data){app.previousGalleryItem();},handleGalleryNextClicked:function(event,app,jqel,data){app.nextGalleryItem();},handleContactFormSaveStarted:function(event,app,jqel,data){jqel.parents('.mmiFormWrapper').addClass('submitting');},handleContactFormSaveSuccess:function(event,app,jqel,data){var jqel_contactFormWrapper=jqel.parents('.contactFormWrapper');if(app.hideShowOption){jqel_contactFormWrapper.find('.contactFormSent').show(app.hideShowOption,function(){jqel_contactFormWrapper.find('.contactForm').hide(app.hideShowOption);});}else{jqel_contactFormWrapper.find('.contactForm').hide();jqel_contactFormWrapper.find('.contactFormSent').show();}},handleContactFormSaveCompleted:function(event,app,jqel,data){jqel.parents('.mmiFormWrapper').removeClass('submitting');}};MMI.App.registerInitCallback(ThomasDirect.LiveEvents.handleAppInstanceCreated);

/* Source: /mnt/home/genome/public_html/site/custom/packages/thomas-direct/1.0.0alpha1/js/jquery.scrollable.min.js */

(function($){var pluginName='scrollable';var methods={init:function(options){var defaultSettings={allowFailsafe:true,pollInterval:2000,pollingTimer:undefined};var settings=$.extend(defaultSettings,options||{});var isIe6=(jQuery.browser.msie&&jQuery.browser.version.slice(0,1)=="6");return this.each(function(){var jqel=$(this);var initialized=false;if(jqel.data('xui-scrollable')){initialized=true;}
if(initialized){settings=jqel.data('xui-scrollable-settings');}else{jqel.data('xui-scrollable',true);jqel.data('xui-scrollable-settings',settings);}
var jqel_textElement=jqel;if(isIe6){jqel_textElement.css({overflow:'auto'});return;}
var jqel_inner;var jqel_scrollBar;if(!initialized){jqel_inner=jQuery('<div/>');jqel_scrollBar=jQuery('<div class="xui-scrollable-scrollbar"><div class="xui-scrollable-scrollbar-drag-channel"></div><div class="xui-scrollable-scrollbar-drag-handle"></div></div>');}else{jqel_inner=jqel.find('.xui-scrollable-content');jqel_scrollBar=jqel.find('.xui-scrollable-scrollbar');}
jqel_scrollBar.css({height:jqel.height(),position:'absolute',top:0,right:0});jqel_inner.addClass('xui-scrollable-content');if(!initialized){jqel_inner.html(jqel.html());}
if(jqel.css('position')!='absolute'){jqel.css({position:'relative'});}
if(!initialized){jqel.html(jqel_inner);}
var overflowSetting='hidden';var contentHeight=jqel_inner.height();if(contentHeight<=jqel.height()){jqel_scrollBar.css({visibility:'hidden'});if(settings.allowFailsafe){overflowSetting='auto';}}else{jqel_scrollBar.css({visibility:'visible'});}
jqel.data('xui-scrollable-height',contentHeight);if(!initialized){jqel.append(jqel_scrollBar);}
jqel_inner.css({width:jqel.width()-jqel_scrollBar.width(),position:'absolute'});jqel_textElement.css({overflow:overflowSetting});if(!initialized){jqel_scrollBar.find('.xui-scrollable-scrollbar-drag-handle').draggable({containment:jqel_scrollBar,axis:'y',scroll:false,drag:function(event,ui){var jqel=jQuery(this);var percentage=jqel.position().top/(jqel.parent().height()-jqel.height());var newPosition=Math.abs(jqel_inner.height()-jqel_textElement.height())*percentage;jqel_inner.css({top:-newPosition});}});jqel_textElement.hover(function(){var jqel=jQuery(this);if(jqel_inner.height()>=jqel.height()){jqel.scrollable();}},function(){});}
if(settings.pollInterval>0){if(!settings.pollingTimer){settings.pollingTimer=setTimeout(function(){if(jqel_textElement.parents('html').size()>0){settings.pollingTimer=false;jqel_textElement.scrollable();}},settings.pollInterval);}}});}};$.fn[pluginName]=function(method){if(!method||typeof(method)=='object'){return methods.init.apply(this,arguments);}else if(typeof(methods[method])!='undefined'){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else{$.error('Method '+method+' does not exist in jQuery.'+pluginName);}};})(jQuery);


