(function(a){a.fn.tabSlideOut=function(b){var c=a.extend({tabHandle:".handle",speed:300,action:"click",tabLocation:"left",topPos:"200px",leftPos:"20px",fixedPosition:false,positioning:"absolute",pathToTabImage:null,imageHeight:null,imageWidth:null},b||{});c.tabHandle=a(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"}c.tabHandle.css({display:"block",width:c.imageWidth,height:c.imageHeight,textIndent:"-99999px",background:"url("+c.pathToTabImage+") no-repeat",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});a("html").css("overflow-x","hidden")}c.tabHandle.click(function(a){a.preventDefault()});var f=function(){if(c.tabLocation==="top"){d.animate({top:"-"+e.containerHeight},c.speed).removeClass("open")}else if(c.tabLocation==="left"){d.animate({left:"-"+e.containerWidth},c.speed).removeClass("open")}else if(c.tabLocation==="right"){d.animate({right:"-"+e.containerWidth},c.speed).removeClass("open")}else if(c.tabLocation==="bottom"){d.animate({bottom:"-"+e.containerHeight},c.speed).removeClass("open")}};var g=function(){if(c.tabLocation=="top"){d.animate({top:"-3px"},c.speed).addClass("open")}else if(c.tabLocation=="left"){d.animate({left:"-3px"},c.speed).addClass("open")}else if(c.tabLocation=="right"){d.animate({right:"-3px"},c.speed).addClass("open")}else if(c.tabLocation=="bottom"){d.animate({bottom:"-3px"},c.speed).addClass("open")}};var h=function(){d.click(function(a){a.stopPropagation()});a(document).click(function(){f()})};var i=function(){c.tabHandle.click(function(a){if(d.hasClass("open")){f()}else{g()}});h()};var j=function(){d.hover(function(){g()},function(){f()});c.tabHandle.click(function(a){if(d.hasClass("open")){f()}});h()};if(c.action==="click"){i()}if(c.action==="hover"){j()}}})(jQuery)
