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