(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);(function(A){A.fn.bgIframe=A.fn.bgiframe=function(C){if(A.browser.msie&&/6.0/.test(navigator.userAgent)){C=A.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},C||{});var D=function(E){return E&&E.constructor==Number?E+"px":E},B='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+C.src+'"style="display:block;position:absolute;z-index:-1;'+(C.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(C.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":D(C.top))+";left:"+(C.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":D(C.left))+";width:"+(C.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":D(C.width))+";height:"+(C.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":D(C.height))+';"/>';return this.each(function(){if(A("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(B),this.firstChild)}})}return this}})(jQuery);(function(A){A.suggest=function(N,F){var C=A(N).attr("autocomplete","off");var E=A(document.createElement("ul"));var M=false;var D=0;var P=[];var O=0;if(F.resultsID.length>0){E.attr("id",F.resultsID)}if(F.resultsARIALive.length>0){E.attr("aria-live",F.resultsARIALive)}E.addClass(F.resultsClass).appendTo("body");I();A(window).load(I).resize(I);C.blur(function(){setTimeout(function(){E.hide()},200)});try{E.bgiframe()}catch(R){}if(A.browser.mozilla){C.keypress(L)}else{C.keydown(L)}function I(){var V=C.offset();E.css({top:(V.top+N.offsetHeight)+"px",left:V.left+"px"})}function L(V){if((/27$|38$|40$/.test(V.keyCode)&&E.is(":visible"))||(/^13$|^9$/.test(V.keyCode)&&T())){if(V.preventDefault){V.preventDefault()}if(V.stopPropagation){V.stopPropagation()}V.cancelBubble=true;V.returnValue=false;switch(V.keyCode){case 38:J();break;case 40:S();break;case 9:case 13:Q();break;case 27:E.hide();break}}else{if(C.val().length!=D){if(M){clearTimeout(M)}M=setTimeout(K,F.delay);D=C.val().length}}}function K(){var V=A.trim(C.val());if(V.length>=F.minchars){cached=U(V);if(cached){H(cached.items)}else{A.get(F.source,{q:V},function(W){E.hide();var X=B(W,V);H(X);G(V,X,W.length)})}}else{E.hide()}}function U(W){for(var V=0;V<P.length;V++){if(P[V]["q"]==W){P.unshift(P.splice(V,1)[0]);return P[0]}}return false}function G(Y,V,W){while(P.length&&(O+W>F.maxCacheSize)){var X=P.pop();O-=X.size}P.push({q:Y,size:W,items:V});O+=W}function H(V){if(!V){return }if(!V.length){E.hide();return }var X="";for(var W=0;W<V.length;W++){X+="<li>"+V[W]+"</li>"}E.html(X).show();E.children("li").mouseover(function(){E.children("li").removeClass(F.selectClass);A(this).addClass(F.selectClass)}).click(function(Y){Y.preventDefault();Y.stopPropagation();Q()})}function B(V,Z){var W=[];var a=V.split(F.delimiter);for(var Y=0;Y<a.length;Y++){var X=A.trim(a[Y]);if(X){X=X.replace(new RegExp(Z,"ig"),function(b){return'<span class="'+F.matchClass+'">'+b+"</span>"});W[W.length]=X}}return W}function T(){if(!E.is(":visible")){return false}var V=E.children("li."+F.selectClass);if(!V.length){V=false}return V}function Q(){$currentResult=T();if($currentResult){C.val($currentResult.text());E.hide();if(F.onSelect){F.onSelect.apply(C[0])}}}function S(){$currentResult=T();if($currentResult){$currentResult.removeClass(F.selectClass).next().addClass(F.selectClass)}else{E.children("li:first-child").addClass(F.selectClass)}$currentResult=T();if($currentResult){C.val(A($currentResult).text())}}function J(){$currentResult=T();if($currentResult){$currentResult.removeClass(F.selectClass).prev().addClass(F.selectClass)}else{E.children("li:last-child").addClass(F.selectClass)}$currentResult=T();if($currentResult){C.val(A($currentResult).text())}}};A.fn.suggest=function(C,B){if(!C){return }B=B||{};B.source=C;B.delay=B.delay||100;B.resultsClass=B.resultsClass||"ac_results";B.selectClass=B.selectClass||"ac_over";B.matchClass=B.matchClass||"ac_match";B.minchars=B.minchars||2;B.delimiter=B.delimiter||"\n";B.onSelect=B.onSelect||false;B.maxCacheSize=B.maxCacheSize||65536;B.resultsID=B.resultsID||"";B.resultsARIALive=B.resultsARIALive||"";this.each(function(){new A.suggest(this,B)});return this}})(jQuery);
