// Accessifyhtml5.js
var AccessifyHTML5=function(b){var a={article:{role:"article"},aside:{role:"complementary"},nav:{role:"navigation"},output:{"aria-live":"polite"},section:{role:"region"},"[required]":{"aria-required":"true"}};if(b){if(b.header){a[b.header]={role:"banner"}}if(b.footer){a[b.footer]={role:"contentinfo"}}}$.each(a,function(c,d){$(c).attr(d)})};
// jQuery Tools dev - The missing UI library for the Web * http://flowplayer.org/tools/
// Mods by Udzzis:
// 1) removed isDefaultPrevented() checks due to FF<>jQuery bug,
// 2) removed self.isShown() check to really show tooltips at ALL times, not 90..95%,
// 3) added static method $.tools.tooltip.block() - disable/enable tooltips at runtime.
(function($){$.tools=$.tools||{version:'@VERSION'};$.tools.tooltip={blocked:false,conf:{effect:'toggle',fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:['top','center'],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:'<div/>',tipClass:'tooltip'},addEffect:function(name,loadFn,hideFn){effects[name]=[loadFn,hideFn]},block:function(){$.tools.tooltip.blocked=!$.tools.tooltip.blocked}};var effects={toggle:[function(done){var conf=this.getConf(),tip=this.getTip(),o=conf.opacity;if(o<1){tip.css({opacity:o})}tip.show();done.call()},function(done){this.getTip().hide();done.call()}],fade:[function(done){var conf=this.getConf();this.getTip().fadeTo(conf.fadeInSpeed,conf.opacity,done)},function(done){this.getTip().fadeOut(this.getConf().fadeOutSpeed,done)}]};function getPosition(trigger,tip,conf){var top=conf.relative?trigger.position().top:trigger.offset().top,left=conf.relative?trigger.position().left:trigger.offset().left,pos=conf.position[0];top-=tip.outerHeight()-conf.offset[0];left+=trigger.outerWidth()+conf.offset[1];if(/iPad/i.test(navigator.userAgent)){top-=$(window).scrollTop()}var height=tip.outerHeight()+trigger.outerHeight();if(pos=='center'){top+=height/2}if(pos=='bottom'){top+=height}pos=conf.position[1];var width=tip.outerWidth()+trigger.outerWidth();if(pos=='center'){left-=width/2}if(pos=='left'){left-=width}return{top:top,left:left}}function Tooltip(trigger,conf){var self=this,fire=trigger.add(self),tip,timer=0,pretimer=0,title=trigger.attr("title"),tipAttr=trigger.attr("data-tooltip"),effect=effects[conf.effect],shown,isInput=trigger.is(":input"),isWidget=isInput&&trigger.is(":checkbox, :radio, select, :button, :submit"),type=trigger.attr("type"),evt=conf.events[type]||conf.events[isInput?(isWidget?'widget':'input'):'def'];if(!effect){throw"Nonexistent effect \""+conf.effect+"\"";}evt=evt.split(/,\s*/);if(evt.length!=2){throw"Tooltip: bad events configuration for "+type;}trigger.bind(evt[0],function(e){if($.tools.tooltip.blocked){return self}clearTimeout(timer);if(conf.predelay){pretimer=setTimeout(function(){self.show(e)},conf.predelay)}else{self.show(e)}}).bind(evt[1],function(e){if($.tools.tooltip.blocked){return self}clearTimeout(pretimer);if(conf.delay){timer=setTimeout(function(){self.hide(e)},conf.delay)}else{self.hide(e)}});if(title&&conf.cancelDefault){trigger.removeAttr("title");trigger.data("title",title)}$.extend(self,{show:function(e){if(!tip){if(tipAttr){tip=$(tipAttr)}else if(conf.tip){tip=$(conf.tip).eq(0)}else if(title){tip=$(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide().append(title)}else{tip=trigger.next();if(!tip.length){tip=trigger.parent().next()}}if(!tip.length){throw"Cannot find tooltip for "+trigger;}}tip.stop(true,true);var pos=getPosition(trigger,tip,conf);if(conf.tip){tip.html(trigger.data("title"))}e=e||$.Event();e.type="onBeforeShow";fire.trigger(e,[pos]);pos=getPosition(trigger,tip,conf);tip.css({position:'absolute',top:pos.top,left:pos.left});shown=true;effect[0].call(self,function(){e.type="onShow";shown='full';fire.trigger(e)});var event=conf.events.tooltip.split(/,\s*/);if(!tip.data("__set")){tip.bind(event[0],function(){clearTimeout(timer);clearTimeout(pretimer)});if(event[1]&&!trigger.is("input:not(:checkbox, :radio), textarea")){tip.bind(event[1],function(e){if(e.relatedTarget!=trigger[0]){trigger.trigger(evt[1].split(" ")[0])}})}tip.data("__set",true)}return self},hide:function(e){if(!tip||!self.isShown()){return self}e=e||$.Event();e.type="onBeforeHide";fire.trigger(e);shown=false;effects[conf.effect][1].call(self,function(){e.type="onHide";fire.trigger(e)});return self},isShown:function(fully){return fully?shown=='full':shown},getConf:function(){return conf},getTip:function(){return tip},getTrigger:function(){return trigger}});$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,name){if($.isFunction(conf[name])){$(self).bind(name,conf[name])}self[name]=function(fn){if(fn){$(self).bind(name,fn)}return self}})}$.fn.tooltip=function(conf){var api=this.data("tooltip");if(api){return api}conf=$.extend(true,{},$.tools.tooltip.conf,conf);if(typeof conf.position=='string'){conf.position=conf.position.split(/,?\s/)}this.each(function(){api=new Tooltip($(this),conf);$(this).data("tooltip",api)});return conf.api?api:this}})(jQuery);
(function(a){var b=a.tools.tooltip;b.dynamic={conf:{classNames:"top right bottom left"}};function c(b){var c=a(window),d=c.width()+c.scrollLeft(),e=c.height()+c.scrollTop();return[b.offset().top<=c.scrollTop(),d<=b.offset().left+b.width(),e<=b.offset().top+b.height(),c.scrollLeft()>=b.offset().left]}function d(a){var b=a.length;while(b--)if(a[b])return!1;return!0}a.fn.dynamic=function(e){typeof e=="number"&&(e={speed:e}),e=a.extend({},b.dynamic.conf,e);var f=e.classNames.split(/\s/),g;this.each(function(){var b=a(this).tooltip().onBeforeShow(function(b,h){var i=this.getTip(),j=this.getConf();g||(g=[j.position[0],j.position[1],j.offset[0],j.offset[1],a.extend({},j)]),a.extend(j,g[4]),j.position=[g[0],g[1]],j.offset=[g[2],g[3]],i.css({visibility:"hidden",position:"absolute",top:h.top,left:h.left}).show();var k=c(i);if(!d(k)){k[2]&&(a.extend(j,e.top),j.position[0]="top",i.addClass(f[0])),k[3]&&(a.extend(j,e.right),j.position[1]="right",i.addClass(f[1])),k[0]&&(a.extend(j,e.bottom),j.position[0]="bottom",i.addClass(f[2])),k[1]&&(a.extend(j,e.left),j.position[1]="left",i.addClass(f[3]));if(k[0]||k[2])j.offset[0]*=-1;if(k[1]||k[3])j.offset[1]*=-1}i.css({visibility:"visible"}).hide()});b.onBeforeShow(function(){var a=this.getConf(),b=this.getTip();setTimeout(function(){a.position=[g[0],g[1]],a.offset=[g[2],g[3]]},0)}),b.onHide(function(){var a=this.getTip();a.removeClass(e.classNames)}),ret=b});return e.api?ret:this}})(jQuery);
(function(a){var b=a.tools.tooltip;a.extend(b.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!a.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.addEffect("slide",function(a){var b=this.getConf(),d=this.getTip(),e=b.slideFade?{opacity:b.opacity}:{},f=c[b.direction]||c.up;e[f[1]]=f[0]+"="+b.slideOffset,b.slideFade&&d.css({opacity:0}),d.show().animate(e,b.slideInSpeed,a)},function(b){var d=this.getConf(),e=d.slideOffset,f=d.slideFade?{opacity:0}:{},g=c[d.direction]||c.up,h=""+g[0];d.bounce&&(h=h=="+"?"-":"+"),f[g[1]]=h+"="+e,this.getTip().animate(f,d.slideOutSpeed,function(){a(this).hide(),b.call()})})})(jQuery);
// jQuery Cookie plugin * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null};
// preloadImages : modified by Udzzis * http://activeden.net/forums/thread/wanted-jquery-image-loader/26301?page=2#245968
(function($){$.fn.preloadImages=function(options){var defaults={showSpeed:500};var options=$.extend(defaults,options);return this.each(function(){var container=$(this);var image=container.find("img");$(image).css({"visibility":"hidden","opacity":"0"});$(image).bind('load',function(){$(this).css({"visibility":"visible"}).animate({opacity:"1"},{duration:options.showSpeed}).parent(container).css("background-image","none").removeClass("preload")}).bind('error',function(){$(this).parent(container).css("background-image","none").removeClass("preload").addClass("preloaderr")}).each(function(){if(this.complete||($.browser.msie&&parseInt($.browser.version)==6)){$(this).trigger("load")}})})}})(jQuery);
// jQuery history plugin * http://tkyk.github.com/jquery-history-plugin/
(function($){var locationWrapper={put:function(hash,win){(win||window).location.hash=this.encoder(hash)},get:function(win){var hash=((win||window).location.hash).replace(/^#/,'');try{return $.browser.mozilla?hash:decodeURIComponent(hash)}catch(error){return hash}},encoder:encodeURIComponent};var iframeWrapper={id:"__jQuery_history",init:function(){var html='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';$("body").prepend(html);return this},_document:function(){return $("#"+this.id)[0].contentWindow.document},put:function(hash){var doc=this._document();doc.open();doc.close();locationWrapper.put(hash,doc)},get:function(){return locationWrapper.get(this._document())}};function initObjects(options){options=$.extend({unescape:false},options||{});locationWrapper.encoder=encoder(options.unescape);function encoder(unescape_){if(unescape_===true){return function(hash){return hash}}if(typeof unescape_=="string"&&(unescape_=partialDecoder(unescape_.split("")))||typeof unescape_=="function"){return function(hash){return unescape_(encodeURIComponent(hash))}}return encodeURIComponent}function partialDecoder(chars){var re=new RegExp($.map(chars,encodeURIComponent).join("|"),"ig");return function(enc){return enc.replace(re,decodeURIComponent)}}}var implementations={};implementations.base={callback:undefined,type:undefined,check:function(){},load:function(hash){},init:function(callback,options){initObjects(options);self.callback=callback;self._options=options;self._init()},_init:function(){},_options:{}};implementations.timer={_appState:undefined,_init:function(){var current_hash=locationWrapper.get();self._appState=current_hash;self.callback(current_hash);setInterval(self.check,100)},check:function(){var current_hash=locationWrapper.get();if(current_hash!=self._appState){self._appState=current_hash;self.callback(current_hash)}},load:function(hash){if(hash!=self._appState){locationWrapper.put(hash);self._appState=hash;self.callback(hash)}}};implementations.iframeTimer={_appState:undefined,_init:function(){var current_hash=locationWrapper.get();self._appState=current_hash;iframeWrapper.init().put(current_hash);self.callback(current_hash);setInterval(self.check,100)},check:function(){var iframe_hash=iframeWrapper.get(),location_hash=locationWrapper.get();if(location_hash!=iframe_hash){if(location_hash==self._appState){self._appState=iframe_hash;locationWrapper.put(iframe_hash);self.callback(iframe_hash)}else{self._appState=location_hash;iframeWrapper.put(location_hash);self.callback(location_hash)}}},load:function(hash){if(hash!=self._appState){locationWrapper.put(hash);iframeWrapper.put(hash);self._appState=hash;self.callback(hash)}}};implementations.hashchangeEvent={_init:function(){self.callback(locationWrapper.get());$(window).bind('hashchange',self.check)},check:function(){self.callback(locationWrapper.get())},load:function(hash){locationWrapper.put(hash)}};var self=$.extend({},implementations.base);if($.browser.msie&&($.browser.version<8||document.documentMode<8)){self.type='iframeTimer'}else if("onhashchange"in window){self.type='hashchangeEvent'}else{self.type='timer'}$.extend(self,implementations[self.type]);$.history=self})(jQuery);
// vertically center div in viewport when parent is an absolute positioned div - for fuzz/loading (I like a bit above center)
(function($){$.fn.vCenter=function(options){var pos={sTop:function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight}};return this.each(function(index){if(index===0){var $this=$(this);var elHeight=$this.height();var elTop=pos.sTop()+(pos.wHeight()/2)-elHeight-50-parseFloat($this.parent('div').css('top'));$this.css({position:'absolute',marginTop:'0',top:elTop})}})}})(jQuery);
// resize html container (after ajax get)
(function($){$.fn.showHtml=function(html,speed,callback){return this.each(function(){var el=$(this);var finish={width:this.style.width,height:this.style.height};var cur={width:el.width()+'px',height:el.height()+'px'};el.html(html);var next={width:el.width()+'px',height:el.height()+'px'};el.css(cur).animate(next,speed,function(){el.css(finish)});if($.isFunction(callback)){callback()}})}})(jQuery);
// Linkselect jQuery Plug-in * Copyright 2011 Giva, Inc. (http://www.givainc.com/labs/) 
// Mod by Udzzis: adding the linkselect container to division #ajax-content (not body) to prevent appending new containers to body and memory leak on each ajax page load 
(function(A){A.linkselect={version:"1.2.09"};A.fn.linkselect=function(E){var F=typeof arguments[0]=="string"&&arguments[0];var D=F&&Array.prototype.slice.call(arguments,1)||arguments;if(F&&this.length){var C=A.data(this[0],"linkselect");if(F.toLowerCase()=="object"){return C}else{if(C[F]){var B;this.each(function(G){var H=A.data(this,"linkselect")[F].apply(C,D);if(G==0&&H){if(!!H.jquery){B=A([]).add(H)}else{B=H;return false}}else{if(!!H&&!!H.jquery){B=B.add(H)}}});return B||this}else{return this}}}else{return this.each(function(){new A.LinkSelect(this,E)})}};A.LinkSelect=function(k,R){R=A.extend({},A.LinkSelect.defaults,R);var J=this,f=k,l=A(k),W={},Y=false,L=0,X,F=false;this.id=l.attr("id");this.val=function(p,o){if(arguments.length>0){h(p,o);return K}else{return Z.val()}};this.focus=function(){setTimeout(function(){K.focus()},1);return K};this.blur=function(){setTimeout(function(){K.blur()},1);return K};this.open=function(p,o){if(Y){return K}A(document).triggerHandler("click.linkselect");if(o!==false){K.trigger("focus")}setTimeout(function(){g(p)},1);return K};this.disable=function(o){Y=o;K.parent().find("span."+R.classDisabled).remove();K[Y?"hide":"show"]();if(Y){K.after('<span class="'+R.classDisabled+'">'+K.html()+"</span>")}return K};this.replaceOptions=function(o,p){l.children("option").remove();A.each(o,function(q){var r=A("<option/>").attr("value",this.value).html(this.text);if(this.selected==true){r.attr("selected","selected")}if(this.className){r.addClass(this.className)}r.appendTo(l)});O();C();Q().trigger("click.linkselect",[true,p])};var a=m();l.after(a).remove();var Z=a.filter("input");var K=a.filter("a");var H=a.filter("div");var P=a.find(".scrollable");var I=a.find(".title");var S=H.find("ul");var U;Z.addClass(l.attr("class"));A.data(Z[0],"linkselect",this);H.appendTo("#ajax-content").bind("mousemove.linkselect",function(o){U=o});function C(){S.find("li").bind("mouseover.linkselect",function(o){if(U&&U.type=="keydown"){return }d(A(this));U=o}).bind("click.linkselect",function(t,p,s){t.preventDefault();var o=Q().removeClass(R.classSelected);var q=A(this).addClass(R.classSelected);var r=q.attr("rel")||"";var u=q.find("."+R.classValue).html();G(p);if((s!==false)&&((A.isFunction(R.change)&&(R.change.apply(J,[this,r,u,s])===false))||(A.isFunction(l[0].onchange)&&(l[0].onchange.apply(J,[this,r,u,s])===false)))){o.addClass(R.classSelected);q.removeClass(R.classSelected);return }Z.val(r);K.html(u)[(p!==true)?"trigger":"triggerHandler"]("focus",[p]);if(Y){K.parent().find("span."+R.classDisabled).html(u)}})}C();K.bind("click.linkselect",function(o){o.preventDefault();e();if(A.browser.msie){setTimeout(function(){K.trigger("focus.linkselect")},0)}}).bind("focus.linkselect",function(p,o){if(!H.is(":visible")&&(o!==true)){K.addClass(R.classLinkFocus)}}).bind("blur.linkselect",function(o){if(n(o)){G()}K.removeClass(R.classLinkFocus)}).bind((A.browser.safari?"keydown":"keypress")+".linkselect",function(t,s){if(!!s){var t=s}var p=t.keyCode||t.charCode,r=String.fromCharCode(p).toLowerCase();switch(p){case 38:case 40:t.preventDefault();b((p==38)?-1:1);U=t;break;case 13:t.preventDefault();if(H.is(":visible")){H.find("li."+R.classCurrent).trigger("click.linkselect")}else{K.trigger("click.linkselect")}break;case 9:case 27:G();break;case 35:t.preventDefault();M();U=t;break;case 36:t.preventDefault();V();U=t;break;case 33:case 34:t.preventDefault();var o=H.is(":visible");if(!o){H.show()}var q=parseInt(P.height()/S.find("li:first").outerHeight(),10);if(!o){H.hide()}b((p==33)?q*-1:q);break}if(r!=X){L=0}X=r;if(typeof W[r]!="undefined"){if(L>=W[r].length){L=0}S.find("#"+J.id+"_li_"+W[r][L]).trigger("click.linkselect");t.preventDefault();t.stopPropagation();L++}});if(A.browser.msie){K.bind("keydown.linkselect",function(o){if(",8,9,33,34,35,36,37,38,39,40,".indexOf(","+o.keyCode+",")>-1){return A(this).triggerHandler("keypress.linkselect",[o])}})}A(document).bind("click.linkselect",function(o){if((o.target!==K[0])&&(o.target!==P[0])&&H.is(":visible")){G();K.removeClass(R.classLinkFocus)}});A(window).resize(function(){if(F){N(K,H,true)}});function m(){var t=J.id;var s=l.attr("title");var r=f.selectedIndex==-1?"":f[f.selectedIndex].text;var q=f.selectedIndex==-1?"":f[f.selectedIndex][(A.browser.msie&&A.browser.version<=7&&!(f[f.selectedIndex].attributes.value.specified))?"text":"value"];var p=l.attr("tabindex");var o=['<a href="#'+J.id+'" id="'+J.id+'_link" class="'+R.classLink+'"'+(p?' tabindex="'+p+'"':"")+">"+r+"</a>",'<input type="hidden" name="'+J.id+'" id="'+J.id+'" value="'+q+'" />','<div class="'+R.classContainer+'">',(s)?'<div class="title"><span>'+s+"</span></div>":"",'<div class="scrollable"><ul id="'+J.id+'_list">',i(l.children("option")),"</ul></div>","</div>"];return A(o.join(""))}function i(o){W=[];var p=[];o.each(function(s){var w=A(this);var u=w.is(":selected");var q=A.trim(w.text());var r='<span class="'+R.classValue+'">'+q+"</span>";var v=A.browser.msie&&A.browser.version<=7&&!(this.attributes.value.specified)?this.text:this.value;if(A.isFunction(R.format)){r=R.format.apply(J,[r,v,q,s,w,R])||r}var t=(q.length>1)?q.substring(0,1).toLowerCase():"";if(!W[t]){W[t]=[]}W[t].push(s);var x=A.trim(this.className+" "+(u?R.classSelected:""));p.push('<li id="'+J.id+"_li_"+s+'" rel="'+v+(x.length>0?'" class="'+x:"")+'">'+r+"</li>")});return p.join("")}function O(){E=false;H[0].style.width="";if(I.length){I[0].style.width="";I.css("float","")}S.html(i(l.children("option")))}function h(q,p){var o=S.find("li[rel="+q+"]");if(o.length==0){o=S.find("li:eq(0)")}return o.trigger("click.linkselect",[true,p])}function Q(){var o=S.find("li.selected");if(o.length==0){o=S.find("li:eq(0)")}return o}function T(){var o=S.find("li.current");if(o.length==0){o=Q()}return o}function d(o){H.find(".current").removeClass(R.classCurrent);o.addClass(R.classCurrent);return o}function b(p){var o=T();var q=parseInt(o.attr("id").replace(/(.+)(_(\d+$))/gi,"$3"),10);D(q+p)}function D(r){var q=A("li",H),o;if(!q||q.length==0){return false}var p=T().removeClass(R.classCurrent);if(isNaN(r)||r<0){o=q.eq(0)}else{if(r>q.length-1){o=q.eq(q.length-1)}else{o=q.eq(r)}}if(H.is(":visible")){o.addClass(R.classCurrent);B(o)}else{if(p[0]!==o[0]){o.trigger("click.linkselect")}}}function V(){D(0)}function M(){D(l.children("option").length-1)}function B(p,o){var r=p[0];var t=P[0];var q={pTop:parseInt(P.css("paddingTop"),10)||0,pBottom:parseInt(P.css("paddingBottom"),10)||0,bTop:parseInt(P.css("borderTopWidth"),10)||0,bBottom:parseInt(P.css("borderBottomWidth"),10)||0};if((r.offsetTop+r.offsetHeight)>(t.scrollTop+t.clientHeight)){t.scrollTop=p.offset().top+(t.scrollTop-P.offset().top)-((t.clientHeight/((o==true)?2:1))-(p.outerHeight()+q.pBottom))}else{if(r.offsetTop-q.bTop-q.bBottom<=(t.scrollTop+q.pTop+q.pBottom)){t.scrollTop=p.offset().top+(t.scrollTop-P.offset().top)-q.pTop}}}function e(){if(H.is(":visible")){G()}else{g()}}var E=false;function g(u){var p=Q();K.removeClass(R.classLinkFocus).addClass(R.classLinkOpen);H.show();if(!E){var t=(K.css("display").indexOf("inline")>-1)?K.parent().outerWidth():K.outerWidth();var q=R.fixedWidth?t:H.width();if(q<t){q=t}var s=parseInt(P.css("max-height"),10);if(A.browser.msie&&A.browser.version<=6){if((s>0)&&(P.height()>s)){P.height(s)}}if(S.height()>s){q+=25}var r=parseInt("0"+H.css("max-width"),10);if((r>0)&&(q>r)){q=t=r}H.width(q);if(A.browser.safari){var o=H.width();if(t>o){q=t=o}}I.width(t);if(I.outerWidth()>t){I.width(t-(I.outerWidth()-t))}if(R.titleAlign.toLowerCase()=="right"&&!R.fixedWidth){I.css("float","right")}E=true}N(K,H,true);if(!!A.fn.bgIframe){H.bgIframe()}B(p,true);d(p);if(A.isFunction(R.open)){R.open.apply(this,[H,K,p,I])}if(A.isFunction(u)){u.apply(this,[H,K,p,I])}F=true}function G(o){if(o!==true){K.addClass(R.classLinkFocus).removeClass(R.classLinkOpen)}H.hide();if(A.isFunction(R.close)){R.close.apply(this,[H,K,Q(),I])}F=false}function c(o){var p=false;if(o.is(":hidden")){p=!!o.css("visibility","hidden").show()}var q=A.extend(o.offset(),{width:o.outerWidth(),height:o.outerHeight(),marginLeft:parseInt(A.curCSS(o[0],"marginLeft",true),10)||0,marginRight:parseInt(A.curCSS(o[0],"marginRight",true),10)||0,marginTop:parseInt(A.curCSS(o[0],"marginTop",true),10)||0,marginBottom:parseInt(A.curCSS(o[0],"marginBottom",true),10)||0});if(q.marginTop<0){q.top+=q.marginTop}if(q.marginLeft<0){q.left+=q.marginLeft}q.bottom=q.top+q.height;q.right=q.left+q.width;if(p){o.hide().css("visibility","visible")}return q}function N(s,o){var u=c(s);var t=j();var q=H.outerWidth()+u.left;if(q>t.x){u.left=(u.left-H.outerWidth())+I.outerWidth()}else{var r=H.outerWidth(),p=I.outerWidth();if(r>p){I.width(r-(p-I.width()))}}o.css({position:"absolute",top:u[R.yAxis],left:u.left});return u.bottom}function j(){var o={scrollLeft:A(window).scrollLeft(),scrollTop:A(window).scrollTop(),width:A("body").width(),height:A("body").height()};o.x=o.scrollLeft+o.width;o.y=o.scrollTop+o.height;return o}function n(o){return !("bubbles" in o||"cancelBubble" in o)}if(A.isFunction(R.init)){R.init.apply(this,[l,Z,K,H,P,I,S])}};A.LinkSelect.defaults={classLink:"linkselectLink",classLinkOpen:"linkselectLinkOpen",classLinkFocus:"linkselectLinkFocus",classContainer:"linkselectContainer",classSelected:"selected",classCurrent:"current",classDisabled:"linkselectDisabled",classValue:"linkselectValue",yAxis:"top",titleAlign:"right",fixedWidth:false,init:null,change:null,format:null,open:null,close:null}})(jQuery);
// Fixes z-index issues *  www.davidtong.me/z-index-misconceptions-bugs-fixes/
(function($){$.fn.fixZIndex=function(params){params=params||{};if(params.msieOnly&&!$.browser.msie)return this;var num_of_jobj=this.length;for(var i=num_of_jobj;i--;){var curr_element=this[i];var config_recursive=params.recursive||true;var config_exclude=params.exclude||null;while(curr_element!=document.body){if(!$(curr_element).hasClass(config_exclude)&&($(curr_element).css('position')=='relative'||$(curr_element).css('position')=='absolute')){if($.data(curr_element,'zIndex')==undefined){$.data(curr_element,'zIndex',curr_element.style.zIndex||'-1')}curr_element.style.zIndex=params.zIndex||'9999'}curr_element=curr_element.parentNode;if(!config_recursive)break}}return this};$.fn.restoreZIndex=function(params){params=params||{};if(params.msieOnly&&!$.browser.msie)return this;var num_of_jobj=this.length;for(var i=num_of_jobj;i--;){var curr_element=this[i];var config_exclude=params.exclude||null;while(curr_element!=document.body){var currZIndex=$.data(curr_element,'zIndex');if(currZIndex>-1&&!$(curr_element).hasClass(config_exclude)){curr_element.style.zIndex=currZIndex;$.removeData(curr_element,'zIndex')}else if(currZIndex==-1){curr_element.style.zIndex=''}curr_element=curr_element.parentNode}}return this}})(jQuery);

