(function($){$.fn.tabSlideOut=function(b){var c=$.extend({tabHandle:'.handle',speed:300,action:'click',tabLocation:'left',topPos:null,leftPos:null,fixedPosition:false,positioning:'absolute',pathToTabImage:null,imageHeight:null,imageWidth:null,onLoadSlideOut:false,afterOpen:function(){console.log('afteropen')}},b||{});c.tabHandle=$(c.tabHandle);var d=this;if(c.fixedPosition===true){c.positioning='fixed'}else{c.positioning='absolute'}if(document.all&&!window.opera&&!window.XMLHttpRequest){c.positioning='absolute'}if(c.pathToTabImage!=null){c.tabHandle.css({'background':'url('+c.pathToTabImage+') no-repeat','width':c.imageWidth,'height':c.imageHeight})}c.tabHandle.css({'display':'block','textIndent':'-99999px','outline':'none','position':'absolute'});d.css({'line-height':'1','position':c.positioning});var e={containerWidth:parseInt(d.outerWidth(),10)+'px',containerHeight:parseInt(d.outerHeight(),10)+'px',tabWidth:parseInt(c.tabHandle.outerWidth(),10)+'px',tabHeight:parseInt(c.tabHandle.outerHeight(),10)+'px'};if(c.tabLocation==='top'||c.tabLocation==='bottom'){d.css({'left':c.leftPos});c.tabHandle.css({'right':0})}if(c.tabLocation==='top'){d.css({'top':'-'+e.containerHeight});c.tabHandle.css({'bottom':'-'+e.tabHeight})}if(c.tabLocation==='bottom'){d.css({'bottom':'-'+e.containerHeight,'position':'fixed'});c.tabHandle.css({'top':'-'+e.tabHeight})}if(c.tabLocation==='left'||c.tabLocation==='right'){d.css({'height':e.containerHeight,'top':c.topPos});c.tabHandle.css({'top':0})}if(c.tabLocation==='left'){d.css({'left':'-'+e.containerWidth});c.tabHandle.css({'right':'-'+e.tabWidth})}if(c.tabLocation==='right'){d.css({'right':'-'+e.containerWidth});c.tabHandle.css({'left':'-'+e.tabWidth});$('html').css('overflow-x','hidden')}c.tabHandle.click(function(a){a.preventDefault()});var f=function(i){if(c.tabLocation==='top'){d.eq(i).animate({top:'-'+e.containerHeight},c.speed).removeClass('open')}else if(c.tabLocation==='left'){d.eq(i).animate({left:'-'+e.containerWidth},c.speed).removeClass('open')}else if(c.tabLocation==='right'){d.eq(i).animate({right:'-'+e.containerWidth},c.speed).removeClass('open')}else if(c.tabLocation==='bottom'){d.eq(i).animate({bottom:'-'+e.containerHeight},c.speed).removeClass('open')}};var g=function(i){if(c.tabLocation=='top'){d.eq(i).animate({top:'-3px'},c.speed).addClass('open')}else if(c.tabLocation=='left'){d.eq(i).animate({left:'-3px'},c.speed).addClass('open')}else if(c.tabLocation=='right'){d.eq(i).animate({right:'-3px'},c.speed).addClass('open')}else if(c.tabLocation=='bottom'){d.eq(i).animate({bottom:'-3px'},c.speed).addClass('open')}};var h=function(){d.click(function(a){a.stopPropagation()});$(document).click(function(){d.each(function(i){f(i)})})};var j=function(){c.tabHandle.each(function(i){$(this).click(function(){if(d.eq(i).hasClass('open')){f(i)}else{d.each(function(x){f(x)});g(i)}})});h()};var k=function(){d.hover(function(){g()},function(){f()});c.tabHandle.click(function(a){if(d.hasClass('open')){f()}});h()};var l=function(){f();setTimeout(g,500)};if(c.action==='click'){j()}if(c.action==='hover'){k()}if(c.onLoadSlideOut){l()}}})(jQuery);
