function returnNotBlank(c,d){var b="";for(x in d){$cur=$(d[x]);if($cur.length>0){if($cur.attr("type")=="text"&&$cur.val().replace(/^\s+|\s+$/g,"")!=""){b+=($cur.val()+"/")}else{if($cur.attr("type")=="checkbox"&&$cur.is(":checked")){b+=($cur.val()+"/")}else{if($cur.attr("type")=="radio"&&$cur.is(":checked")){b+=($cur.val()+"/")}}}}}if(b!=""){return(c+b.substring(0,b.length-1))}else{return""}}function relative_created_at(d){var b=Date.parse(d.replace(" +0000",""));var c=(arguments.length>1)?arguments[1]:new Date();var e=parseInt((c.getTime()-b)/1000)+(c.getTimezoneOffset()*60);if(e<59){return"less than a minute ago"}else{if(e<119){return"about a minute ago"}else{if(e<3000){return(parseInt(e/60)).toString()+" minutes ago"}else{if(e<5340){return"about an hour ago"}else{if(e<9000){return"a couple of hours ago"}else{if(e<82800){return"about "+(parseInt(e/3600)).toString()+" hours ago"}else{if(e<129600){return"a day ago"}else{if(e<172800){return"almost 2 days ago"}else{return(parseInt(e/86400)).toString()+" days ago"}}}}}}}}}function countWords(c){var b=0;a=c.replace(/\s/g," ");a=c.split(" ");for(z=0;z<a.length;z++){if(a[z].length>0){b++}}return b}function replaceSpace(d,f,c){var b="";var e="";a=f.replace(/\s/g," ");a=f.split(" ");for(z=1;z<=a.length;z++){if(z==d){e="<br/>"}else{if(z<a.length){e=" "}else{e=""}}b+=(a[z-1]+e)}return b}function halfTitles(f,c){if(f.outerWidth()>=c){var b=f.text();var e=countWords(b)-1;var d=Math.round(e/1.5);f.html(replaceSpace(d,b,"<br/>"))}}function urlify(b){return b.replace(/(|http|https):\/\/[\S]+(\b|$)/gim,'<a href="$&" target="_blank">$&</a>')}function tweetURL(b){return"http://twitter.com/ACEChess/statuses/"+b}(function(b){b.fn.hoverIntent=function(l,k){var m={sensitivity:7,interval:100,timeout:0};m=b.extend(m,k?{over:l,out:k}:l);var p,o,i,e;var h=function(f){p=f.pageX;o=f.pageY};var d=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(i-p)+Math.abs(e-o))<m.sensitivity){b(f).unbind("mousemove",h);f.hoverIntent_s=1;return m.over.apply(f,[g])}else{i=p;e=o;f.hoverIntent_t=setTimeout(function(){d(g,f)},m.interval)}};var j=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return m.out.apply(f,[g])};var c=function(r){var q=(r.type=="mouseover"?r.fromElement:r.toElement)||r.relatedTarget;while(q&&q!=this){try{q=q.parentNode}catch(r){q=this}}if(q==this){return false}var g=jQuery.extend({},r);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(r.type=="mouseover"){i=g.pageX;e=g.pageY;b(f).bind("mousemove",h);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){d(g,f)},m.interval)}}else{b(f).unbind("mousemove",h);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){j(g,f)},m.timeout)}}};return this.mouseover(c).mouseout(c)}})(jQuery);(function(c){c.fn.superfish=function(k){var g=c.fn.superfish,j=g.c,f=c(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var l=c(this),m=d(l);clearTimeout(m.sfTimer);l.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var l=c(this),p=d(l),m=g.op;clearTimeout(p.sfTimer);p.sfTimer=setTimeout(function(){m.retainPath=(c.inArray(l[0],m.$path)>-1);l.hideSuperfishUl();if(m.$path.length&&l.parents(["li.",m.hoverClass].join("")).length<1){i.call(m.$path)}},m.delay)},d=function(l){var m=l.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[m.serial];return m},h=function(l){l.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var l=this.serial=g.o.length;var p=c.extend({},g.defaults,k);p.$path=c("li."+p.pathClass,this).slice(0,p.pathLevels).each(function(){c(this).addClass([p.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(p.pathClass)});g.o[l]=g.op=p;c("li:has(ul)",this)[(c.fn.hoverIntent&&!p.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(p.autoArrows){h(c(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var m=c("a",this);m.each(function(o){var q=m.eq(o).parents("li");m.eq(o).focus(function(){i.call(q)}).blur(function(){e.call(q)})});p.onInit.call(this)}).each(function(){var l=[j.menuClass];if(g.op.dropShadows&&!(c.browser.msie&&c.browser.version<7)){l.push(j.shadowClass)}c(this).addClass(l.join(" "))})};var b=c.fn.superfish;b.o=[];b.op={};b.IE7fix=function(){var d=b.op;if(c.browser.msie&&c.browser.version>6&&d.dropShadows&&d.animation.opacity!=undefined){this.toggleClass(b.c.shadowClass+"-off")}};b.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};b.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};c.fn.extend({hideSuperfishUl:function(){var f=b.op,e=(f.retainPath===true)?f.$path:"";f.retainPath=false;var d=c(["li.",f.hoverClass].join(""),this).add(this).not(e).removeClass(f.hoverClass).find(">ul").hide().css("visibility","hidden");f.onHide.call(d);return this},showSuperfishUl:function(){var f=b.op,e=b.c.shadowClass+"-off",d=this.addClass(f.hoverClass).find(">ul:hidden").css("visibility","visible");b.IE7fix.call(d);f.onBeforeShow.call(d);d.animate(f.animation,f.speed,function(){b.IE7fix.call(d);f.onShow.call(d)});return this}})})(jQuery);(function(b){b.fn.supersubs=function(c){var d=b.extend({},b.fn.supersubs.defaults,c);return this.each(function(){var e=b(this);var f=b.meta?b.extend({},d,e.data()):d;var g=b('<li id="menu-fontsize">&#8212;</li>').css({padding:0,position:"absolute",top:"-999em",width:"auto"}).appendTo(e).width();b("#menu-fontsize").remove();$ULs=e.find("ul");$ULs.each(function(m){var l=$ULs.eq(m);var k=l.children();var h=k.children("a");var o=k.css("white-space","nowrap").css("float");var j=l.add(k).add(h).css({"float":"none",width:"auto"}).end().end()[0].clientWidth/g;j+=f.extraWidth;if(j>f.maxWidth){j=f.maxWidth}else{if(j<f.minWidth){j=f.minWidth}}j+="em";l.css("width",j);k.css({"float":o,width:"100%","white-space":"normal"}).each(function(){var p=b(">ul",this);var i=p.css("left")!==undefined?"left":"right";p.css(i,j)})})})};b.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);(function(b){b.fn.innerfade=function(c){return this.each(function(){b.innerfade(this,c)})};b.innerfade=function(c,d){var f={animationtype:"fade",speed:"normal",type:"sequence",timeout:2000,containerheight:"auto",runningclass:"innerfade",children:null};if(d){b.extend(f,d)}if(f.children===null){var h=b(c).children()}else{var h=b(c).children(f.children)}if(h.length>1){b(c).css("position","relative").css("height",f.containerheight).addClass(f.runningclass);for(var e=0;e<h.length;e++){b(h[e]).css("z-index",String(h.length-e)).css("position","absolute").hide()}if(f.type=="sequence"){setTimeout(function(){b.innerfade.next(h,f,1,0)},f.timeout);b(h[0]).show()}else{if(f.type=="random"){var g=Math.floor(Math.random()*(h.length));setTimeout(function(){do{j=Math.floor(Math.random()*(h.length))}while(g==j);b.innerfade.next(h,f,j,g)},f.timeout);b(h[g]).show()}else{if(f.type=="random_start"){f.type="sequence";var j=Math.floor(Math.random()*(h.length));setTimeout(function(){b.innerfade.next(h,f,(j+1)%h.length,j)},f.timeout);b(h[j]).show()}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}}}};b.innerfade.next=function(e,c,f,d){if(c.animationtype=="slide"){b(e[d]).slideUp(c.speed);b(e[f]).slideDown(c.speed)}else{if(c.animationtype=="fade"){b(e[d]).fadeOut(c.speed);b(e[f]).fadeIn(c.speed,function(){removeFilter(b(this)[0])})}else{alert("Innerfade-animationtype must either be 'slide' or 'fade'")}}if(c.type=="sequence"){if((f+1)<e.length){f=f+1;d=f-1}else{f=0;d=e.length-1}}else{if(c.type=="random"){d=f;while(f==d){f=Math.floor(Math.random()*e.length)}}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}setTimeout((function(){b.innerfade.next(e,c,f,d)}),c.timeout)}})(jQuery);function removeFilter(b){if(b.style.removeAttribute){b.style.removeAttribute("filter")}}(function(g){g.fn.jqm=function(f){var e={overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:q,ajaxText:"",target:q,modal:q,toTop:q,onShow:q,onHide:q,onLoad:q};return this.each(function(){if(this._jqm){return p[this._jqm].c=g.extend({},p[this._jqm].c,f)}r++;this._jqm=r;p[r]={c:g.extend(e,g.jqm.params,f),a:q,w:g(this).addClass("jqmID"+r),s:r};if(e.trigger){g(this).jqmAddTrigger(e.trigger)}})};g.fn.jqmAddClose=function(f){return o(this,f,"jqmHide")};g.fn.jqmAddTrigger=function(f){return o(this,f,"jqmShow")};g.fn.jqmShow=function(e){return this.each(function(){e=e||window.event;g.jqm.open(this._jqm,e)})};g.fn.jqmHide=function(e){return this.each(function(){e=e||window.event;g.jqm.close(this._jqm,e)})};g.jqm={hash:{},open:function(D,C){var m=p[D],v=m.c,i="."+v.closeClass,w=(parseInt(m.w.css("z-index"))),w=(w>0)?w:3000,f=g("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":w-1,opacity:v.overlay/100});if(m.a){return q}m.t=C;m.a=true;m.w.css("z-index",w);if(v.modal){if(!b[0]){l("bind")}b.push(D)}else{if(v.overlay>0){m.w.jqmAddClose(f)}else{f=q}}m.o=(f)?f.addClass(v.overlayClass).prependTo("body"):q;if(d){g("html,body").css({height:"100%",width:"100%"});if(f){f=f.css({position:"absolute"})[0];for(var A in {Top:1,Left:1}){f.style.setExpression(A.toLowerCase(),"(_=(document.documentElement.scroll"+A+" || document.body.scroll"+A+"))+'px'")}}}if(v.ajax){var e=v.target||m.w,B=v.ajax,e=(typeof e=="string")?g(e,m.w):g(e),B=(B.substr(0,1)=="@")?g(C).attr(B.substring(1)):B;e.html(v.ajaxText).load(B,function(){if(v.onLoad){v.onLoad.call(this,m)}if(i){m.w.jqmAddClose(g(i,m.w))}k(m)})}else{if(i){m.w.jqmAddClose(g(i,m.w))}}if(v.toTop&&m.o){m.w.before('<span id="jqmP'+m.w[0]._jqm+'"></span>').insertAfter(m.o)}(v.onShow)?v.onShow(m):m.w.show();k(m);return q},close:function(f){var e=p[f];if(!e.a){return q}e.a=q;if(b[0]){b.pop();if(!b[0]){l("unbind")}}if(e.c.toTop&&e.o){g("#jqmP"+e.w[0]._jqm).after(e.w).remove()}if(e.c.onHide){e.c.onHide(e)}else{e.w.hide();if(e.o){e.o.remove()}}return q},params:{}};var r=0,p=g.jqm.hash,b=[],d=g.browser.msie&&(g.browser.version=="6.0"),q=false,h=g('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),k=function(e){if(d){if(e.o){e.o.html('<p style="width:100%;height:100%"/>').prepend(h)}else{if(!g("iframe.jqm",e.w)[0]){e.w.prepend(h)}}}j(e)},j=function(f){try{g(":input:visible",f.w)[0].focus()}catch(e){}},l=function(e){g()[e]("keypress",c)[e]("keydown",c)[e]("mousedown",c)},c=function(m){var f=p[b[b.length-1]],i=(!g(m.target).parents(".jqmID"+f.s)[0]);if(i){j(f)}return !i},o=function(e,f,i){return e.each(function(){var m=this._jqm;g(f).each(function(){if(!this[i]){this[i]=[];g(this).click(function(){for(var u in {jqmShow:1,jqmHide:1}){for(var v in this[u]){if(p[this[u][v]]){p[this[u][v]].w[u](this)}}}return q})}this[i].push(m)})})}})(jQuery);(function(){var ua=navigator.userAgent.toLowerCase(),S={version:"3.0b",adapter:null,cache:[],client:{isIE:ua.indexOf("msie")>-1,isIE6:ua.indexOf("msie 6")>-1,isIE7:ua.indexOf("msie 7")>-1,isGecko:ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1,isWebkit:ua.indexOf("applewebkit/")>-1,isWindows:ua.indexOf("windows")>-1||ua.indexOf("win32")>-1,isMac:ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1,isLinux:ua.indexOf("linux")>-1},content:null,current:-1,dimensions:null,gallery:[],expando:"shadowboxCacheKey",libraries:{Prototype:"prototype",jQuery:"jquery",MooTools:"mootools",YAHOO:"yui",dojo:"dojo",Ext:"ext"},options:{adapter:null,animate:true,animateFade:true,autoplayMovies:true,continuous:false,ease:function(x){return 1+Math.pow(x-1,3)},enableKeys:true,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv","m4v"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"]},flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",language:"en",onChange:null,onClose:null,onFinish:null,onOpen:null,players:["img"],showMovieControls:true,skipSetup:false,slideshowDelay:0,useSizzle:true,viewportPadding:20},path:"",plugins:null,ready:false,regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},applyOptions:function(opts){if(opts){default_options=apply({},S.options);apply(S.options,opts)}},revertOptions:function(){apply(S.options,default_options)},change:function(index){if(!S.gallery){return}if(!S.gallery[index]){if(!S.options.continuous){return}else{index=index<0?S.gallery.length-1:0}}S.current=index;if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(S.options.onChange){S.options.onChange()}loadContent()},close:function(){if(!active){return}active=false;listenKeys(false);if(S.content){S.content.remove();S.content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(S.options.onClose){S.options.onClose()}S.skin.onClose();S.revertOptions()},contentId:function(){return content_id},error:function(msg){if(!S.debug){return}if(typeof window.console!="undefined"&&typeof console.log=="function"){console.log(msg)}else{alert(msg)}},getCurrent:function(){return S.current>-1?S.gallery[S.current]:null},hasNext:function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(S.options,opts)}for(var e in S.options.ext){S.regex[e]=new RegExp(".("+S.options.ext[e].join("|")+")s*$","i")}if(!S.path){var pathre=/(.+\/)shadowbox\.js/i,path;each(document.getElementsByTagName("script"),function(s){path=pathre.exec(s.src);if(path){S.path=path[1];return false}})}if(S.options.adapter){S.adapter=S.options.adapter.toLowerCase()}else{for(var lib in S.libraries){if(typeof window[lib]!="undefined"){S.adapter=S.libraries[lib];break}}if(!S.adapter){S.adapter="base"}}if(S.options.useSizzle&&!window.Sizzle){if(window.jQuery){window.Sizzle=jQuery.find}else{U.include(S.path+"libraries/sizzle/sizzle.js")}}if(!S.lang){U.include(S.path+"languages/shadowbox-"+S.options.language+".js")}each(S.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){U.include(S.path+"libraries/swfobject/swfobject.js")}if(!S[p]){U.include(S.path+"players/shadowbox-"+p+".js")}});if(!S.lib){U.include(S.path+"adapters/shadowbox-"+S.adapter+".js")}waitDom(waitLibs)},isActive:function(){return active},isPaused:function(){return slide_timer=="paused"},load:function(){if(S.ready){return}S.ready=true;if(S.skin.options){apply(S.options,S.skin.options);apply(S.options,init_options)}S.skin.init();if(!S.options.skipSetup){S.setup()}},next:function(){S.change(S.current+1)},open:function(obj){if(U.isLink(obj)){if(S.inCache(obj)){obj=S.cache[obj[S.expando]]}else{obj=S.buildCacheObj(obj)}}if(obj.constructor==Array){S.gallery=obj;S.current=0}else{if(!obj.gallery){S.gallery=[obj];S.current=0}else{S.current=null;S.gallery=[];each(S.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(S.current==null&&c.content==obj.content&&c.title==obj.title){S.current=S.gallery.length}S.gallery.push(c)}});if(S.current==null){S.gallery.unshift(obj);S.current=0}}}obj=S.getCurrent();if(obj.options){S.revertOptions();S.applyOptions(obj.options)}var item,remove,m,format,replace,oe=S.options.errors,msg,el;for(var i=0;i<S.gallery.length;++i){item=S.gallery[i]=apply({},S.gallery[i]);remove=false;if(m=S.regex.unsupported.exec(item.player)){if(S.options.handleUnsupported=="link"){item.player="html";switch(m[1]){case"qtwmp":format="either";replace=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":format="shared";replace=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:format="single";if(m[1]=="swf"||m[1]=="flv"){m[1]="fla"}replace=[oe[m[1]].url,oe[m[1]].name]}msg=S.lang.errors[format].replace(/\{(\d+)\}/g,function(m,n){return replace[n]});item.content='<div class="sb-message">'+msg+"</div>"}else{remove=true}}else{if(item.player=="inline"){m=S.regex.inline.exec(item.content);if(m){var el=U.get(m[1]);if(el){item.content=el.innerHTML}else{S.error("Cannot find element with id "+m[1])}}else{S.error("Cannot find element id for inline content")}}else{if(item.player=="swf"||item.player=="flv"){var version=(item.options&&item.options.flashVersion)||S.options.flashVersion;if(!swfobject.hasFlashPlayerVersion(version)){item.width=310;item.height=177}}}}if(remove){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}if(S.gallery.length){if(!active){if(typeof S.options.onOpen=="function"&&S.options.onOpen(obj)===false){return}S.skin.onOpen(obj,loadContent)}else{loadContent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused";if(S.skin.onPause){S.skin.onPause()}}},play:function(){if(!S.hasNext()){return}if(!slide_delay){slide_delay=S.options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;S.next()},slide_delay);if(S.skin.onPlay){S.skin.onPlay()}}},previous:function(){S.change(S.current-1)},setDimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseInt(height),w=width=parseInt(width),pad=parseInt(S.options.viewportPadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&S.options.handleOversize=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}S.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w}},setup:function(links,opts){each(S.findLinks(links),function(link){S.addCache(link,opts)})},teardown:function(links){each(S.findLinks(links),S.removeCache)},findLinks:function(links){if(!links){var links=[],rel;each(document.getElementsByTagName("a"),function(a){rel=a.getAttribute("rel");if(rel&&S.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.Sizzle){if(typeof links=="string"){links=Sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodeType){links=Sizzle(links[0],links[1])}}}}else{links=[links]}}return links},inCache:function(link){return typeof link[S.expando]=="number"&&S.cache[link[S.expando]]},addCache:function(link,opts){if(!S.inCache(link)){link[S.expando]=S.cache.length;S.lib.addEvent(link,"click",handleClick)}S.cache[link[S.expando]]=S.buildCacheObj(link,opts)},removeCache:function(link){S.lib.removeEvent(link,"click",handleClick);S.cache[link[S.expando]]=null;delete link[S.expando]},clearCache:function(){each(S.cache,function(obj){S.removeCache(obj.link)});S.cache=[]},buildCacheObj:function(link,opts){var obj={link:link,title:link.getAttribute("title"),options:apply({},opts||{}),content:link.href};if(opts){each(["player","title","height","width","gallery"],function(option){if(typeof obj.options[option]!="undefined"){obj[option]=obj.options[option];delete obj.options[option]}})}if(!obj.player){obj.player=S.getPlayer(obj.content)}var rel=link.getAttribute("rel");if(rel){var match=rel.match(S.regex.gallery);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(parameter){match=parameter.match(S.regex.param);if(match){if(match[1]=="options"){eval("apply(obj.options,"+match[2]+")")}else{obj[match[1]]=match[2]}}})}return obj},getPlayer:function(content){var r=S.regex,p=S.plugins,m=content.match(r.domain),same_domain=m&&document.domain==m[1];if(content.indexOf("#")>-1&&same_domain){return"inline"}var q=content.indexOf("?");if(q>-1){content=content.substring(0,q)}if(r.img.test(content)){return"img"}if(r.swf.test(content)){return p.fla?"swf":"unsupported-swf"}if(r.flv.test(content)){return p.fla?"flv":"unsupported-flv"}if(r.qt.test(content)){return p.qt?"qt":"unsupported-qt"}if(r.wmp.test(content)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(S.client.isMac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(r.qtwmp.test(content)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return S.client.isMac?"unsupported-qt":"unsupported-qtwmp"}return"iframe"}},U=S.util={animate:function(el,p,to,d,cb){var from=parseFloat(S.lib.getStyle(el,p));if(isNaN(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){U.setOpacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!S.options.animate)||(op&&!S.options.animateFade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new Date().getTime(),ease=S.options.ease,end=begin+d,time,timer=setInterval(function(){time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(cb){cb()}}else{fn(ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearOpacity:function(el){var s=el.style;if(window.ActiveXObject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i<len;++i){if(fn.call(scope||obj[i],obj[i],i,obj)===false){return}}},get:function(id){return document.getElementById(id)},include:function(){var includes={};return function(file){if(includes[file]){return}includes[file]=true;var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.src=file;head.appendChild(script)}}(),isLink:function(obj){if(!obj||!obj.tagName){return false}var up=obj.tagName.toUpperCase();return up=="A"||up=="AREA"},removeChildren:function(el){while(el.firstChild){el.removeChild(el.firstChild)}},setOpacity:function(el,o){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||"").replace(/\s*alpha\([^\)]*\)/gi,"")+(o==1?"":" alpha(opacity="+(o*100)+")")}else{s.opacity=o}}},apply=U.apply,each=U.each,init_options,initialized=false,default_options={},content_id="sb-content",active=false,slide_timer,slide_start,slide_delay=0;if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(p){names.push(p.name)});names=names.join();var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{function detectPlugin(n){try{var axo=new ActiveXObject(n)}catch(e){}return !!axo}S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}function waitDom(cb){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);cb()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);cb()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(S.ready){return}try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}cb()})()}}}if(typeof window.onload=="function"){var oldonload=window.onload;window.onload=function(){oldonload();cb()}}else{window.onload=cb}}function waitLibs(){setTimeout(function(){if(S.lib&&S.lang){S.load()}else{setTimeout(arguments.callee,0)}},0)}function handleClick(e){var link;if(U.isLink(this)){link=this}else{link=S.lib.getTarget(e);while(!U.isLink(link)&&link.parentNode){link=link.parentNode}}S.lib.preventDefault(e);if(link){S.open(link);if(S.gallery.length){S.lib.preventDefault(e)}}}function listenKeys(on){if(!S.options.enableKeys){return}S.lib[(on?"add":"remove")+"Event"](document,"keydown",handleKey)}function handleKey(e){var code=S.lib.keyCode(e),handler;switch(code){case 81:case 88:case 27:handler=S.close;break;case 37:handler=S.previous;break;case 39:handler=S.next;break;case 32:handler=typeof slide_timer=="number"?S.pause:S.play}if(handler){S.lib.preventDefault(e);handler()}}function loadContent(){var obj=S.getCurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof S[p]!="function"){S.error("Unknown player: "+p)}var change=false;if(S.content){S.content.remove();change=true;S.revertOptions();if(obj.options){S.applyOptions(obj.options)}}U.removeChildren(S.skin.bodyEl());S.content=new S[p](obj);listenKeys(false);S.skin.onLoad(S.content,change,function(){if(!S.content){return}if(typeof S.content.ready!="undefined"){var id=setInterval(function(){if(S.content){if(S.content.ready){clearInterval(id);id=null;S.skin.onReady(contentReady)}}else{clearInterval(id);id=null}},100)}else{S.skin.onReady(contentReady)}});if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}}function contentReady(){if(!S.content){return}S.content.append(S.skin.bodyEl(),content_id,S.dimensions);S.skin.onFinish(finishContent)}function finishContent(){if(!S.content){return}if(S.content.onLoad){S.content.onLoad()}if(S.options.onFinish){S.options.onFinish()}if(!S.isPaused()){S.play()}listenKeys(true)}window.Shadowbox=S})();(function(){var E=Shadowbox,F=E.util,r=false,J=[],w=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],u={markup:'<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><a onclick="Shadowbox.close()">{cancel}</a></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div style="clear:both"></div></div></div></div></div>',options:{animSequence:"sync",autoDimensions:false,counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.8,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]},init:function(){var e=u.markup.replace(/\{(\w+)\}/g,function(h,g){return E.lang[g]});E.lib.append(document.body,e);if(E.client.isIE6){F.get("sb-body").style.zoom=1;var c,f,d=/url\("(.*\.png)"\)/;F.each(w,function(g){c=F.get(g);if(c){f=E.lib.getStyle(c,"backgroundImage").match(d);if(f){c.style.backgroundImage="none";c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+f[1]+",sizingMethod=scale);"}}})}var b;E.lib.addEvent(window,"resize",function(){if(b){clearTimeout(b);b=null}if(E.isActive()){b=setTimeout(function(){u.onWindowResize();var g=E.content;if(g&&g.onWindowResize){g.onWindowResize()}},50)}})},bodyEl:function(){return F.get("sb-body-inner")},onOpen:function(c,f){G(false);var d=E.options.autoDimensions&&"height" in c?c.height:E.options.initialHeight,e=E.options.autoDimensions&&"width" in c?c.width:E.options.initialWidth;F.get("sb-container").style.display="block";var b=s(d,e);H(b.inner_h,b.top,false);D(b.width,b.left,false);C(f)},onLoad:function(c,b,d){A(true);B(b,function(){if(!c){return}if(!b){F.get("sb-wrapper").style.display=""}d()})},onReady:function(d){var b=E.content;if(!b){return}var c=s(b.height,b.width,b.resizable);u.resizeContent(c.inner_h,c.width,c.top,c.left,true,function(){y(d)})},onFinish:function(b){A(false,b)},onClose:function(){C();G(true)},onPlay:function(){I("play",false);I("pause",true)},onPause:function(){I("pause",false);I("play",true)},onWindowResize:function(){var b=E.content;if(!b){return}var c=s(b.height,b.width,b.resizable);D(c.width,c.left,false);H(c.inner_h,c.top,false);var d=F.get(E.contentId());if(d){if(b.resizable&&E.options.handleOversize=="resize"){d.height=c.resize_h;d.width=c.resize_w}}},resizeContent:function(g,f,c,d,e,h){var i=E.content;if(!i){return}var b=s(i.height,i.width,i.resizable);switch(E.options.animSequence){case"hw":H(b.inner_h,b.top,e,function(){D(b.width,b.left,e,h)});break;case"wh":D(b.width,b.left,e,function(){H(b.inner_h,b.top,e,h)});break;default:D(b.width,b.left,e);H(b.inner_h,b.top,e,h)}}};function v(){F.get("sb-container").style.top=document.documentElement.scrollTop+"px"}function G(b){if(b){F.each(J,function(c){c[0].style.visibility=c[1]||""})}else{J=[];F.each(E.options.troubleElements,function(c){F.each(document.getElementsByTagName(c),function(d){J.push([d,d.style.visibility]);d.style.visibility="hidden"})})}}function C(f){var e=F.get("sb-overlay"),d=F.get("sb-container"),b=F.get("sb-wrapper");if(f){if(E.client.isIE6){v();E.lib.addEvent(window,"scroll",v)}if(E.options.showOverlay){r=true;e.style.backgroundColor=E.options.overlayColor;F.setOpacity(e,0);if(!E.options.modal){E.lib.addEvent(e,"click",E.close)}b.style.display="none"}d.style.visibility="visible";if(r){var c=parseFloat(E.options.overlayOpacity);F.animate(e,"opacity",c,E.options.fadeDuration,f)}else{f()}}else{if(E.client.isIE6){E.lib.removeEvent(window,"scroll",v)}E.lib.removeEvent(e,"click",E.close);if(r){b.style.display="none";F.animate(e,"opacity",0,E.options.fadeDuration,function(){d.style.display="";b.style.display="";F.clearOpacity(e)})}else{d.style.visibility="hidden"}}}function I(b,d){var c=F.get("sb-nav-"+b);if(c){c.style.display=d?"":"none"}}function A(f,g){var d=F.get("sb-loading"),b=E.getCurrent().player,c=(b=="img"||b=="html");if(f){function e(){F.clearOpacity(d);if(g){g()}}F.setOpacity(d,0);d.style.display="";if(c){F.animate(d,"opacity",1,E.options.fadeDuration,e)}else{e()}}else{function e(){d.style.display="none";F.clearOpacity(d);if(g){g()}}if(c){F.animate(d,"opacity",0,E.options.fadeDuration,e)}else{e()}}}function K(l){var g=E.getCurrent();F.get("sb-title-inner").innerHTML=g.title||"";var d,m,i,c,o;if(E.options.displayNav){d=true;var e=E.gallery.length;if(e>1){if(E.options.continuous){m=o=true}else{m=(e-1)>E.current;o=E.current>0}}if(E.options.slideshowDelay>0&&E.hasNext()){c=!E.isPaused();i=!c}}else{d=m=i=c=o=false}I("close",d);I("next",m);I("play",i);I("pause",c);I("previous",o);var b="";if(E.options.displayCounter&&E.gallery.length>1){var e=E.gallery.length;if(E.options.counterType=="skip"){var h=0,j=e,k=parseInt(E.options.counterLimit)||0;if(k<e&&k>2){var f=Math.floor(k/2);h=E.current-f;if(h<0){h+=e}j=E.current+(k-f);if(j>e){j-=e}}while(h!=j){if(h==e){h=0}b+='<a onclick="Shadowbox.change('+h+');"';if(h==E.current){b+=' class="sb-counter-current"'}b+=">"+(h++)+"</a>"}}else{var b=(E.current+1)+" "+E.lang.of+" "+e}}F.get("sb-counter").innerHTML=b;l()}function B(j,k){var f=F.get("sb-wrapper"),c=F.get("sb-title"),i=F.get("sb-info"),b=F.get("sb-title-inner"),e=F.get("sb-info-inner"),d=parseInt(E.lib.getStyle(b,"height"))||0,g=parseInt(E.lib.getStyle(e,"height"))||0;var h=function(){b.style.visibility=e.style.visibility="hidden";K(k)};if(j){F.animate(c,"height",0,0.35);F.animate(i,"height",0,0.35);F.animate(f,"paddingTop",d,0.35);F.animate(f,"paddingBottom",g,0.35,h)}else{c.style.height=i.style.height="0px";f.style.paddingTop=d+"px";f.style.paddingBottom=g+"px";h()}}function y(e){var f=F.get("sb-wrapper"),c=F.get("sb-title"),d=F.get("sb-info"),h=F.get("sb-title-inner"),i=F.get("sb-info-inner"),b=parseInt(E.lib.getStyle(h,"height"))||0,g=parseInt(E.lib.getStyle(i,"height"))||0;h.style.visibility=i.style.visibility="";if(h.innerHTML!=""){F.animate(c,"height",b,0.35);F.animate(f,"paddingTop",0,0.35)}F.animate(d,"height",g,0.35);F.animate(f,"paddingBottom",0,0.35,e)}function H(f,h,i,g){var c=F.get("sb-body"),b=F.get("sb-wrapper"),d=parseInt(f),e=parseInt(h);if(i){F.animate(c,"height",d,E.options.resizeDuration);F.animate(b,"top",e,E.options.resizeDuration,g)}else{c.style.height=d+"px";b.style.top=e+"px";if(g){g()}}}function D(b,g,h,f){var c=F.get("sb-wrapper"),d=parseInt(b),e=parseInt(g);if(h){F.animate(c,"width",d,E.options.resizeDuration);F.animate(c,"left",e,E.options.resizeDuration,f)}else{c.style.width=d+"px";c.style.left=e+"px";if(f){f()}}}function s(e,b,c){var d=F.get("sb-body-inner");sw=F.get("sb-wrapper"),so=F.get("sb-overlay"),tb=sw.offsetHeight-d.offsetHeight,lr=sw.offsetWidth-d.offsetWidth,max_h=so.offsetHeight,max_w=so.offsetWidth;E.setDimensions(e,b,max_h,max_w,tb,lr,c);return E.dimensions}E.skin=u})();if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}(function(c,d){d.lib={getStyle:function(b,e){return c(b).css(e)},remove:function(b){c(b).remove()},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(b,g,f){c(b).bind(g,f)},removeEvent:function(b,g,f){c(b).unbind(g,f)},append:function(b,e){c(b).append(e)}}})(jQuery,Shadowbox);(function(b){b.fn.shadowbox=function(c){return this.each(function(){var g=b(this);var f=b.extend({},c||{},b.metadata?g.metadata():b.meta?g.data():{});var h=this.className||"";f.width=parseInt((h.match(/w:(\d+)/)||[])[1])||f.width;f.height=parseInt((h.match(/h:(\d+)/)||[])[1])||f.height;Shadowbox.setup(g,f)})}})(jQuery);if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};(function(p){var s=p.util,o,l,m="sb-drag-layer",u;function w(){o={x:0,y:0,start_x:null,start_y:null}}function v(b,e,c){if(b){w();var f=["position:absolute","height:"+e+"px","width:"+c+"px","cursor:"+(p.client.isGecko?"-moz-grab":"move"),"background-color:"+(p.client.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");p.lib.append(p.skin.bodyEl(),'<div id="'+m+'" style="'+f+'"></div>');p.lib.addEvent(s.get(m),"mousedown",q)}else{var d=s.get(m);if(d){p.lib.removeEvent(d,"mousedown",q);p.lib.remove(d)}l=null}}function q(b){p.lib.preventDefault(b);var c=p.lib.getPageXY(b);o.start_x=c[0];o.start_y=c[1];l=s.get(p.contentId());p.lib.addEvent(document,"mousemove",r);p.lib.addEvent(document,"mouseup",y);if(p.client.isGecko){s.get(m).style.cursor="-moz-grabbing"}}function y(){p.lib.removeEvent(document,"mousemove",r);p.lib.removeEvent(document,"mouseup",y);if(p.client.isGecko){s.get(m).style.cursor="-moz-grab"}}function r(f){var d=p.content,e=p.dimensions,g=p.lib.getPageXY(f);var b=g[0]-o.start_x;o.start_x+=b;o.x=Math.max(Math.min(0,o.x+b),e.inner_w-d.width);l.style.left=o.x+"px";var c=g[1]-o.start_y;o.start_y+=c;o.y=Math.max(Math.min(0,o.y+c),e.inner_h-d.height);l.style.top=o.y+"px"}p.img=function(b){this.obj=b;this.resizable=true;this.ready=false;var c=this;u=new Image();u.onload=function(){c.height=b.height?parseInt(b.height,10):u.height;c.width=b.width?parseInt(b.width,10):u.width;c.ready=true;u.onload="";u=null};u.src=b.content};p.img.prototype={append:function(c,d,e){this.id=d;var b=document.createElement("img");b.id=d;b.src=this.obj.content;b.style.position="absolute";b.setAttribute("height",e.resize_h);b.setAttribute("width",e.resize_w);c.appendChild(b)},remove:function(){var b=s.get(this.id);if(b){p.lib.remove(b)}v(false);if(u){u.onload="";u=null}},onLoad:function(){var b=p.dimensions;if(b.oversized&&p.options.handleOversize=="drag"){v(true,b.resize_h,b.resize_w)}},onWindowResize:function(){if(l){var c=p.content,d=p.dimensions,e=parseInt(p.lib.getStyle(l,"top")),b=parseInt(p.lib.getStyle(l,"left"));if(e+c.height<d.inner_h){l.style.top=d.inner_h-c.height+"px"}if(b+c.width<d.inner_w){l.style.left=d.inner_w-c.width+"px"}}}}})(Shadowbox);Shadowbox.options.players=["img"];Shadowbox.options.useSizzle=false;jQuery.ui||(function(q){var j=q.fn.remove,p=q.browser.mozilla&&(parseFloat(q.browser.version)<1.9);q.ui={version:"1.7.2",plugin:{add:function(d,c,f){var b=q.ui[d].prototype;for(var e in f){b.plugins[e]=b.plugins[e]||[];b.plugins[e].push([c,f[e]])}},call:function(e,c,d){var f=e.plugins[c];if(!f||!e.element[0].parentNode){return}for(var b=0;b<f.length;b++){if(e.options[f[b][0]]){f[b][1].apply(e.element,d)}}}},contains:function(b,c){return document.compareDocumentPosition?b.compareDocumentPosition(c)&16:b!==c&&b.contains(c)},hasScroll:function(b,d){if(q(b).css("overflow")=="hidden"){return false}var e=(d&&d=="left")?"scrollLeft":"scrollTop",c=false;if(b[e]>0){return true}b[e]=1;c=(b[e]>0);b[e]=0;return c},isOverAxis:function(c,d,b){return(c>d)&&(c<(d+b))},isOver:function(f,d,g,b,e,c){return q.ui.isOverAxis(f,g,e)&&q.ui.isOverAxis(d,b,c)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(p){var m=q.attr,o=q.fn.removeAttr,k="http://www.w3.org/2005/07/aaa",s=/^aria-/,r=/^wairole:/;q.attr=function(d,e,c){var b=c!==undefined;return(e=="role"?(b?m.call(this,d,e,"wairole:"+c):(m.apply(this,arguments)||"").replace(r,"")):(s.test(e)?(b?d.setAttributeNS(k,e.replace(s,"aaa:"),c):m.call(this,d,e.replace(s,"aaa:"))):m.apply(this,arguments)))};q.fn.removeAttr=function(b){return(s.test(b)?this.each(function(){this.removeAttributeNS(k,b.replace(s,""))}):o.call(this,b))}}q.fn.extend({remove:function(){q("*",this).add(this).each(function(){q(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var b;if((q.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){b=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(q.curCSS(this,"position",1))&&(/(auto|scroll)/).test(q.curCSS(this,"overflow",1)+q.curCSS(this,"overflow-y",1)+q.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return(/(auto|scroll)/).test(q.curCSS(this,"overflow",1)+q.curCSS(this,"overflow-y",1)+q.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!b.length?q(document):b}});q.extend(q.expr[":"],{data:function(b,c,d){return !!q.data(b,d[3])},focusable:function(c){var b=c.nodeName.toLowerCase(),d=q.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(b)?!c.disabled:"a"==b||"area"==b?c.href||!isNaN(d):!isNaN(d))&&!q(c)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(b){var c=q.attr(b,"tabindex");return(isNaN(c)||c>=0)&&q(b).is(":focusable")}});function l(b,g,f,c){function d(h){var i=q[b][g][h]||[];return(typeof i=="string"?i.split(/,?\s+/):i)}var e=d("getter");if(c.length==1&&typeof c[0]=="string"){e=e.concat(d("getterSetter"))}return(q.inArray(f,e)!=-1)}q.widget=function(c,d){var b=c.split(".")[0];c=c.split(".")[1];q.fn[c]=function(f){var h=(typeof f=="string"),g=Array.prototype.slice.call(arguments,1);if(h&&f.substring(0,1)=="_"){return this}if(h&&l(b,c,f,g)){var e=q.data(this[0],c);return(e?e[f].apply(e,g):undefined)}return this.each(function(){var i=q.data(this,c);(!i&&!h&&q.data(this,c,new q[b][c](this,f))._init());(i&&h&&q.isFunction(i[f])&&i[f].apply(i,g))})};q[b]=q[b]||{};q[b][c]=function(f,g){var e=this;this.namespace=b;this.widgetName=c;this.widgetEventPrefix=q[b][c].eventPrefix||c;this.widgetBaseClass=b+"-"+c;this.options=q.extend({},q.widget.defaults,q[b][c].defaults,q.metadata&&q.metadata.get(f)[c],g);this.element=q(f).bind("setData."+c,function(i,u,h){if(i.target==f){return e._setData(u,h)}}).bind("getData."+c,function(h,i){if(h.target==f){return e._getData(i)}}).bind("remove",function(){return e.destroy()})};q[b][c].prototype=q.extend({},q.widget.prototype,d);q[b][c].getterSetter="option"};q.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(c,b){var d=c,e=this;if(typeof c=="string"){if(b===undefined){return this._getData(c)}d={};d[c]=b}q.each(d,function(g,f){e._setData(g,f)})},_getData:function(b){return this.options[b]},_setData:function(c,b){this.options[c]=b;if(c=="disabled"){this.element[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",b)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(c,b,h){var f=this.options[c],e=(c==this.widgetEventPrefix?c:this.widgetEventPrefix+c);b=q.Event(b);b.type=e;if(b.originalEvent){for(var d=q.event.props.length,g;d;){g=q.event.props[--d];b[g]=b.originalEvent[g]}}this.element.trigger(b,h);return !(q.isFunction(f)&&f.call(this.element[0],b,h)===false||b.isDefaultPrevented())}};q.widget.defaults={disabled:false};q.ui.mouse={_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(b._preventClickEvent){b._preventClickEvent=false;c.stopImmediatePropagation();return false}});if(q.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(q.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(c){c.originalEvent=c.originalEvent||{};if(c.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(c));this._mouseDownEvent=c;var d=this,b=(c.which==1),e=(typeof this.options.cancel=="string"?q(c.target).parents().add(c.target).filter(this.options.cancel).length:false);if(!b||e||!this._mouseCapture(c)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=(this._mouseStart(c)!==false);if(!this._mouseStarted){c.preventDefault();return true}}this._mouseMoveDelegate=function(f){return d._mouseMove(f)};this._mouseUpDelegate=function(f){return d._mouseUp(f)};q(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(q.browser.safari||c.preventDefault());c.originalEvent.mouseHandled=true;return true},_mouseMove:function(b){if(q.browser.msie&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,b)!==false);(this._mouseStarted?this._mouseDrag(b):this._mouseUp(b))}return !this._mouseStarted},_mouseUp:function(b){q(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(b.target==this._mouseDownEvent.target);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return(Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance)},_mouseDelayMet:function(b){return this.mouseDelayMet},_mouseStart:function(b){},_mouseDrag:function(b){},_mouseStop:function(b){},_mouseCapture:function(b){return true}};q.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(b){b.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(d,e){if(d=="selected"){if(this.options.collapsible&&e==this.options.selected){return}this.select(e)}else{this.options[d]=e;if(d=="deselectable"){this.options.collapsible=e}this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+b.data(c)},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+b.data(this.list[0]));return b.cookie.apply(null,[c].concat(b.makeArray(arguments)))},_ui:function(e,d){return{tab:e,panel:d,index:this.anchors.index(e)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c=b(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(o){this.list=this.element.children("ul:first");this.lis=b("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);var i=this,B=this.options;var C=/^#.+/;this.anchors.each(function(g,j){var h=b(j).attr("href");var f=h.split("#")[0],e;if(f&&(f===location.toString().split("#")[0]||(e=b("base")[0])&&f===e.href)){h=j.hash;j.href=h}if(C.test(h)){i.panels=i.panels.add(i._sanitizeSelector(h))}else{if(h!="#"){b.data(j,"href.tabs",h);b.data(j,"load.tabs",h.replace(/#.*$/,""));var c=i._tabId(j);j.href="#"+c;var d=b("#"+c);if(!d.length){d=b(B.panelTemplate).attr("id",c).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(i.panels[g-1]||i.list);d.data("destroy.tabs",true)}i.panels=i.panels.add(d)}else{B.disabled.push(g)}}});if(o){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(B.selected===undefined){if(location.hash){this.anchors.each(function(c,d){if(d.hash==location.hash){B.selected=c;return false}})}if(typeof B.selected!="number"&&B.cookie){B.selected=parseInt(i._cookie(),10)}if(typeof B.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){B.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}B.selected=B.selected||0}else{if(B.selected===null){B.selected=-1}}B.selected=((B.selected>=0&&this.anchors[B.selected])||B.selected<0)?B.selected:0;B.disabled=b.unique(B.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(c,d){return i.lis.index(c)}))).sort();if(b.inArray(B.selected,B.disabled)!=-1){B.disabled.splice(b.inArray(B.selected,B.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(B.selected>=0&&this.anchors.length){this.panels.eq(B.selected).removeClass("ui-tabs-hide");this.lis.eq(B.selected).addClass("ui-tabs-selected ui-state-active");i.element.queue("tabs",function(){i._trigger("show",null,i._ui(i.anchors[B.selected],i.panels[B.selected]))});this.load(B.selected)}b(window).bind("unload",function(){i.lis.add(i.anchors).unbind(".tabs");i.lis=i.anchors=i.panels=null})}else{B.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[B.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(B.cookie){this._cookie(B.selected,B.cookie)}for(var w=0,q;(q=this.lis[w]);w++){b(q)[b.inArray(w,B.disabled)!=-1&&!b(q).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(B.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(B.event!="mouseover"){var y=function(d,c){if(c.is(":not(.ui-state-disabled)")){c.addClass("ui-state-"+d)}};var u=function(d,c){c.removeClass("ui-state-"+d)};this.lis.bind("mouseover.tabs",function(){y("hover",b(this))});this.lis.bind("mouseout.tabs",function(){u("hover",b(this))});this.anchors.bind("focus.tabs",function(){y("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){u("focus",b(this).closest("li"))})}var D,v;if(B.fx){if(b.isArray(B.fx)){D=B.fx[0];v=B.fx[1]}else{D=v=B.fx}}function A(c,d){c.css({display:""});if(b.browser.msie&&d.opacity){c[0].style.removeAttribute("filter")}}var s=v?function(c,d){b(c).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");d.hide().removeClass("ui-tabs-hide").animate(v,v.duration||"normal",function(){A(d,v);i._trigger("show",null,i._ui(c,d[0]))})}:function(c,d){b(c).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");d.removeClass("ui-tabs-hide");i._trigger("show",null,i._ui(c,d[0]))};var r=D?function(d,c){c.animate(D,D.duration||"normal",function(){i.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");c.addClass("ui-tabs-hide");A(c,D);i.element.dequeue("tabs")})}:function(e,c,d){i.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");c.addClass("ui-tabs-hide");i.element.dequeue("tabs")};this.anchors.bind(B.event+".tabs",function(){var f=this,d=b(this).closest("li"),c=i.panels.filter(":not(.ui-tabs-hide)"),e=b(i._sanitizeSelector(this.hash));if((d.hasClass("ui-tabs-selected")&&!B.collapsible)||d.hasClass("ui-state-disabled")||d.hasClass("ui-state-processing")||i._trigger("select",null,i._ui(this,e[0]))===false){this.blur();return false}B.selected=i.anchors.index(this);i.abort();if(B.collapsible){if(d.hasClass("ui-tabs-selected")){B.selected=-1;if(B.cookie){i._cookie(B.selected,B.cookie)}i.element.queue("tabs",function(){r(f,c)}).dequeue("tabs");this.blur();return false}else{if(!c.length){if(B.cookie){i._cookie(B.selected,B.cookie)}i.element.queue("tabs",function(){s(f,e)});i.load(i.anchors.index(this));this.blur();return false}}}if(B.cookie){i._cookie(B.selected,B.cookie)}if(e.length){if(c.length){i.element.queue("tabs",function(){r(f,c)})}i.element.queue("tabs",function(){s(f,e)});i.load(i.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(b.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var f=b.data(this,"href.tabs");if(f){this.href=f}var e=b(this).unbind(".tabs");b.each(["href","load","cache"],function(g,d){e.removeData(d+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(b.data(this,"destroy.tabs")){b(this).remove()}else{b(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(c.cookie){this._cookie(null,c.cookie)}},add:function(p,q,r){if(r===undefined){r=this.anchors.length}var j=this,m=this.options,k=b(m.tabTemplate.replace(/#\{href\}/g,p).replace(/#\{label\}/g,q)),l=!p.indexOf("#")?p.replace("#",""):this._tabId(b("a",k)[0]);k.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var o=b("#"+l);if(!o.length){o=b(m.panelTemplate).attr("id",l).data("destroy.tabs",true)}o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(r>=this.lis.length){k.appendTo(this.list);o.appendTo(this.list[0].parentNode)}else{k.insertBefore(this.lis[r]);o.insertBefore(this.panels[r])}m.disabled=b.map(m.disabled,function(c,d){return c>=r?++c:c});this._tabify();if(this.anchors.length==1){k.addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[r],this.panels[r]))},remove:function(f){var h=this.options,g=this.lis.eq(f).remove(),i=this.panels.eq(f).remove();if(g.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(f+(f+1<this.anchors.length?1:-1))}h.disabled=b.map(b.grep(h.disabled,function(c,d){return c!=f}),function(c,d){return c>=f?--c:c});this._tabify();this._trigger("remove",null,this._ui(g.find("a")[0],i[0]))},enable:function(d){var e=this.options;if(b.inArray(d,e.disabled)==-1){return}this.lis.eq(d).removeClass("ui-state-disabled");e.disabled=b.grep(e.disabled,function(c,f){return c!=d});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]))},disable:function(g){var e=this,f=this.options;if(g!=f.selected){this.lis.eq(g).addClass("ui-state-disabled");f.disabled.push(g);f.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[g],this.panels[g]))}},select:function(c){if(typeof c=="string"){c=this.anchors.index(this.anchors.filter("[href$="+c+"]"))}else{if(c===null){c=-1}}if(c==-1&&this.options.collapsible){c=this.options.selected}this.anchors.eq(c).trigger(this.options.event+".tabs")},load:function(k){var m=this,i=this.options,h=this.anchors.eq(k)[0],l=b.data(h,"load.tabs");this.abort();if(!l||this.element.queue("tabs").length!==0&&b.data(h,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(k).addClass("ui-state-processing");if(i.spinner){var j=b("span",h);j.data("label.tabs",j.html()).html(i.spinner)}this.xhr=b.ajax(b.extend({},i.ajaxOptions,{url:l,success:function(d,e){b(m._sanitizeSelector(h.hash)).html(d);m._cleanup();if(i.cache){b.data(h,"cache.tabs",true)}m._trigger("load",null,m._ui(m.anchors[k],m.panels[k]));try{i.ajaxOptions.success(d,e)}catch(c){}m.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(e,d){this.anchors.eq(e).removeData("cache.tabs").data("load.tabs",d)},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(l,j){var h=this,i=this.options;var m=h._rotate||(h._rotate=function(c){clearTimeout(h.rotation);h.rotation=setTimeout(function(){var d=i.selected;h.select(++d<h.anchors.length?d:0)},l);if(c){c.stopPropagation()}});var k=h._unrotate||(h._unrotate=!j?function(c){if(c.clientX){h.rotate(null)}}:function(c){t=i.selected;m()});if(l){this.element.bind("tabsshow",m);this.anchors.bind(i.event+".tabs",k);m()}else{clearTimeout(h.rotation);this.element.unbind("tabsshow",m);this.anchors.unbind(i.event+".tabs",k);delete this._rotate;delete this._unrotate}}})})(jQuery);(function(b){b.extend(b.fn,{validate:function(c){if(!this.length){c&&c.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var d=b.data(this[0],"validator");if(d){return d}d=new b.validator(c,this[0]);b.data(this[0],"validator",d);if(d.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){d.cancelSubmit=true});if(d.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){d.submitButton=this})}this.submit(function(e){if(d.settings.debug){e.preventDefault()}function f(){if(d.settings.submitHandler){if(d.submitButton){var g=b("<input type='hidden'/>").attr("name",d.submitButton.name).val(d.submitButton.value).appendTo(d.currentForm)}d.settings.submitHandler.call(d,d.currentForm);if(d.submitButton){g.remove()}return false}return true}if(d.cancelSubmit){d.cancelSubmit=false;return f()}if(d.form()){if(d.pendingRequest){d.formSubmitted=true;return false}return f()}else{d.focusInvalid();return false}})}return d},valid:function(){if(b(this[0]).is("form")){return this.validate().form()}else{var d=true;var c=b(this[0].form).validate();this.each(function(){d&=c.element(this)});return d}},removeAttrs:function(e){var c={},d=this;b.each(e.split(/\s/),function(f,g){c[g]=d.attr(g);d.removeAttr(g)});return c},rules:function(f,c){var h=this[0];if(f){var e=b.data(h.form,"validator").settings;var j=e.rules;var k=b.validator.staticRules(h);switch(f){case"add":b.extend(k,b.validator.normalizeRule(c));j[h.name]=k;if(c.messages){e.messages[h.name]=b.extend(e.messages[h.name],c.messages)}break;case"remove":if(!c){delete j[h.name];return k}var i={};b.each(c.split(/\s/),function(l,m){i[m]=k[m];delete k[m]});return i}}var g=b.validator.normalizeRules(b.extend({},b.validator.metadataRules(h),b.validator.classRules(h),b.validator.attributeRules(h),b.validator.staticRules(h)),h);if(g.required){var d=g.required;delete g.required;g=b.extend({required:d},g)}return g}});b.extend(b.expr[":"],{blank:function(c){return !b.trim(c.value)},filled:function(c){return !!b.trim(c.value)},unchecked:function(c){return !c.checked}});b.validator=function(c,d){this.settings=b.extend({},b.validator.defaults,c);this.currentForm=d;this.init()};b.validator.format=function(c,d){if(arguments.length==1){return function(){var e=b.makeArray(arguments);e.unshift(c);return b.validator.format.apply(this,e)}}if(arguments.length>2&&d.constructor!=Array){d=b.makeArray(arguments).slice(1)}if(d.constructor!=Array){d=[d]}b.each(d,function(e,f){c=c.replace(new RegExp("\\{"+e+"\\}","g"),f)});return c};b.extend(b.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:b([]),errorLabelContainer:b([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(c){this.lastActive=c;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,c,this.settings.errorClass,this.settings.validClass);this.errorsFor(c).hide()}},onfocusout:function(c){if(!this.checkable(c)&&(c.name in this.submitted||!this.optional(c))){this.element(c)}},onkeyup:function(c){if(c.name in this.submitted||c==this.lastElement){this.element(c)}},onclick:function(c){if(c.name in this.submitted){this.element(c)}},highlight:function(e,c,d){b(e).addClass(c).removeClass(d)},unhighlight:function(e,c,d){b(e).removeClass(c).addClass(d)}},setDefaults:function(c){b.extend(b.validator.defaults,c)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:b.validator.format("Please enter no more than {0} characters."),minlength:b.validator.format("Please enter at least {0} characters."),rangelength:b.validator.format("Please enter a value between {0} and {1} characters long."),range:b.validator.format("Please enter a value between {0} and {1}."),max:b.validator.format("Please enter a value less than or equal to {0}."),min:b.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=b(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||b(this.currentForm);this.containers=b(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var c=(this.groups={});b.each(this.settings.groups,function(f,g){b.each(g.split(/\s/),function(i,h){c[h]=f})});var e=this.settings.rules;b.each(e,function(f,g){e[f]=b.validator.normalizeRule(g)});function d(g){var f=b.data(this[0].form,"validator");f.settings["on"+g.type]&&f.settings["on"+g.type].call(f,this[0])}b(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",d).delegate("click",":radio, :checkbox",d);if(this.settings.invalidHandler){b(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();b.extend(this.submitted,this.errorMap);this.invalid=b.extend({},this.errorMap);if(!this.valid()){b(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var c=0,d=(this.currentElements=this.elements());d[c];c++){this.check(d[c])}return this.valid()},element:function(d){d=this.clean(d);this.lastElement=d;this.prepareElement(d);this.currentElements=b(d);var c=this.check(d);if(c){delete this.invalid[d.name]}else{this.invalid[d.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return c},showErrors:function(d){if(d){b.extend(this.errorMap,d);this.errorList=[];for(var c in d){this.errorList.push({message:d[c],element:this.findByName(c)[0]})}this.successList=b.grep(this.successList,function(e){return !(e.name in d)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(b.fn.resetForm){b(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var d=0;for(var c in e){d++}return d},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{b(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(c){}}},findLastActive:function(){var c=this.lastActive;return c&&b.grep(this.errorList,function(d){return d.element.name==c.name}).length==1&&c},elements:function(){var d=this,c={};return b([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&d.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in c||!d.objectLength(b(this).rules())){return false}c[this.name]=true;return true})},clean:function(c){return b(c)[0]},errors:function(){return b(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=b([]);this.toHide=b([]);this.formSubmitted=false;this.currentElements=b([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(c){this.reset();this.toHide=this.errorsFor(c)},check:function(d){d=this.clean(d);if(this.checkable(d)){d=this.findByName(d.name)[0]}var i=b(d).rules();var f=false;for(method in i){var h={method:method,parameters:i[method]};try{var c=b.validator.methods[method].call(this,d.value.replace(/\r/g,""),d,h.parameters);if(c=="dependency-mismatch"){f=true;continue}f=false;if(c=="pending"){this.toHide=this.toHide.not(this.errorsFor(d));return}if(!c){this.formatAndAdd(d,h);return false}}catch(g){this.settings.debug&&window.console&&console.log("exception occured when checking element "+d.id+", check the '"+h.method+"' method");throw g}}if(f){return}if(this.objectLength(i)){this.successList.push(d)}return true},customMetaMessage:function(c,e){if(!b.metadata){return}var d=this.settings.meta?b(c).metadata()[this.settings.meta]:b(c).metadata();return d&&d.messages&&d.messages[e]},customMessage:function(d,e){var c=this.settings.messages[d];return c&&(c.constructor==String?c:c[e])},findDefined:function(){for(var c=0;c<arguments.length;c++){if(arguments[c]!==undefined){return arguments[c]}}return undefined},defaultMessage:function(c,d){return this.findDefined(this.customMessage(c.name,d),this.customMetaMessage(c,d),!this.settings.ignoreTitle&&c.title||undefined,b.validator.messages[d],"<strong>Warning: No message defined for "+c.name+"</strong>")},formatAndAdd:function(c,e){var d=this.defaultMessage(c,e.method);if(typeof d=="function"){d=d.call(this,e.parameters,c)}this.errorList.push({message:d,element:c});this.errorMap[c.name]=d;this.submitted[c.name]=d},addWrapper:function(c){if(this.settings.wrapper){c=c.add(c.parent(this.settings.wrapper))}return c},defaultShowErrors:function(){for(var d=0;this.errorList[d];d++){var c=this.errorList[d];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass);this.showLabel(c.element,c.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var d=0;this.successList[d];d++){this.showLabel(this.successList[d])}}if(this.settings.unhighlight){for(var d=0,e=this.validElements();e[d];d++){this.settings.unhighlight.call(this,e[d],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return b(this.errorList).map(function(){return this.element})},showLabel:function(d,e){var c=this.errorsFor(d);if(c.length){c.removeClass().addClass(this.settings.errorClass);c.attr("generated")&&c.html(e)}else{c=b("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(d),generated:true}).addClass(this.settings.errorClass).html(e||"");if(this.settings.wrapper){c=c.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(c).length){this.settings.errorPlacement?this.settings.errorPlacement(c,b(d)):c.insertAfter(d)}}if(!e&&this.settings.success){c.text("");typeof this.settings.success=="string"?c.addClass(this.settings.success):this.settings.success(c)}this.toShow=this.toShow.add(c)},errorsFor:function(c){return this.errors().filter("[for='"+this.idOrName(c)+"']")},idOrName:function(c){return this.groups[c.name]||(this.checkable(c)?c.name:c.id||c.name)},checkable:function(c){return/radio|checkbox/i.test(c.type)},findByName:function(c){var d=this.currentForm;return b(document.getElementsByName(c)).map(function(e,f){return f.form==d&&f.name==c&&f||null})},getLength:function(d,c){switch(c.nodeName.toLowerCase()){case"select":return b("option:selected",c).length;case"input":if(this.checkable(c)){return this.findByName(c.name).filter(":checked").length}}return d.length},depend:function(d,c){return this.dependTypes[typeof d]?this.dependTypes[typeof d](d,c):true},dependTypes:{"boolean":function(d,c){return d},string:function(d,c){return !!b(d,c.form).length},"function":function(d,c){return d(c)}},optional:function(c){return !b.validator.methods.required.call(this,b.trim(c.value),c)&&"dependency-mismatch"},startRequest:function(c){if(!this.pending[c.name]){this.pendingRequest++;this.pending[c.name]=true}},stopRequest:function(c,d){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[c.name];if(d&&this.pendingRequest==0&&this.formSubmitted&&this.form()){b(this.currentForm).submit()}else{if(!d&&this.pendingRequest==0&&this.formSubmitted){b(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(c){return b.data(c,"previousValue")||b.data(c,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(c,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(c,d){c.constructor==String?this.classRuleSettings[c]=d:b.extend(this.classRuleSettings,c)},classRules:function(d){var e={};var c=b(d).attr("class");c&&b.each(c.split(" "),function(){if(this in b.validator.classRuleSettings){b.extend(e,b.validator.classRuleSettings[this])}});return e},attributeRules:function(d){var f={};var c=b(d);for(method in b.validator.methods){var e=c.attr(method);if(e){f[method]=e}}if(f.maxlength&&/-1|2147483647|524288/.test(f.maxlength)){delete f.maxlength}return f},metadataRules:function(c){if(!b.metadata){return{}}var d=b.data(c.form,"validator").settings.meta;return d?b(c).metadata()[d]:b(c).metadata()},staticRules:function(d){var e={};var c=b.data(d.form,"validator");if(c.settings.rules){e=b.validator.normalizeRule(c.settings.rules[d.name])||{}}return e},normalizeRules:function(d,c){b.each(d,function(g,f){if(f===false){delete d[g];return}if(f.param||f.depends){var e=true;switch(typeof f.depends){case"string":e=!!b(f.depends,c.form).length;break;case"function":e=f.depends.call(c,c);break}if(e){d[g]=f.param!==undefined?f.param:true}else{delete d[g]}}});b.each(d,function(e,f){d[e]=b.isFunction(f)?f(c):f});b.each(["minlength","maxlength","min","max"],function(){if(d[this]){d[this]=Number(d[this])}});b.each(["rangelength","range"],function(){if(d[this]){d[this]=[Number(d[this][0]),Number(d[this][1])]}});if(b.validator.autoCreateRanges){if(d.min&&d.max){d.range=[d.min,d.max];delete d.min;delete d.max}if(d.minlength&&d.maxlength){d.rangelength=[d.minlength,d.maxlength];delete d.minlength;delete d.maxlength}}if(d.messages){delete d.messages}return d},normalizeRule:function(d){if(typeof d=="string"){var c={};b.each(d.split(/\s/),function(){c[this]=true});d=c}return d},addMethod:function(c,e,d){b.validator.methods[c]=e;b.validator.messages[c]=d||b.validator.messages[c];if(e.length<3){b.validator.addClassRules(c,b.validator.normalizeRule(c))}},methods:{required:function(e,d,f){if(!this.depend(f,d)){return"dependency-mismatch"}switch(d.nodeName.toLowerCase()){case"select":var c=b("option:selected",d);return c.length>0&&(d.type=="select-multiple"||(b.browser.msie&&!(c[0].attributes.value.specified)?c[0].text:c[0].value).length>0);case"input":if(this.checkable(d)){return this.getLength(e,d)>0}default:return b.trim(e).length>0}},remote:function(g,d,h){if(this.optional(d)){return"dependency-mismatch"}var e=this.previousValue(d);if(!this.settings.messages[d.name]){this.settings.messages[d.name]={}}this.settings.messages[d.name].remote=typeof e.message=="function"?e.message(g):e.message;h=typeof h=="string"&&{url:h}||h;if(e.old!==g){e.old=g;var c=this;this.startRequest(d);var f={};f[d.name]=g;b.ajax(b.extend(true,{url:h,mode:"abort",port:"validate"+d.name,dataType:"json",data:f,success:function(j){var k=j===true;if(k){var i=c.formSubmitted;c.prepareElement(d);c.formSubmitted=i;c.successList.push(d);c.showErrors()}else{var l={};l[d.name]=e.message=j||c.defaultMessage(d,"remote");c.showErrors(l)}e.valid=k;c.stopRequest(d,k)}},h));return"pending"}else{if(this.pending[d.name]){return"pending"}}return e.valid},minlength:function(d,c,e){return this.optional(c)||this.getLength(b.trim(d),c)>=e},maxlength:function(d,c,e){return this.optional(c)||this.getLength(b.trim(d),c)<=e},rangelength:function(e,c,f){var d=this.getLength(b.trim(e),c);return this.optional(c)||(d>=f[0]&&d<=f[1])},min:function(d,c,e){return this.optional(c)||d>=e},max:function(d,c,e){return this.optional(c)||d<=e},range:function(d,c,e){return this.optional(c)||(d>=e[0]&&d<=e[1])},email:function(d,c){return this.optional(c)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(d)},url:function(d,c){return this.optional(c)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(d)},date:function(d,c){return this.optional(c)||!/Invalid|NaN/.test(new Date(d))},dateISO:function(d,c){return this.optional(c)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(d)},dateDE:function(d,c){return this.optional(c)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(d)},number:function(d,c){return this.optional(c)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(d)},numberDE:function(d,c){return this.optional(c)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(d)},digits:function(d,c){return this.optional(c)||/^\d+$/.test(d)},creditcard:function(g,d){if(this.optional(d)){return"dependency-mismatch"}if(/[^0-9-]+/.test(g)){return false}var h=0,f=0,c=false;g=g.replace(/\D/g,"");for(n=g.length-1;n>=0;n--){var e=g.charAt(n);var f=parseInt(e,10);if(c){if((f*=2)>9){f-=9}}h+=f;c=!c}return(h%10)==0},accept:function(d,c,e){e=typeof e=="string"?e.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(c)||d.match(new RegExp(".("+e+")$","i"))},equalTo:function(d,c,e){return d==b(e).val()}}});b.format=b.validator.format})(jQuery);(function(d){var c=d.ajax;var b={};d.ajax=function(f){f=d.extend(f,d.extend({},d.ajaxSettings,f));var e=f.port;if(f.mode=="abort"){if(b[e]){b[e].abort()}return(b[e]=c.apply(this,arguments))}return c.apply(this,arguments)}})(jQuery);(function(b){b.each({focus:"focusin",blur:"focusout"},function(d,c){b.event.special[c]={setup:function(){if(b.browser.msie){return false}this.addEventListener(d,b.event.special[c].handler,true)},teardown:function(){if(b.browser.msie){return false}this.removeEventListener(d,b.event.special[c].handler,true)},handler:function(f){arguments[0]=b.event.fix(f);arguments[0].type=c;return b.event.handle.apply(this,arguments)}}});b.extend(b.fn,{delegate:function(e,d,c){return this.bind(e,function(f){var g=b(f.target);if(g.is(d)){return c.apply(g,arguments)}})},triggerEvent:function(c,d){return this.triggerHandler(c,[b.event.fix({type:c,target:d})])}})})(jQuery);jQuery.validator.addMethod("mustBeBlank",function(c,b,d){if($(b).is(":checked")&&$(d).val()!=""){return false}else{return true}},"USCF must be blank if selecting new or pending.");jQuery.validator.addMethod("mustBeUnchecked",function(c,b,d){if($(b).is(":checked")&&$(d).is(":checked")){return false}else{return true}},"New and pending may not both be selected.");jQuery.validator.addMethod("mustBeUnchecked2",function(d,c,e){var b=e.split(",");if($(c).val()==""&&(!$(b[0]).is(":checked")&&!$(b[1]).is(":checked"))){return false}else{return true}},"USCF ID is required if not new or pending.");
