function convertEntities(b){var d,a;d=function(c){if(/&[^;]+;/.test(c)){var f=document.createElement("div");f.innerHTML=c;return!f.firstChild?c:f.firstChild.nodeValue}return c};if(typeof b==="string"){return d(b)}else{if(typeof b==="object"){for(a in b){if(typeof b[a]==="string"){b[a]=d(b[a])}}}}return b};;function edShowExtraCookie(){var a=document.cookie.split(";");for(var b=0;b<a.length;b++){var c=a[b];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf("js_quicktags_extra")==0){if(c.substring(19,c.length)=="show"){return true}else{return false}}}return false}function edSetCookie(a,b,c,d,e){document.cookie=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+(d?"; path="+d:"")+(e?"; domain="+e:"")}function edInsertVia(a){myField=document.getElementById(a);var b=prompt("Enter the URL of the source link","http://");if(b){b='(Thanks <a href="'+b+'" rel="external">'+prompt("Enter the name of the source","")+"</a>)";edInsertContent(a,b)}}function countInstances(a,b){var c=a.split(b);return c.length-1}function edInsertFootnote(a){myField=document.getElementById(a);var b=prompt("Enter the footnote:","");if(!b||b==""){return false}var c=new Date;var d="fn"+c.getTime();var e=myField.value.indexOf('<ol class="footnotes">');if(e!=-1){var f=myField.value.substring(0,e);var g=myField.value.substring(e,myField.value.length);var h=countInstances(g,'<li id="')+1}else{var h=1}var h='<sup><a href="#'+d+'n" id="'+d+'" class="footnote">'+h+"</a></sup>";edInsertContent(a,h);if(e!=-1){f=myField.value.substring(0,e+h.length);g=myField.value.substring(e+h.length,myField.value.length)}else{var f=myField.value;var g="\n\n"+'<ol class="footnotes">'+"\n"+"</ol>"+"\n"}var i='\t<li id="'+d+'n">'+b+' [<a href="#'+d+'">back</a>]</li>'+"\n"+"</ol>";myField.value=f+g.replace("</ol>",i)}function edInsertImage(a){myField=document.getElementById(a);var b=prompt("Enter the URL of the image","http://");if(b){b='<img src="'+b+'" alt="'+prompt("Enter a description of the image","")+'" />';edInsertContent(a,b)}}function edInsertExtLink(a,b,c){myField=document.getElementById(a);if(!c){c="http://"}if(!edCheckOpenTags(a,b)){var d=prompt("Enter the URL",c);if(d){edButtons[b].tagStart='<a href="'+d+'" rel="external">';edInsertTag(a,b)}}else{edInsertTag(a,b)}}function edInsertLink(a,b,c){myField=document.getElementById(a);if(!c){c="http://"}if(!edCheckOpenTags(a,b)){var d=prompt("Enter the URL",c);if(d){edButtons[b].tagStart='<a href="'+d+'">';edInsertTag(a,b)}}else{edInsertTag(a,b)}}function edInsertContent(a,b){myField=document.getElementById(a);if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=b;myField.focus()}else if(myField.selectionStart||myField.selectionStart=="0"){var c=myField.selectionStart;var d=myField.selectionEnd;var e=myField.scrollTop;myField.value=myField.value.substring(0,c)+b+myField.value.substring(d,myField.value.length);myField.focus();myField.selectionStart=c+b.length;myField.selectionEnd=c+b.length;myField.scrollTop=e}else{myField.value+=b;myField.focus()}}function edInsertTag(a,b){myField=document.getElementById(a);if(document.selection){myField.focus();sel=document.selection.createRange();if(sel.text.length>0){sel.text=edButtons[b].tagStart+sel.text+edButtons[b].tagEnd}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){sel.text=edButtons[b].tagStart;edAddTag(a,b)}else{sel.text=edButtons[b].tagEnd;edRemoveTag(a,b)}}myField.focus()}else if(myField.selectionStart||myField.selectionStart=="0"){var c=myField.selectionStart;var d=myField.selectionEnd;var e=d;var f=myField.scrollTop;if(c!=d){myField.value=myField.value.substring(0,c)+edButtons[b].tagStart+myField.value.substring(c,d)+edButtons[b].tagEnd+myField.value.substring(d,myField.value.length);e+=edButtons[b].tagStart.length+edButtons[b].tagEnd.length}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){myField.value=myField.value.substring(0,c)+edButtons[b].tagStart+myField.value.substring(d,myField.value.length);edAddTag(a,b);e=c+edButtons[b].tagStart.length}else{myField.value=myField.value.substring(0,c)+edButtons[b].tagEnd+myField.value.substring(d,myField.value.length);edRemoveTag(a,b);e=c+edButtons[b].tagEnd.length}}myField.focus();myField.selectionStart=e;myField.selectionEnd=e;myField.scrollTop=f}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){myField.value+=edButtons[b].tagStart;edAddTag(a,b)}else{myField.value+=edButtons[b].tagEnd;edRemoveTag(a,b)}myField.focus()}}function edHideExtra(a){document.getElementById("ed_extra_buttons_"+a).style.display="none";document.getElementById("ed_extra_show_"+a).style.visibility="visible";edSetCookie("js_quicktags_extra","hide",new Date("December 31, 2100"))}function edShowExtra(a){document.getElementById("ed_extra_show_"+a).style.visibility="hidden";document.getElementById("ed_extra_buttons_"+a).style.display="block";edSetCookie("js_quicktags_extra","show",new Date("December 31, 2100"))}function edToolbar(a){document.write('<div id="ed_toolbar_'+a+'"><span>');for(i=0;i<extendedStart;i++){edShowButton(a,edButtons[i],i)}if(edShowExtraCookie()){document.write('<input type="button" id="ed_close_'+a+'" class="ed_button ed_closetags" onclick="edCloseAllTags(\''+a+'\');" value="Close Tags" />'+'<input type="button" id="ed_spell_'+a+'" class="ed_button ed_spell" onclick="edSpell(\''+a+'\');" value="Lookup" />')}else{document.write('<input type="button" id="ed_close_'+a+'" class="ed_button ed_closetags" onclick="edCloseAllTags(\''+a+'\');" value="Close Tags" />'+'<input type="button" id="ed_spell_'+a+'" class="ed_button ed_spell" onclick="edSpell(\''+a+'\');" value="Lookup" />')}for(i=extendedStart;i<edButtons.length;i++){}document.write("</span>");document.write("</div>");edOpenTags[a]=new Array}function edSpell(a){myField=document.getElementById(a);var b="";if(document.selection){myField.focus();var c=document.selection.createRange();if(c.text.length>0){b=c.text}}else if(myField.selectionStart||myField.selectionStart=="0"){var d=myField.selectionStart;var e=myField.selectionEnd;if(d!=e){b=myField.value.substring(d,e)}}if(b==""){b=prompt("Enter a word to look up:","")}if(b!=""){window.open(dictionaryUrl+escape(b))}}function edQuickLink(a,b){if(a>-1){var c="";if(edLinks[a].newWin==1){c=' target="_blank"'}var d='<a href="'+edLinks[a].URL+'"'+c+">"+edLinks[a].display+"</a>";b.selectedIndex=0;edInsertContent(edCanvas,d)}else{b.selectedIndex=0}}function edCloseAllTags(a){var b=edOpenTags[a].length;for(o=0;o<b;o++){edInsertTag(a,edOpenTags[a][edOpenTags[a].length-1])}}function edCheckOpenTags(a,b){var c=0;for(i=0;i<edOpenTags[a].length;i++){if(edOpenTags[a][i]==b){c++}}if(c>0){return true}else{return false}}function edRemoveTag(a,b){for(i=0;i<edOpenTags[a].length;i++){if(edOpenTags[a][i]==b){edOpenTags[a].splice(i,1);document.getElementById(edButtons[b].id+"_"+a).value=document.getElementById(edButtons[b].id+"_"+a).value.replace("/","")}}}function edAddTag(a,b){if(edButtons[b].tagEnd!=""){edOpenTags[a][edOpenTags[a].length]=b;document.getElementById(edButtons[b].id+"_"+a).value="/"+document.getElementById(edButtons[b].id+"_"+a).value}}function edShowLinks(){var a='<select onchange="edQuickLink(this.options[this.selectedIndex].value, this);"><option value="-1" selected>(Quick Links)</option>';for(i=0;i<edLinks.length;i++){a+='<option value="'+i+'">'+edLinks[i].display+"</option>"}a+="</select>";document.write(a)}function edShowButton(a,b,c){if(b.access){var d=' accesskey = "'+b.access+'"'}else{var d=""}switch(b.id){case"ed_img":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertImage(\''+a+'\');" value="'+b.display+'" />');break;case"ed_link":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertLink(\''+a+"', "+c+');" value="'+b.display+'" />');break;case"ed_ext_link":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertExtLink(\''+a+"', "+c+');" value="'+b.display+'" />');break;case"ed_footnote":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertFootnote(\''+a+'\');" value="'+b.display+'" />');break;case"ed_via":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertVia(\''+a+'\');" value="'+b.display+'" />');break;default:document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertTag(\''+a+"', "+c+');" value="'+b.display+'"  />');break}}function edLink(a,b,c){this.display=a;this.URL=b;if(!c){c=0}this.newWin=c}function edButton(a,b,c,d,e,f){this.id=a;this.display=b;this.tagStart=c;this.tagEnd=d;this.access=e;this.open=f}var dictionaryUrl="http://www.ninjawords.com/";var edButtons=new Array;var edLinks=new Array;var edOpenTags=new Array;edButtons.push(new edButton("ed_bold","B","<strong>","</strong>","b"));edButtons.push(new edButton("ed_italic","I","<em>","</em>","i"));edButtons.push(new edButton("ed_link","Link","","</a>","a"));edButtons.push(new edButton("ed_block","B-QUOTE","<blockquote>","</blockquote>","q"));edButtons.push(new edButton("ed_img","IMG","","","m",-1));edButtons.push(new edButton("ed_ul","UL","<ul>\n","</ul>\n\n","u"));edButtons.push(new edButton("ed_ol","OL","<ol>\n","</ol>\n\n","o"));edButtons.push(new edButton("ed_li","LI","\t<li>","</li>\n","l"));edButtons.push(new edButton("ed_code","CODE","<code>","</code>","c"));var extendedStart=edButtons.length;edLinks[edLinks.length]=new edLink("alexking.org","http://www.alexking.org/");jQuery(document).ready(function(a){a(".visual-form-builder").each(function(){a(this).validate({rules:{"vfb-secret":{required:true,digits:true,maxlength:2}},errorPlacement:function(a,b){if(b.is(":radio")||b.is(":checkbox")){a.appendTo(b.parent().parent())}else{a.insertAfter(b)}}})});a.validator.addMethod("phone",function(a,b){a=a.replace(/[\+\s\(\)\.\-\ ]/g,"");return this.optional(b)||a.length>9&&a.match(/^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/)},"Please enter a valid phone number. Most US/Canada and International formats accepted.");a(".vfb-date-picker").datepicker()});(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#xbb;</span>'].join("")),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(["li.",o.hoverClass].join("")).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(["ul.",c.menuClass,":first"].join(""))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$("li."+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(" ")).filter("li:has(ul)").removeClass(o.pathClass);});sf.o[s]=sf.op=o;$("li:has(ul)",this)[($.fn.hoverIntent&&!o.disableHI)?"hoverIntent":"hover"](over,out).each(function(){if(o.autoArrows){addArrow($(">a:first-child",this));}}).not("."+c.bcClass).hideSuperfishUl();var $a=$("a",this);$a.each(function(i){var $li=$a.eq(i).parents("li");$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7)){menuClasses.push(c.shadowClass);}$(this).addClass(menuClasses.join(" "));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined){this.toggleClass(sf.c.shadowClass+"-off");}};sf.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};sf.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(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:"";o.retainPath=false;var $ul=$(["li.",o.hoverClass].join(""),this).add(this).not(not).removeClass(o.hoverClass).find(">ul").hide().css("visibility","hidden");o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+"-off",$ul=this.addClass(o.hoverClass).find(">ul:hidden").css("visibility","visible");sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);;jQuery(document).ready(function($){$('#nav ul.superfish, #subnav ul.superfish, #header ul.nav, #header ul.menu').superfish({delay:100,animation:{opacity:'show',height:'show'},dropShadows:false});});
