(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);(function(b){b.fn.superfish=function(k){var g=b.fn.superfish,j=g.c,f=b(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var c=b(this),l=d(c);clearTimeout(l.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var c=b(this),m=d(c),l=g.op;clearTimeout(m.sfTimer);m.sfTimer=setTimeout(function(){l.retainPath=(b.inArray(c[0],l.$path)>-1);c.hideSuperfishUl();if(l.$path.length&&c.parents(["li.",l.hoverClass].join("")).length<1){i.call(l.$path)}},l.delay)},d=function(c){var l=c.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[l.serial];return l},h=function(c){c.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var c=this.serial=g.o.length;var m=b.extend({},g.defaults,k);m.$path=b("li."+m.pathClass,this).slice(0,m.pathLevels).each(function(){b(this).addClass([m.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass)});g.o[c]=g.op=m;b("li:has(ul)",this)[(b.fn.hoverIntent&&!m.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(m.autoArrows){h(b(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var l=b("a",this);l.each(function(n){var o=l.eq(n).parents("li");l.eq(n).focus(function(){i.call(o)}).blur(function(){e.call(o)})});m.onInit.call(this)}).each(function(){var c=[j.menuClass];if(g.op.dropShadows&&!(b.browser.msie&&b.browser.version<7)){c.push(j.shadowClass)}b(this).addClass(c.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.IE7fix=function(){var c=a.op;if(b.browser.msie&&b.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(a.c.shadowClass+"-off")}};a.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};a.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(){}};b.fn.extend({hideSuperfishUl:function(){var e=a.op,d=(e.retainPath===true)?e.$path:"";e.retainPath=false;var c=b(["li.",e.hoverClass].join(""),this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility","hidden");e.onHide.call(c);return this},showSuperfishUl:function(){var e=a.op,d=a.c.shadowClass+"-off",c=this.addClass(e.hoverClass).find(">ul:hidden").css("visibility","visible");a.IE7fix.call(c);e.onBeforeShow.call(c);c.animate(e.animation,e.speed,function(){a.IE7fix.call(c);e.onShow.call(c)});return this}})})(jQuery);(function(a){a.fn.supersubs=function(b){var c=a.extend({},a.fn.supersubs.defaults,b);return this.each(function(){var d=a(this);var e=a.meta?a.extend({},c,d.data()):c;var f=a('<li id="menu-fontsize">&#8212;</li>').css({padding:0,position:"absolute",top:"-999em",width:"auto"}).appendTo(d).width();a("#menu-fontsize").remove();$ULs=d.find("ul");$ULs.each(function(l){var k=$ULs.eq(l);var j=k.children();var g=j.children("a");var m=j.css("white-space","nowrap").css("float");var h=k.add(j).add(g).css({"float":"none",width:"auto"}).end().end()[0].clientWidth/f;h+=e.extraWidth;if(h>e.maxWidth){h=e.maxWidth}else{if(h<e.minWidth){h=e.minWidth}}h+="em";k.css("width",h);j.css({"float":m,width:"100%","white-space":"normal"}).each(function(){var n=a(">ul",this);var i=n.css("left")!==undefined?"left":"right";n.css(i,h)})})})};a.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);(function(a){a.fn.lightBox=function(p){p=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,fixedNavigation:false,imageLoading:"images/lightbox-ico-loading.gif",imageBtnPrev:"images/lightbox-btn-prev.gif",imageBtnNext:"images/lightbox-btn-next.gif",imageBtnClose:"images/lightbox-btn-close.gif",imageBlank:"images/lightbox-blank.gif",containerBorderSize:10,containerResizeSpeed:400,txtImage:"Image",txtOf:"of",keyToClose:"c",keyToPrev:"p",keyToNext:"n",imageArray:[],activeImage:0},p);var i=this;function r(){o(this,i);return false}function o(v,u){a("embed, object, select").css({visibility:"hidden"});c();p.imageArray.length=0;p.activeImage=0;if(u.length==1){p.imageArray.push(new Array(v.getAttribute("href"),v.getAttribute("title")))}else{for(var t=0;t<u.length;t++){p.imageArray.push(new Array(u[t].getAttribute("href"),u[t].getAttribute("title")))}}while(p.imageArray[p.activeImage][0]!=v.getAttribute("href")){p.activeImage++}l()}function c(){a("body").append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+p.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+p.imageBtnClose+'"></a></div></div></div></div>');var t=f();a("#jquery-overlay").css({backgroundColor:p.overlayBgColor,opacity:p.overlayOpacity,width:t[0],height:t[1]}).fadeIn();var u=h();a("#jquery-lightbox").css({top:u[1]+(t[3]/10),left:u[0]}).show();a("#jquery-overlay,#jquery-lightbox").click(function(){b()});a("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){b();return false});a(window).resize(function(){var v=f();a("#jquery-overlay").css({width:v[0],height:v[1]});var w=h();a("#jquery-lightbox").css({top:w[1]+(v[3]/10),left:w[0]})})}function l(){a("#lightbox-loading").show();if(p.fixedNavigation){a("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}else{a("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}var t=new Image();t.onload=function(){a("#lightbox-image").attr("src",p.imageArray[p.activeImage][0]);j(t.width,t.height);t.onload=function(){}};t.src=p.imageArray[p.activeImage][0]}function j(w,z){var t=a("#lightbox-container-image-box").width();var y=a("#lightbox-container-image-box").height();var x=(w+(p.containerBorderSize*2));var v=(z+(p.containerBorderSize*2));var u=t-x;var A=y-v;a("#lightbox-container-image-box").animate({width:x,height:v},p.containerResizeSpeed,function(){g()});if((u==0)&&(A==0)){if(a.browser.msie){n(250)}else{n(100)}}a("#lightbox-container-image-data-box").css({width:w});a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({height:z+(p.containerBorderSize*2)})}function g(){a("#lightbox-loading").hide();a("#lightbox-image").fadeIn(function(){k();s()});q()}function k(){a("#lightbox-container-image-data-box").slideDown("fast");a("#lightbox-image-details-caption").hide();if(p.imageArray[p.activeImage][1]){a("#lightbox-image-details-caption").html(p.imageArray[p.activeImage][1]).show()}if(p.imageArray.length>1){a("#lightbox-image-details-currentNumber").html(p.txtImage+" "+(p.activeImage+1)+" "+p.txtOf+" "+p.imageArray.length).show()}}function s(){a("#lightbox-nav").show();a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({background:"transparent url("+p.imageBlank+") no-repeat"});if(p.activeImage!=0){if(p.fixedNavigation){a("#lightbox-nav-btnPrev").css({background:"url("+p.imageBtnPrev+") left 15% no-repeat"}).unbind().bind("click",function(){p.activeImage=p.activeImage-1;l();return false})}else{a("#lightbox-nav-btnPrev").unbind().hover(function(){a(this).css({background:"url("+p.imageBtnPrev+") left 15% no-repeat"})},function(){a(this).css({background:"transparent url("+p.imageBlank+") no-repeat"})}).show().bind("click",function(){p.activeImage=p.activeImage-1;l();return false})}}if(p.activeImage!=(p.imageArray.length-1)){if(p.fixedNavigation){a("#lightbox-nav-btnNext").css({background:"url("+p.imageBtnNext+") right 15% no-repeat"}).unbind().bind("click",function(){p.activeImage=p.activeImage+1;l();return false})}else{a("#lightbox-nav-btnNext").unbind().hover(function(){a(this).css({background:"url("+p.imageBtnNext+") right 15% no-repeat"})},function(){a(this).css({background:"transparent url("+p.imageBlank+") no-repeat"})}).show().bind("click",function(){p.activeImage=p.activeImage+1;l();return false})}}m()}function m(){a(document).keydown(function(t){d(t)})}function e(){a(document).unbind()}function d(t){if(t==null){keycode=event.keyCode;escapeKey=27}else{keycode=t.keyCode;escapeKey=t.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key==p.keyToClose)||(key=="x")||(keycode==escapeKey)){b()}if((key==p.keyToPrev)||(keycode==37)){if(p.activeImage!=0){p.activeImage=p.activeImage-1;l();e()}}if((key==p.keyToNext)||(keycode==39)){if(p.activeImage!=(p.imageArray.length-1)){p.activeImage=p.activeImage+1;l();e()}}}function q(){if((p.imageArray.length-1)>p.activeImage){objNext=new Image();objNext.src=p.imageArray[p.activeImage+1][0]}if(p.activeImage>0){objPrev=new Image();objPrev.src=p.imageArray[p.activeImage-1][0]}}function b(){a("#jquery-lightbox").remove();a("#jquery-overlay").fadeOut(function(){a("#jquery-overlay").remove()});a("embed, object, select").css({visibility:"visible"})}function f(){var v,t;if(window.innerHeight&&window.scrollMaxY){v=window.innerWidth+window.scrollMaxX;t=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){v=document.body.scrollWidth;t=document.body.scrollHeight}else{v=document.body.offsetWidth;t=document.body.offsetHeight}}var u,w;if(self.innerHeight){if(document.documentElement.clientWidth){u=document.documentElement.clientWidth}else{u=self.innerWidth}w=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){u=document.documentElement.clientWidth;w=document.documentElement.clientHeight}else{if(document.body){u=document.body.clientWidth;w=document.body.clientHeight}}}if(t<w){pageHeight=w}else{pageHeight=t}if(v<u){pageWidth=v}else{pageWidth=u}arrayPageSize=new Array(pageWidth,pageHeight,u,w);return arrayPageSize}function h(){var u,t;if(self.pageYOffset){t=self.pageYOffset;u=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;u=document.documentElement.scrollLeft}else{if(document.body){t=document.body.scrollTop;u=document.body.scrollLeft}}}arrayPageScroll=new Array(u,t);return arrayPageScroll}function n(v){var u=new Date();t=null;do{var t=new Date()}while(t-u<v)}return this.unbind("click").click(r)}})(jQuery);function addSelectBlanks(){$("select").each(function(){var a,c,b;a=$(this);b=a.val();c=a.children().eq(0);if(c.attr("value")!==""||c.attr("tagname")==="OPTGROUP"){$("<option value=''>------</option>").insertBefore(c)}if(b===""){a.val(b)}})}function update_tweet(){var a=$("#tweet").hide();a.load(a.attr("rel"),function(){a.fadeIn()})}function login_page(){$("#id_username").focus();var a=$("#loginForm").attr("rel"),b=$("div.switchedForms"),c=$("a.switchForm");$("div.switchedForms").each(function(){var d=$(this);if(d.attr("id")!==a){d.hide()}});$("a.switchForm").each(function(){var d=$(this);if(d.attr("href")==="#"+a){d.parents("p").hide()}});c.bind("click",function(g){var i,f,d,h;g.preventDefault();g.stopPropagation();f=$(this);d=f.attr("href");h=f.attr("id");b.each(function(){var j=$(this),e="#"+j.attr("id");if(e!==d){j.slideUp()}else{j.slideDown();$("input[type=text], input[type=email]",j).eq(0).focus()}});c.each(function(){var e=$(this),j=e.parents("p");if(e.attr("href")===d){j.hide()}else{j.show()}})})}jQuery.fn.evenTops=function(b){if(typeof b==="undefined"){b={}}var f={to:"lowest"},a,e,c,d;$.extend(f,b);$.each(this,function(g,k){var h=$(k),j;j=h.offset();if(a==null){a=h;c=a.offset()}if(e==null){e=h;d=e.offset()}if(j.top>c.top){a=h}if(j.top<d.top){e=h}c=a.offset();d=e.offset()});$.each(this,function(g,k){var h=$(k),j=h.offset().left;h.offset({top:c.top,left:j})})};jQuery(document).ready(function(){$("#mainNav").superfish({animation:{height:"show"},delay:900});$("ul.messages > li").fadeTo(0,0,function(){$(this).fadeTo(1200,1)});login_page();$("a.lightbox, a.imageLink").lightBox({imageLoading:"/site_media/images/lightbox-ico-loading.gif",imageBtnClose:"/site_media/images/lightbox-btn-close.gif",imageBtnNext:"/site_media/images/lightbox-btn-next.gif",imageBtnPrev:"/site_media/images/lightbox-btn-prev.gif",imageBlank:"/site_media/images/lightbox-blank.gif"});addSelectBlanks();$(".blinkMe").effect("pulsate");var d,a=0,f=0;$(".column ul.buttons").evenTops();$(".column .testimonialList").evenTops();$('input[name*="date"]').datepicker({changeYear:true,yearRange:"-45:+1",showButtonPanel:false});var c,e,g,b;c=$("#id_tweet_iframe").eq(0);e=function(){var i,h;i=c.contents();h=$("div.tweet",i).outerHeight(true);c.height(h)};c.bind("load",e);e();g=$("#authBoxIframe").eq(0);b=function(){var l,i,j,k;l=g.contents();k=$("#authBox p",l).eq(0);i=k.outerWidth();j=k.outerHeight();g.height(j);$("#authBoxInnerWrapper").height(j)};$(g.attr("contentDocument")).bind("load",b);b()});function set_requirement(c,b){var a,d;d=c.parents("div.widgetRow");a=d.hasClass("required");if(b){if(a){return}d.addClass("required")}else{d.removeClass("required")}}function restripe_all(){$(".formset > li:visible:even").removeClass("odd").addClass("even");$(".formset > li:visible:odd").removeClass("even").addClass("odd")}var ChoiceManager={lookup:function(b){var a=this;return a.element.find("[value='"+b+"']").eq(0).attr("text")},updatenames:function(){if(this.options.choicevalues.length===0){return}var a=this,b=function(c){return a.element.find("[value='"+c+"']").eq(0).attr("text")};a.options.choicenames=$.map(a.options.choicevalues,b)},getelement:function(){return this.element},valuesfromelement:function(){var a=this.element.val();if(a===null){return}this.options.choicevalues=$.map(a,function(c,b){return c.toString()});this.updatenames()},add:function(a){if(typeof(a)==="undefined"){return}if(this.element.attr("multiple")===true){a=a.toString();if($.inArray(a,this.options.choicevalues)===-1){this.options.choicevalues.push(a);this.element.val(this.options.choicevalues)}else{}}else{this.options.choicevalues=a;this.element.val(a)}this.updatenames();this.updatechoicedisplay();this.element.change()},remove:function(a){if(typeof(a)==="undefined"){a=null}a=a.toString();if(this.element.attr("multiple")===true){if($.inArray(a,this.options.choicevalues)>-1){this.options.choicevalues.splice($.inArray(a,this.options.choicevalues),1);this.element.val(this.options.choicevalues)}else{this.options.choicevalues=null;this.element.val(null)}}},choicevalues:function(){return this.options.choicevalues},choicenames:function(){return this.options.choicenames},updatechoicedisplay:function(){if(typeof(this.choiceList)==="undefined"){return}this.choiceList.children().remove();var a=this,b=a.choicenames();if(b.length===0){$("<li>None selected</li>").appendTo(a.choiceList);return}$.each(b,function(c,e){var d=e;$("<li class='choice'>"+e+"</li>").attr("title","Click to remove.").click(function(){var g,f=$(this);g=a.reverseLookup[d];$("<div>Are you sure you want to remove "+f.text()+"?</div>").dialog({title:"Are you sure?",buttons:{Remove:function(){$(this).dialog("close");a.remove(g);f.fadeOut("slow",function(){$(this).remove()})},Cancel:function(){$(this).dialog("close")}},modal:true})}).appendTo(a.choiceList)})},buildreverselookup:function(){this.reverseLookup={};var a=this;this.element.find("option").each(function(){var b=$(this);a.reverseLookup[b.text()]=b.attr("value")})},_init:function(){this.buildreverselookup()},addCustomItem:function(c,d){var b,a=this;b=$("<option>").attr("value",c).text(d).prependTo(a.element);a.buildreverselookup()},_happytimes:function(){var a=this,b;b=a.input.val();if(b===""||b===null){return}a.add(a.reverseLookup[b]);a.updatenames();a.updatechoicedisplay();a.input.val("").blur().focus();a.choiceList.children().last().effect("pulsate")},_create:function(){this.options.addButtonTitle="Add "+this.options.thingName;this.options.inputPlaceHolder=this.options.thingName;this.options.addDialogTitle="Add New "+this.options.thingName;this.valuesfromelement();var a=this,b=$(this);a.element.addClass("paWidget");this.choiceList=$("<ul class='choices'><li class='choice'>No Selections.</li></ul>").insertAfter(this.element);this.updatechoicedisplay();a.element.hide();this.input=$("<input>").insertAfter(a.choiceList).autocomplete({source:function(d,c){var e=new RegExp(d.term,"i");c(a.element.children("option").map(function(){var g=$(this).text(),f;if(this.value&&(!d.term||e.test(g))){f={id:this.value,label:g,value:g};return f}}))},delay:0,minLength:0,close:function(){a._happytimes();a.input.val("").focus()}}).addClass("ui-widget ui-widget-content ui-corner-left").bind("blur",function(){a._happytimes()}).width(250);this.dropDownButton=$("<button>&nbsp;</button>").attr("tabIndex",-1).attr("title","Show All Items").insertAfter(a.input).button({icons:{primary:"ui-icon-triangle-1-s"},text:false}).removeClass("ui-corner-all").addClass("ui-corner-right ui-button-icon").click(function(c){c.stopPropagation();c.preventDefault();if(a.input.autocomplete("widget").is(":visible")){a.input.autocomplete("close");return}a.input.autocomplete("search","");a.input.focus()});this.addButton=$("<button>Add</button>").attr("title",this.options.addButtonTitle).addClass(this.options.addButtonClassName).insertAfter(a.dropDownButton).button({icons:{primary:"ui-icon-plusthick"},label:a.options.addButtonLabel}).click(function(f){f.stopPropagation();f.preventDefault();var c=a.input.val(),d;a.input.val("").blur().autocomplete("close");d=$("<form><p><input type='text' size='40' placeholder='"+a.options.inputPlaceHolder+"'></p></form>").dialog({title:a.options.addDialogTitle,buttons:{Add:function(){var e=$(this).find("input").val();$.getJSON(a.options.addURL,{name:e},function(g,h){a.addCustomItem(g.value,g.text);a.add(g.value)});$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}},modal:true});d.find("input").val(c).focus()})},options:{choicevalues:[],choicenames:[],thingName:"Item",thingNamePlural:"Items",addURL:"/qualifications/practice_areas/user_add",helpText:"Help text here.",addButtonClassName:"pa-add-button",addButtonLabel:"Add",allowAdd:true}};var ActiveRequirement={_get_fields:function(){return this.element.find(":input, select")},_get_current_state:function(){var a=this,b={};this._fields.each(function(){var d,c;d=$(this);c=d.attr("name").replace(a._name_regex,"");b[c]=d.val()});return b},_save_initial_state:function(){this.initial_state=this._get_current_state()},refresh_requirements:function(){if(typeof(this.element)==="undefined"){return}this.element.find(".required").addClass("shouldRequire").removeClass("reallyRequire");this.element.find(":not(.required)").removeClass("shouldRequire").removeClass("reallyRequire");var b=false,a=this;$.each(this._activators,function(c,f){var e,d=a.element.find(":input[name$="+f+"]");e=d.val();if(e===""||e===null){return true}b=true;return false});if(b===true){a.element.find(".shouldRequire").addClass("reallyRequire")}},_init:function(){var b,a=this;b=FORMSTEP_INFO.prefix+"-\\d+-";this._name_regex=new RegExp(b,"i");this._fields=this._get_fields();this._save_initial_state();this._activators=FORMSTEP_INFO.activate_requirements_when_set;$.each(this._activators,function(c,d){a.element.find(":input[name$="+d+"]").change(function(){$(this).closest(".formset").activeRequirement("refresh_requirements")})});this.refresh_requirements()}};var SimpleValidation={_is_blank:function(a){if(FORMSTEP_INFO.blank_if_all_blank===null){return false}var b=true;$.each(FORMSTEP_INFO.blank_if_all_blank,function(c,f){var e,d=a.find(":input[name$="+f+"]");e=d.val();if(e===""||e===null){return true}b=false;return false});return b},_check_required:function(a){var b=true;a.find(".required")},_simple_validation:function(a){var b=true;a.find(".required label").each(function(){var d,c=$(this).attr("for");d=$("#"+c).val();if(d===""||d===null){b=false;return false}});return b},_form_stats:function(){var c=0,b=0,d=0,a=this;$(".formset",this.element).each(function(){var e=$(this);if(a._is_blank(e)){++c;e.find(".errors").remove();return true}if(a._simple_validation(e)){++b;e.find(".errors").remove();return true}++d});return{blank_count:c,valid_count:b,invalid_count:d}},_update_errors:function(a){a.find(".required").each(function(){var d,b,c=$(this);b=$("#"+c.find("label").eq(0).attr("for"));d=b.val();if(d===""||d===null){c.find(".errors").remove();c.find(".widget").after($("<div class='errors'><ul class='errorlist'><li>This field is required.</li></ul></div>"))}else{c.find(".errors").remove()}})},_check_form:function(d){var b,c=$(this),a=this;b=a._form_stats();if(b.invalid_count===0&&b.valid_count>=FORMSTEP_INFO.min_num){return true}d.preventDefault();d.stopPropagation();if(b.invalid_count>0){$(".formset",a.element).each(function(){var h=$(this);if(a._is_blank(h)===true){return true}if(a._simple_validation(h)===false){a._update_errors(h);var g,f,e=$(".errors").eq(0);g=function(){e.effect("pulsate",{times:3},900).effect("transfer",{to:"div.content"});e.closest("li").effect("highlight",{times:3},900).find(".widget :input").eq(0).focus()};f=e.offset().top-$("#authBoxInnerWrapper").height();if(Math.abs($("html,body").scrollTop()-f)<10){$("html,body").animate({scrollTop:f},800,g)}else{$("html,body").animate({scrollTop:f},500,g)}}})}},_init:function(){var c=this.element,a=this,b=$(this);$(a.element).bind("submit",function(d){a._check_form(d)})},_create:function(){return},options:{}};(function(b){b.widget("ui.choiceManager",ChoiceManager);b.widget("ui.simpleValidation",SimpleValidation);b.widget("ui.activeRequirement",ActiveRequirement);b(".content form").eq(0).simpleValidation();var a,c="select[id*=-practice_areas]";b(c).choiceManager({helpText:"<span class='help'>Type in the box or use the arrow to select from a list of Practice Areas. If your Practice Area is not listed, click the Add button and enter it.</span>",thingName:"Practice Area",thingNamePlural:"Practice Areas"}).closest(".widgetRow").next("span.help").replaceWith("<span class='help'>Type in the box or use the arrow to select from a list of Practice Areas. If your Practice Area is not listed, click the Add button and enter it.</span>");a=["university of","college of","school of","the "];b("input[id*=-school_name]").autocomplete({source:"/qualifications/schools/search",minLength:2,search:function(e,f){var d=b(e.target).val().toLowerCase();b.each(a,function(g,h){if(h.indexOf(d)>=0){return false}})}})})(jQuery);$(document).ready(function(){var a;a=function(){var b,e,c,d;b=$(this);e=b.closest("ul.formset");c=function(){var j,k,f,g,i,h;f=$("li:has(span.widget > ul > li > label)",e);k=b.val();h=$("span.addLegendHere",b.closest("fieldset"));if(k===""||k===null){$("ul.formset > li",e.parent()).not(b.closest("li")).hide("fast");h.fadeOut(function(){h.text("")});return}j=CERT_INFO[k];h.fadeOut(function(){h.text(": "+j.name).fadeIn()});$('label[for$="major"]',e).text(j.major_label);$('label[for$="year"]',e).text(j.year_label);$.each(j.require_fields,function(l,m){$('label[for$="'+m+'"]',e).closest("div.widgetRow").addClass("required")});$.each(j.unrequire,function(l,m){$('label[for$="'+m+'"]',e).closest("div.widgetRow").removeClass("required")});b.closest(".formset").activeRequirement("refresh_requirements");$("label[for*=honors]",e).parents("div.widgetRow").removeClass("required");$.each(j.hide_fields,function(l,m){$('label[for$="'+m+'"]',e).closest("li").hide("fast")});$.each(j.show_fields,function(l,m){$('label[for$="'+m+'"]',e).closest("li").show("fast")});if(j.show_honors.length===0){f.hide("fast")}else{f.show("fast");$.each(j.show_honors,function(l,m){$("input:checkbox[id*=honors_][value="+m+"]",e).closest("li").show("fast")});$.each(j.hide_honors,function(l,n){var m="input:checkbox[id*=honors_][value="+n+"]";$(m,e).closest("li").hide("fast")})}};d=function(g){c();var f=window.setTimeout(restripe_all,1000)};b.change(d);b.trigger("change")};$(".formset").activeRequirement();$('select[name$="cert_type"]').each(a)});
