var RecaptchaOptions={theme:"white",lang:"de"};var j=jQuery.noConflict();jQuery(document).ready(function(){if(j.browser.opera){j('#meta_suche').find('button').css('top','5px');j('#meta_suche').find('button').css('right','16px');}
if(navigator.userAgent.indexOf('Macintosh')>-1){if(!j.browser.mozilla){j('#meta_suche').find('button').css('top','5px');j('#meta_suche').find('button').css('right','17px');}else{j('#meta_suche').find('button').css('right','20px');}}
j(".icon img").jHelperTip({topOff:15,leftOff:-180,trigger:"hover",source:"attribute",attrName:"name",opacity:0.8,autoClose:true});j(".related img").jHelperTip({topOff:15,leftOff:0,trigger:"hover",source:"attribute",attrName:"alt",opacity:0.9,autoClose:true});var n=j("#klinikinteresse:checked").length;if(n==0){j('#klinikbetreff').css("display","none")}
j('#klinikinteresse').click(function()
{if(n==1){j('#klinikbetreff').hide("slow");n=0;}else{j('#klinikbetreff').show("slow");n=1;}});var p=j("#Patient:checked").length;if(p==0){j('#klinikaufenthalt').css("display","none")}
j('#Patient').click(function()
{if(p==1){j('#klinikaufenthalt').hide("slow");p=0;}else{j('#klinikaufenthalt').show("slow");p=1;}});j('.gotop').click(function(){j('#top_margin').ScrollTo(1200);return false;});j('.ankerSource').click(function(){var anchor=j(this).attr("name");j("#"+anchor).ScrollTo(1200);return false;});j('#f_search_label_de').text('Suche');j('#f_search_label_en').text('Search');j('#f_search_de').focus(function(){j('#f_search_label_de').text('');});j('#f_search_en').focus(function(){j('#f_search_label_en').text('');});j('#carousel').addClass('jcarousel-list');j('#carousel li').addClass('jcarousel-item');var rtag="<p class='space'>"
j(".c100 p br").replaceWith(rtag);j(".c100:first p p:last").removeClass("not").addClass('space');jQuery.each(jQuery.browser,function(i,val){if(i=="msie"&&jQuery.browser.version.substr(0,3)=="6.0")
j("p.copy").append("<br style='clear:left' />");});j('#quickmenu #level1 .level1').bind("click",function(){var level1=j(this).parent();level1.find('div.level3').hide();j(this).parent().children('.level1').each(function(){j(this).children('.sub').css('display','none');j(this).removeClass('level1active');});j(this).addClass('level1active');j(this).children('.sub').css('display','block');j(this).find('.level2').click(function(e){j(this).parent().children('.level2').each(function(e){j(this).children('.level3').css('display','none');});j(this).find('.level3').css('display','block');e.stopPropagation();});});j('div.c_quickfind').css({'display':'block'});j('#c_quickfind').accordion({event:'click',active:-1,alwaysOpen:false,fillSpace:false,clearStyle:true,autoHeight:false,header:'h4.head'});j('.c_quickfind_sub').accordion({event:'click',active:-1,alwaysOpen:false,fillSpace:false,clearStyle:true,autoHeight:false,header:'h4.head'});j('#kontakt_acc').accordion({event:'click',alwaysOpen:false,active:-1,clearStyle:true,header:'dt'});if(j('#kontakt_acc dt.active')){j('#kontakt_acc').accordion('activate',j('#kontakt_acc dt.active'));};j('#kontakt_acc dt').css({'cursor':'pointer'});if(j.browser.msie){var ieversion=j.browser.version;var ieversion_arr=ieversion.split('.');var ieAbstand=(ieversion_arr[0]==="6")?3:0;j('#mainmenu .left .level2').hover(function(){j(this).find('li').width(j(this).width());},function(){});if(ieversion_arr[0]==="6"){j('#mainmenu .left').hover(function(){j(this).children('.level1').addClass('hover1');},function(){j(this).children('.level1').removeClass('hover1');});j('#mainmenu .left .level2 li').hover(function(){j(this).addClass('hover2');},function(){j(this).removeClass('hover2');});j('#quickmenu .level1').hover(function(){j(this).addClass('level1hover');},function(){j(this).removeClass('level1hover');});j('#quickmenu .level1 .level2').hover(function(){j(this).addClass('level2hover');},function(){j(this).removeClass('level2hover');});}
j('#menu_t .menu_t_sub').hide();j('#menu_t li.sub').hover(function(){j('#'+j(this).attr('name')).css({'display':'block'});j('#head_wrap,#col_left,#col_center').css({'position':'static'});j('#login').css({'top':'66px'});},function(){j('#login').show();j('#'+j(this).attr('name')).css({'display':'none'});j('#head_wrap,#col_left,#col_center').css({'position':'relative'});j('#login').css({'top':'-5px'});});j('#OnPageGalleryList a.selected').css({'color':'#f60','text-decoration':'underline'});j('.ui-accordion dt').hover(function(){j(this).css({'background-color':'#e9e9e9'});},function(){j(this).css({'background-color':'#efeee7'});});};j('#menu_t li.sub').hover(function(){j(this).addClass('over');},function(){j(this).removeClass('over');});j('.c_quickfind_sub ul li').each(function(i){j(this).children('a').prepend('» ');});j('div#query p span.button').children('a').prepend('» ');if(/\/karriere/g.test(window.location.pathname)){if(!jQuery.cookie('karriere_umfrage')){tb_show('','http://www.schoen-kliniken.de/php-bin/limesurvey/index.php?sid=58638〈=de?TB_iframe=true&KeepThis=true&height=530&width=880');jQuery.cookie('karriere_umfrage',false,{path:'/',expires:30});}}
jQuery('#col_center div.c100').contents().filter(function(){return(this.nodeType==3&&jQuery.trim(this.data).length>0);}).wrap('<p></p>');jQuery('#col_center div.c100 div.imgcontainer-1.left div.image img').one('load',function(event){if(jQuery(this).width()<180){jQuery(this).parents('div.imgcontainer-1.left:first').css({'width':'183px'});};}).each(function(){if(this.complete||(jQuery.browser.msie&&parseInt(jQuery.browser.version)===6)){jQuery(this).trigger('load');}});});jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};function adjustPadding(obj){var tmp=[];var obj_top=j(obj).offset().top;var obj_left=j(obj).offset().left;var obj_width=j(obj).outerWidth();var obj_width_calc=0;var firstLevel=j(obj+' li.level1');firstLevel.each(function(i){var t_top=j(this).offset().top;var t_left=j(this).offset().left;var t_width=j(this).outerWidth({margin:true});if(t_top>=0){obj_width_calc+=t_width;if(i!=0){tmp.push(j(this));}}});var diff=(760-obj_width_calc);var delta=Math.ceil((760-obj_width_calc)/tmp.length/2);addPadding(tmp,diff,delta);};function addPadding(array,diff,delta){var n=array.length;var set=array;while(set!==[]&&set.length>0){var current=set.pop();var target=j(current).children('a');var pad_left=parseFloat(j(target).css('padding-left'));var pad_right=parseFloat(j(target).css('padding-right'));j(current).css({'border-bottom-width':0});if(set.length>=1){j(target).css('padding-left',pad_left+delta);j(target).css('padding-right',pad_right+delta);}else{j(target).css('padding-left',pad_left+Math.floor(diff/2));j(target).css('padding-right',pad_right+Math.floor(diff/2)+Math.round((diff/2)-Math.floor(diff/2)));}
diff=diff-(2*delta);}};jQuery.getPos=function(e)
{var l=0;var t=0;var w=jQuery.intval(jQuery.css(e,'width'));var h=jQuery.intval(jQuery.css(e,'height'));var wb=e.offsetWidth;var hb=e.offsetHeight;while(e.offsetParent){l+=e.offsetLeft+(e.currentStyle?jQuery.intval(e.currentStyle.borderLeftWidth):0);t+=e.offsetTop+(e.currentStyle?jQuery.intval(e.currentStyle.borderTopWidth):0);e=e.offsetParent;}
l+=e.offsetLeft+(e.currentStyle?jQuery.intval(e.currentStyle.borderLeftWidth):0);t+=e.offsetTop+(e.currentStyle?jQuery.intval(e.currentStyle.borderTopWidth):0);return{x:l,y:t,w:w,h:h,wb:wb,hb:hb};};jQuery.getClient=function(e)
{if(e){w=e.clientWidth;h=e.clientHeight;}else{w=(window.innerWidth)?window.innerWidth:(document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.offsetWidth;h=(window.innerHeight)?window.innerHeight:(document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.offsetHeight;}
return{w:w,h:h};};jQuery.getScroll=function(e)
{if(e){t=e.scrollTop;l=e.scrollLeft;w=e.scrollWidth;h=e.scrollHeight;}else{if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight;}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight;}}
return{t:t,l:l,w:w,h:h};};jQuery.intval=function(v)
{v=parseInt(v);return isNaN(v)?0:v;};jQuery.fn.ScrollTo=function(s){o=jQuery.speed(s);return this.each(function(){new jQuery.fx.ScrollTo(this,o);});};jQuery.fx.ScrollTo=function(e,o)
{var z=this;z.o=o;z.e=e;z.p=jQuery.getPos(e);z.s=jQuery.getScroll();z.clear=function(){clearInterval(z.timer);z.timer=null};z.t=(new Date).getTime();z.step=function(){var t=(new Date).getTime();var p=(t-z.t)/z.o.duration;if(t>=z.o.duration+z.t){z.clear();setTimeout(function(){z.scroll(z.p.y,z.p.x)},13);}else{st=((-Math.cos(p*Math.PI)/2)+0.5)*(z.p.y-z.s.t)+z.s.t;sl=((-Math.cos(p*Math.PI)/2)+0.5)*(z.p.x-z.s.l)+z.s.l;z.scroll(st,sl);}};z.scroll=function(t,l){window.scrollTo(l,t)};z.timer=setInterval(function(){z.step();},13);};if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;(function($){j.fn.jHelperTip=function(options){var opts=j.extend({},j.fn.jHelperTip.defaults,options);if(j(opts.ttC).length==0)
j('<div id="'+opts.ttC.slice(1)+'"></div>').appendTo("body");if(j(opts.dC).length==0)
j('<div id="'+opts.dC.slice(1)+'"></div>').appendTo("body");if(j(opts.aC).length==0)
j('<div id="'+opts.aC.slice(1)+'"></div>').appendTo("body");j(opts.ttC).add(opts.aC).css({position:"absolute",display:"inline"}).hide();j(opts.dC).hide();var closeBox=function(){if(opts.source=="attribute")
j(opts.aC).hide().empty();else
j(opts.ttC).hide().empty();};j(".jHelperTipClose").bind("click",closeBox);j(opts.ttC).bind("mouseover",function(){j(opts.ttC).show();return false;});var getData=function(obj,e){if(opts.source=="ajax"){getPosition(e);j(opts.ttC).html('<div><img src="'+opts.loadingImg+'"/> '+opts.loadingText+'</div>').show();j.ajax({type:opts.type,url:opts.url,data:opts.data,success:function(msg){j(opts.ttC).html(msg);j(".jHelperTipClose").unbind("click",closeBox);j(".jHelperTipClose").bind("click",closeBox);}});}
else if(opts.source=="container"){j(opts.ttC).show().empty();j(opts.dC).clone(true).show().appendTo(opts.ttC);}
if(opts.source=="attribute"){j(opts.aC).html(j(obj).attr(opts.attrName));}};var getPosition=function(e){var top=e.pageY+opts.topOff;var left=e.pageX+opts.leftOff;if(opts.source=="attribute"){j(opts.aC).css({top:top,left:left,opacity:opts.opacity}).show();}
else{j(opts.ttC).css({top:top,left:left,opacity:opts.opacity}).show();}};if(opts.trigger=="hover"){j(this).bind("mouseover",function(e){e.preventDefault();getData(this,e);return false;});j(this).bind("mousemove",function(e){getPosition(e);return false;});j(this).bind("mouseout",function(e){if(opts.source=="attribute")
j(opts.aC).hide().empty();else
j(opts.ttC).hide().empty();return false;});}
else if(opts.trigger=="click"){j(this).bind("click",function(e){getData(this,e);getPosition(e);j(document).bind("click",function(e){if(opts.autoClose){if(opts.source=="attribute")
j(opts.aC).hide().empty();else
j(opts.ttC).hide().empty();}});return false;});}};j.fn.jHelperTip.defaults={trigger:"click",topOff:3,leftOff:10,source:"container",attrName:'',ttC:"#jHelperTipContainer",dC:"#jHelperTipDataContainer",aC:"#jHelperTipAttrContainer",opacity:1.0,loadingImg:"ajax-loader.gif",loadingText:"Loading...",type:"GET",autoClose:true};})(jQuery);(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings)
{settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function()
{var $this=$(this);$this.css('overflow','hidden');var paneEle=this;if($(this).parent().is('.jScrollPaneContainer')){var currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;$('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown',$c).remove();$this.css({'top':0});}else{var currentScrollPosition=0;this.originalPadding=$this.css('paddingTop')+' '+$this.css('paddingRight')+' '+$this.css('paddingBottom')+' '+$this.css('paddingLeft');this.originalSidePaddingTotal=(parseInt($this.css('paddingLeft'))||0)+(parseInt($this.css('paddingRight'))||0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;var $container=$('<div></div>').attr({'className':'jScrollPaneContainer'}).css({'height':paneHeight+'px','width':paneWidth+'px'});if(settings.enableKeyboardNavigation){$container.attr('tabindex',settings.tabIndex);}
$this.wrap($container);$(document).bind('emchange',function(e,cur,prev)
{$this.jScrollPane(settings);});}
if(settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,'jScrollPaneImagesToLoad')||$('img',$this);var loadedImages=[];if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind('load readystatechange',function(){if($.inArray(i,loadedImages)==-1){loadedImages.push(val);$imagesToLoad=$.grep($imagesToLoad,function(n,i){return n!=val;});$.data(paneEle,'jScrollPaneImagesToLoad',$imagesToLoad);var s2=$.extend(settings,{reinitialiseOnImageLoad:false});$this.jScrollPane(s2);}}).each(function(i,val){if(this.complete||this.complete===undefined){this.src=this.src;}});});};}
var p=this.originalSidePaddingTotal;var realPaneWidth=paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p;var cssToApply={'height':'auto','width':realPaneWidth+'px'}
if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+'px';}else{cssToApply.paddingRight=settings.scrollbarMargin+'px';}
$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<.99){var $container=$this.parent();$container.append($('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),$('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'}))));var $track=$('>.jScrollPaneTrack',$container);var $drag=$('>.jScrollPaneTrack .jScrollPaneDrag',$container);var currentArrowDirection;var currentArrowTimerArr=[];var currentArrowInc;var whileArrowButtonDown=function()
{if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}
currentArrowInc++;};if(settings.enableKeyboardNavigation){$container.bind('keydown.jscrollpane',function(e)
{switch(e.keyCode){case 38:currentArrowDirection=-1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 40:currentArrowDirection=1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 33:case 34:return false;default:}}).bind('keyup.jscrollpane',function(e)
{if(e.keyCode==38||e.keyCode==40){for(var i=0;i<currentArrowTimerArr.length;i++){clearInterval(currentArrowTimerArr[i]);}
return false;}});}
if(settings.showArrows){var currentArrowButton;var currentArrowInterval;var onArrowMouseUp=function(event)
{$('html').unbind('mouseup',onArrowMouseUp);currentArrowButton.removeClass('jScrollActiveArrowButton');clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$('html').bind('mouseup',onArrowMouseUp);currentArrowButton.addClass('jScrollActiveArrowButton');currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowUp','tabindex':-1}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll up').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind('click',rf),$('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowDown','tabindex':-1}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll down').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind('click',rf));var $upArrow=$('>.jScrollArrowUp',$container);var $downArrow=$('>.jScrollArrowDown',$container);if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({'height':trackHeight+'px',top:settings.arrowSize+'px'})}else{var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();$track.css({'height':trackHeight+'px',top:topArrowHeight+'px'})}}
var $pane=$(this).css({'position':'absolute','overflow':'visible'});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=='X'?'Left':'Top';return event['page'+c]||(event['client'+c]+(document.documentElement['scroll'+p]||document.body['scroll'+p]))||0;};var ignoreNativeDrag=function(){return false;};var initDrag=function()
{ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event)
{initDrag();dragMiddle=getPos(event,'Y')-dragPosition-currentOffset.top;$('html').bind('mouseup',onStopDrag).bind('mousemove',updateScroll);if($.browser.msie){$('html').bind('dragstart',ignoreNativeDrag).bind('selectstart',ignoreNativeDrag);}
return false;};var onStopDrag=function()
{$('html').unbind('mouseup',onStopDrag).unbind('mousemove',updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$('html').unbind('dragstart',ignoreNativeDrag).unbind('selectstart',ignoreNativeDrag);}};var positionDrag=function(destY)
{destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({'top':destY+'px'});var p=destY/maxY;$this.data('jScrollPanePosition',(paneHeight-contentHeight)*-p);$pane.css({'top':((paneHeight-contentHeight)*p)+'px'});$this.trigger('scroll');if(settings.showArrows){$upArrow[destY==0?'addClass':'removeClass']('disabled');$downArrow[destY==maxY?'addClass':'removeClass']('disabled');}};var updateScroll=function(e)
{positionDrag(getPos(e,'Y')-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({'height':dragH+'px'}).bind('mousedown',onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function()
{if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}
trackScrollInc++;};var onStopTrackClick=function()
{clearInterval(trackScrollInterval);$('html').unbind('mouseup',onStopTrackClick).unbind('mousemove',onTrackMouseMove);};var onTrackMouseMove=function(event)
{trackScrollMousePos=getPos(event,'Y')-currentOffset.top-dragMiddle;};var onTrackClick=function(event)
{initDrag();onTrackMouseMove(event);trackScrollInc=0;$('html').bind('mouseup',onStopTrackClick).bind('mousemove',onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();return false;};$track.bind('mousedown',onTrackClick);$container.bind('mousewheel',function(event,delta){delta=delta||(event.wheelDelta?event.wheelDelta/120:(event.detail)?-event.detail/3:0);initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition()
{var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}
var ceaseAnimation=function()
{if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni)
{if(typeof pos=="string"){$e=$(pos,$this);if(!$e.length)return;pos=$e.offset().top-$this.offset().top;}
$container.scrollTop(0);ceaseAnimation();var maxScroll=contentHeight-paneHeight;pos=pos>maxScroll?maxScroll:pos;$this.data('jScrollPaneMaxScroll',maxScroll);var destDragPosition=pos/maxScroll*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta)
{var currentPos=-parseInt($pane.css('top'))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$('*',this).bind('focus',function(event)
{var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}
var viewportTop=-parseInt($pane.css('top'))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}
scrollTo(destPos);}})
if(location.hash){setTimeout(function(){scrollTo(location.hash);},$.browser.safari?100:0);}
$(document).bind('click',function(e)
{$target=$(e.target);if($target.is('a')){var h=$target.attr('href');if(h&&h.substr(0,1)=='#'&&h.length>1){setTimeout(function(){scrollTo(h,!settings.animateToInternalLinks);},$.browser.safari?100:0);}}});function onSelectScrollMouseDown(e)
{$(document).bind('mousemove.jScrollPaneDragging',onTextSelectionScrollMouseMove);$(document).bind('mouseup.jScrollPaneDragging',onSelectScrollMouseUp);}
var textDragDistanceAway;var textSelectionInterval;function onTextSelectionInterval()
{direction=textDragDistanceAway<0?-1:1;$this[0].scrollBy(textDragDistanceAway/2);}
function clearTextSelectionInterval()
{if(textSelectionInterval){clearInterval(textSelectionInterval);textSelectionInterval=undefined;}}
function onTextSelectionScrollMouseMove(e)
{var offset=$this.parent().offset().top;var maxOffset=offset+paneHeight;var mouseOffset=getPos(e,'Y');textDragDistanceAway=mouseOffset<offset?mouseOffset-offset:(mouseOffset>maxOffset?mouseOffset-maxOffset:0);if(textDragDistanceAway==0){clearTextSelectionInterval();}else{if(!textSelectionInterval){textSelectionInterval=setInterval(onTextSelectionInterval,100);}}}
function onSelectScrollMouseUp(e)
{$(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging');clearTextSelectionInterval();}
$container.bind('mousedown.jScrollPane',onSelectScrollMouseDown);$.jScrollPane.active.push($this[0]);}else{$this.css({'height':paneHeight+'px','width':paneWidth-this.originalSidePaddingTotal+'px','padding':this.originalPadding});$this[0].scrollTo=$this[0].scrollBy=function(){};$this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane');}})};$.fn.jScrollPaneRemove=function()
{$(this).each(function()
{$this=$(this);var $c=$this.parent();if($c.is('.jScrollPaneContainer')){$this.css({'top':'','height':'','width':'','padding':'','overflow':'','position':''});$c.after($this).remove();}});}
$.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false,tabIndex:0,enableKeyboardNavigation:true,animateToInternalLinks:false};$(window).bind('unload',function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);