function trim(st){return st.replace(/^\s+|\s+$/g,"");}
function ltrim(st){return st.replace(/^\s+/,"");}
function rtrim(st){return st.replace(/\s+$/,"");}
function reverse(st){return st.split('').reverse().join('');}

function html_entity_decode(str) {
  var ta=document.createElement("textarea");
  ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  return ta.value;
}

// See DecodeText in ConSource3.dll
//    s = UnicodeToHTML(s, "34,39,92,>127")
function htmlEntities(str) {
	var c = '', ret = '';
	for(var i=0; i < str.length; i++) {
		c = str.charCodeAt(i);
		//if( (c > 47 && c < 58) || (c > 62 && c < 127) ) {
		if( (c < 127) ) {
			ret += str.charAt(i);
		}
		else {
			ret += "&#" + c + ";";
		}
	}
	return ret;
}

// Highlight cross-reference
// Grab entire div, insert span tags
function HighlightTopic(topic) {
	var hstart = '<span class="highlight">';
	var hend = '</span>'
	var crstart = '<!-- topicid' + topic + ' -->';
	var crend = '<!-- /topicid' + topic + ' -->';
	var d = document.getElementById('tpagebody').innerHTML;
	var start = d.indexOf(crstart);
	var end = d.indexOf(crend, start);
	var i = 0, j = 0; var x;
	var rStart = /<(?!\/|tr|table|tbody|thead|\!)([^>]+)>/gi;
	var rEnd = /<\/(?!tr|table|tbody|thead)/gi;
	var notCR = /<(?!\!)[^>]+>/gi;
	var notRevCR = />(?!\-)[^<]+</gi;
	while (start > -1 && end > start) {
		sel = d.substring(start + crstart.length, end);
		if (i==0) x = '<a class="h" name="' + topic + '"></a>';
		sel = sel.replace(rStart, '<$1>' + hstart).replace(rEnd, hend + '</');
		// Need to deal with sections without begin/end tags
		j = sel.search(notCR);
		if (j > 0) {
			sel = hstart + sel.substring(0, j) + hend + sel.substring(j);
			sel = reverse(sel);
			j = sel.search(notRevCR);
			if (j > 0) {
				sel = reverse(hend) + sel.substring(0, j) + reverse(hstart) + sel.substring(j);
			}
			sel = reverse(sel);
		}
		else {
			sel = hstart + sel + hend;
		}
		d = d.substring(0, start + crstart.length) + x + sel + d.substring(end);
		start = d.indexOf(crstart, start + crstart.length);
		end = d.indexOf(crend, start);
		x='';
	}
	document.getElementById('tpagebody').innerHTML = d;
	window.location.hash='#' + topic;
}

// Remove highlights
//$('#tpagebody span[class="highlight"]').replaceWith();
function UnHighlightAll(bUnselect) {
	var i, d, h, r, f;
	var links = document.getElementsByTagName('a');
	i = 0;
	while (d = links.item(i++)) {
		if (d.className == "h")
			d.parentNode.removeChild(d);
	}
	d = document.getElementById('tpagebody');
	var hspans = d.getElementsByTagName('span');
	while (h = hspans.item(0)) {
		if (h.className == "highlight") {
			if (h.hasChildNodes()) {
				f = document.createDocumentFragment();
				for (var j = 0; j < h.childNodes.length; j++) 
					f.appendChild(h.childNodes[j].cloneNode(true));
				h.parentNode.replaceChild(f, h);
			}
			else {
				h.parentNode.removeChild(h);
			}
		}
	}
	if (bUnselect) {
		radios = document.getElementsByTagName('input');
		i = 0;
		while (r = radios.item(i++)) {
			if (r.getAttribute("type") == "radio")
				r.checked = false;
		}
	}
}

// Buttons


// mcdropdown
(function($){$.fn.mcDropdown=function(list,options){var dd;this.each(function(){dd=$.data(this,"mcDropdown");if(dd){return false}new $.mcDropDownMenu(this,list,options)});return dd||this};$.mcDropdown={version:"1.2.07",setDefaults:function(options){$.extend(defaults,options)}};var defaults={minRows:15,maxRows:20,targetColumnSize:1,openFx:"slideDown",openSpeed:250,closeFx:"slideUp",closeSpeed:250,hoverOverDelay:200,hoverOutDelay:0,showFx:"show",showSpeed:0,hideFx:"hide",hideSpeed:0,dropShadow:true,autoHeight:true,lineHeight:19,screenPadding:10,allowParentSelect:false,delim:":",showACOnEmptyFocus:false,valueAttr:"rel",click:null,select:null,init:null};var isIE6=($.browser.version&&$.browser.version<=6);$.mcDropDownMenu=function(el,list,options){var $self,thismenu=this,$list,$divInput,settings,typedText="",matchesCache,oldCache,$keylist,$keylistiframe,bInput,bDisabled=false;$self=$(el);bInput=$self.is(":input");settings=$.extend({},defaults,options);if(settings.click==null){settings.click=function(e,dropdown,settings){dropdown.setValue(this.attr(settings.valueAttr))}}$(document).bind("click",function(e){var $target=$(e.target);var $ul=$target.parents().filter(function(){return this===$list[0]||(!!$keylist&&$keylist[0]===this)});if($ul.length){var bIsParent=$target.is(".mc_parent");if(bIsParent&&$keylist&&$ul[0]===$keylist[0]){clearTimeout(iBlurTimeout);updateValue($target.find("> ul > li:first"),false);e.stopPropagation();return false}else{if(!settings.allowParentSelect&&bIsParent){return false}}if($target.not(".mc_root")){hideBranch.apply($target.parent().parent()[0],[e])}if(settings.click!=null&&settings.click.apply($target,[e,thismenu,settings])==false){return false}}thismenu.closeMenu()});$list=(((typeof list=="object")&&!!list.jquery))?list:$(list);$list.appendTo("body").css({position:"absolute",top:-10000,left:-10000}).find("ul").andSelf().css("display","block").each(function(){var $el=$(this);$el.data("width",$el[0].clientWidth)}).css({top:0,left:0,display:"none"});$list.find("> li").addClass("mc_root");$("li > ul",$list).parent().addClass("mc_parent");$divInput=$('<div class="mcdropdown"><a href="#" tabindex="-1"></a><input type="hidden" name="'+(el.name||el.id)+'" id="'+(el.id||el.name)+'" /></div>').appendTo($('<div style="position: relative;"></div>')).parent();var $input=$self.replaceWith($divInput).attr({id:"",name:""});var $hidden=$divInput.find(":hidden");$divInput=$divInput.find(".mcdropdown").prepend($input);var $divInputClone=$divInput.clone().css({position:"absolute",top:-9999999,left:-999999,visibility:"visible"}).show().appendTo("body");var di={width:$divInputClone.width()-$("a",$divInputClone).width(),height:$divInputClone.outerHeight()};$divInputClone.remove();$.data($hidden[0],"mcDropdown",this);$divInput.parent().height(di.height);if($.browser.safari){setTimeout(function(){$self.width($divInput.width()-$("a",$divInput).width())},100)}$self.width(di.width).filter(":input").attr("autocomplete","off").bind("keypress",checkKeypress).bind("mousedown",function(e){$(this).triggerHandler("focus");e.stopPropagation();return false}).bind("contextmenu",function(){return false}).bind("focus",onFocus).bind("blur",onBlur);if($.browser.msie||$.browser.safari){$self.bind("keydown",function(e){if(",8,9,37,38,39,40,".indexOf(","+e.keyCode+",")>-1){return checkKeypress(e)}})}$("a",$divInput).bind("click",function(e){if(bDisabled){return false}thismenu.openMenu(e);return false});this.setValue=function(value,skipCallback){$hidden.val(value);var name=displayString(value);if(settings.select!=null&&skipCallback!=true){settings.select.apply(thismenu,[value,name])}return $self[bInput?"val":"text"](name)};if(bInput){this.setValue($self.attr("defaultValue"),true)}this.getValue=function(value){return[$hidden.val(),$self[bInput?"val":"text"]()]};this.openMenu=function(e){if($list.is(":visible")){return(!!e)?thismenu.closeMenu():false}function open(){columnizeList($list).hide();addBindings($list);anchorTo($divInput.parent(),$list,true);$list.find(".mc_hover").removeClass("mc_hover");$list[settings.openFx](settings.openSpeed,function(){scrollToView($list)});if(isIE6&&!!$.fn.bgIframe){$list.bgIframe()}}if(e){open()}else{setTimeout(open,1)}};this.closeMenu=function(e){$list.find("ul:visible").parent().each(function(){hideBranch.apply(this)});removeBindings($list);$list[settings.closeFx](settings.closeSpeed)};this.focus=function(){$self.focus()};this.disable=function(status){bDisabled=!!status;$divInput[bDisabled?"addClass":"removeClass"]("mcdropdownDisabled");$input.attr("disabled",bDisabled?"disabled":"")};function getNodeText($el){return $el.contents()[0]?$.trim($el.contents()[0].nodeValue):""}function getTreePath($li){if($li.length==0){return[]}var name=[getNodeText($li)];$li.parents().each(function(){var $el=$(this);if(this===$list[0]){return false}else{if($el.is("li")){name.push(getNodeText($el))}}});return name.reverse()}function displayValue(value){return getTreePath(getListItem(value))}function displayString(value){return displayValue(value).join(settings.delim)}function parseTree($selector){var s=[],level=(arguments.length>1)?++arguments[1]:1;$("> li",$selector).each(function(){var $self=$(this);var $ul=$("> ul",this);s.push({name:getNodeText($self),element:this,children:($ul.length)?parseTree($ul,level):[]})});return s}function addBindings(el){removeBindings(el);$("> li",el).bind("mouseover",hoverOver).bind("mouseout",hoverOut)}function removeBindings(el){$("> li",el).unbind("mouseover",hoverOver).unbind("mouseout",hoverOut)}function scrollToView($el){var p=position($el,true);var sd=getScreenDimensions();if(p.bottom>sd.y){$("html,body").animate({scrollTop:"+="+((p.bottom-sd.y)+settings.screenPadding)+"px"})}}function hoverOver(e){var self=this;var timer=$.data(self,"timer");if(!isNaN(timer)){clearTimeout(timer)}$(this).addClass("mc_hover");$.data(self,"timer",setTimeout(function(){showBranch.apply(self)},settings.hoverOverDelay))}function hoverOut(e){var self=this;var timer=$.data(self,"timer");if(!isNaN(timer)){clearTimeout(timer)}$(this).removeClass("mc_hover");$.data(self,"timer",setTimeout(function(){var $li=$(self);setTimeout(function(){if($li.parent().find("> li.mc_hover").length==0){$li.parents("li").each(function(){var self=this;clearTimeout($.data(self,"timer"));hideBranch.apply(self);if($(this).siblings().filter(".mc_hover").length>0){return false}})}},settings.hoverOverDelay);hideBranch.apply(self)},settings.hoverOutDelay));if(isIE6){e.stopPropagation()}}function getShadow(depth){var shadows=$self.data("shadows");if(!shadows){shadows={}}if(!shadows[depth]){shadows[depth]=$('<div class="mcdropdown_shadow"></div>').appendTo("body");if(!!$.fn.bgIframe){shadows[depth].bgIframe()}$self.data("shadows",shadows)}return shadows[depth]}function showBranch(){var self=this;var $ul=$("> ul",this);if($ul.is(":visible")||($ul.length==0)){return false}$(this).parent().find("> li ul:visible").not($ul).parent().each(function(){hideBranch.apply(this)});columnizeList($ul);addBindings($ul);var depth=$ul.parents("ul").length;var sd=getScreenDimensions();var li_coords=position($(this));$ul.css({top:li_coords.bottom,left:li_coords.marginLeft}).show();var menuBottom=$ul.outerHeight()+$ul.offset().top;if(menuBottom>sd.y){$ul.css("top",li_coords.bottom-(menuBottom-sd.y)-settings.screenPadding)}var showShadow=function(){if(settings.dropShadow){var $shadow=getShadow(depth);var pos=position($ul);$shadow.css({top:pos.top+pos.marginTop,left:pos.left+pos.marginLeft,width:pos.width,height:pos.height}).insertAfter($ul).show();$.data(self,"shadow",$shadow)}};if(settings.showSpeed<=0){showShadow()}else{$ul.hide()[settings.showFx](settings.showSpeed,showShadow)}}function hideBranch(){var $ul=$("> ul",this);if($ul.is(":hidden")||($ul.length==0)){return false}if(settings.dropShadow&&$.data(this,"shadow")){$.data(this,"shadow").hide()}if(isIE6){$ul.css("visibility","hidden").parent().removeClass("mc_hover")}$ul.stop()[settings.hideFx](settings.hideSpeed)}function position($el,bUseOffset){var bHidden=false;if($el.is(":hidden")){bHidden=!!$el.css("visibility","hidden").show()}var pos=$.extend($el[bUseOffset===true?"offset":"position"](),{width:$el.outerWidth(),height:$el.outerHeight(),marginLeft:parseInt($.curCSS($el[0],"marginLeft",true),10)||0,marginRight:parseInt($.curCSS($el[0],"marginRight",true),10)||0,marginTop:parseInt($.curCSS($el[0],"marginTop",true),10)||0,marginBottom:parseInt($.curCSS($el[0],"marginBottom",true),10)||0});if(pos.marginTop<0){pos.top+=pos.marginTop}if(pos.marginLeft<0){pos.left+=pos.marginLeft}pos.bottom=pos.top+pos.height;pos.right=pos.left+pos.width;if(bHidden){$el.hide().css("visibility","visible")}return pos}function anchorTo($anchor,$target,bUseOffset){var pos=position($anchor,bUseOffset);$target.css({position:"absolute",top:pos.bottom,left:pos.left});return pos.bottom}function getScreenDimensions(){var d={scrollLeft:$(window).scrollLeft(),scrollTop:$(window).scrollTop(),width:$(window).width(),height:$(window).height()};d.x=d.scrollLeft+d.width;d.y=d.scrollTop+d.height;return d}function getPadding(el,name){var torl=name=="height"?"Top":"Left",borr=name=="height"?"Bottom":"Right";return(parseInt("0"+$.curCSS(el,"border"+torl+"Width",true),10)+parseInt("0"+$.curCSS(el,"border"+borr+"Width",true),10)+parseInt("0"+$.curCSS(el,"padding"+torl,true),10)+parseInt("0"+$.curCSS(el,"padding"+borr,true),10)+parseInt("0"+$.curCSS(el,"margin"+torl,true),10)+parseInt("0"+$.curCSS(el,"margin"+borr,true),10))}function getListDimensions($el,cols){if(!$el.data("dimensions")){var ddWidth=$divInput.outerWidth();var width=(($el===$list)&&($el.data("width")*cols<ddWidth))?Math.floor(ddWidth/cols):$el.data("width");$el.data("dimensions",{column:width,item:width-getPadding($el.children().eq(0)[0],"width"),height:$el.height()})}return $el.data("dimensions")}function getHeight($el){if(settings.autoHeight===false){return settings.lineHeight}if(!$el.data("height")){$el.data("height",$el.outerHeight())}return $el.data("height")}function columnizeList($el){var $children=$el.find("> li");var items=$children.length;var calculatedCols=Math.ceil(items/settings.maxRows);var cols=!!arguments[1]?arguments[1]:(items<=settings.minRows)?1:(calculatedCols>settings.targetColumnSize)?calculatedCols:settings.targetColumnSize;var widths=getListDimensions($el,cols);var prevColumn=0;var columnHeight=0;var maxColumnHeight=0;var maxRows=Math.ceil(items/cols);var parentLIWidth=$el.parent("li").width();if(parentLIWidth>(widths.column*cols)){var widthDiff=parentLIWidth-widths.column;widths.column+=parentLIWidth;widths.item+=widthDiff}$el.css({visibility:"hidden",display:"block"});$children.each(function(i){var currentItem=i+1;var nextItemColumn=Math.floor((currentItem/items)*cols);var column=Math.floor((i/items)*cols);var $li=$(this);var marginTop;if(prevColumn!=column){marginTop=(columnHeight+1)*-1;columnHeight=0}else{marginTop=0}columnHeight+=(getHeight($li)||settings.lineHeight);$li.css({marginLeft:(widths.column*column),marginTop:marginTop,width:widths.item})[((nextItemColumn>column)||(currentItem==items))?"addClass":"removeClass"]("mc_endcol")[(marginTop!=0)?"addClass":"removeClass"]("mc_firstrow");if(columnHeight>maxColumnHeight){maxColumnHeight=columnHeight}prevColumn=column});if(($el!==$list)&&(maxColumnHeight+(settings.screenPadding*2)>=getScreenDimensions().height)){return columnizeList($el,cols+1)}$el.css("visibility","visible").height(maxColumnHeight);return $el}function getListItem(value){return $list.find("li["+settings.valueAttr+"='"+value+"']")}function getCurrentListItem(){return getListItem($hidden.val())}function onFocus(e){var $current=getCurrentListItem();var value=$self.val().toLowerCase();var treePath=value.toLowerCase().split(settings.delim);var currentNode=treePath.pop();var lastDelim=value.lastIndexOf(settings.delim)+1;typedText=treePath.join(settings.delim)+(treePath.length>0?settings.delim:"");setTimeout(function(){setSelection($self[0],lastDelim,lastDelim+currentNode.length)},0);if(!$keylist){$keylist=$('<ul class="mcdropdown_autocomplete"></ul>').appendTo("body");if(isIE6&&!!$.fn.bgIframe){$keylistiframe=$("<div></div>").bgIframe().appendTo("body")}}var bShowHidden=(!settings.showACOnEmptyFocus&&(typedText.length==0));var $siblings=($current.length==0||$current.hasClass("mc_root"))?$list.find("> li"):$current.parent().find("> li");showMatches($siblings,bShowHidden)}var iBlurTimeout;function onBlur(e){iBlurTimeout=setTimeout(function(){var $current=getCurrentListItem();if(!settings.allowParentSelect&&$current.is(".mc_parent")){var value=$current.find("li:not('.mc_parent'):first").attr(settings.valueAttr);thismenu.setValue(value,true)}if(settings.select!=null){settings.select.apply(thismenu,thismenu.getValue())}hideMatches()},200)}function showMatches($li,bShowHidden){var bCached=($li===oldCache),$items=bCached?$keylist.find("> li").removeClass("mc_hover mc_hover_parent mc_firstrow"):$li.clone().removeAttr("style").removeClass("mc_hover mc_hover_parent mc_firstrow mc_endcol").filter(":last").addClass("mc_endcol").end();if(!bCached||$keylist.is(":hidden")){$keylist.empty().append($items);anchorTo($divInput.parent(),$keylist,true);$items.hover(function(){$keylist.find("> li").removeClass("mc_hover_parent mc_hover");$(this).addClass("mc_hover")},function(){$(this).removeClass("mc_hover")});$items.find("> ul").css("display","none");$keylist.show();if(isIE6){var maxHeight=parseInt($keylist.css("max-height"),10)||0;if((maxHeight>0)&&(maxHeight<$keylist.height())){$keylist.height(maxHeight)}if(!!$.fn.bgIframe){anchorTo($divInput.parent(),$keylistiframe.css({height:$keylist.height(),width:$keylist.width()},true).show())}}if(bShowHidden!=true){scrollToView($keylist)}}if(bShowHidden===true){$keylist.css({visibility:"hidden",top:"-10000px",left:"-10000px"});if(isIE6&&!!$.fn.bgIframe){$keylistiframe.css("display","none")}}var $current=$keylist.find("li["+settings.valueAttr+"='"+$hidden.val()+"']");$current.addClass("mc_hover"+($current.is(".mc_parent")?"_parent":""));oldCache=matchesCache=$li;if($current.length>0&&(bShowHidden!=true)){scrollIntoView($current)}}function hideMatches(){if(isIE6&&!!$.fn.bgIframe&&$keylistiframe){$keylistiframe.hide()}if($keylist){$keylist.hide()}}function checkKeypress(e){var key=String.fromCharCode(e.keyCode||e.charCode).toLowerCase();var $current=getCurrentListItem();var $lis=($current.length==0||$current.hasClass("mc_root"))?$list.find("> li"):$current.parent().find("> li");var treePath=typedText.split(settings.delim);var currentNode=treePath.pop();var compare=currentNode+key;var selectedText=getSelection($self[0]).toLowerCase();var value=$self.val().toLowerCase();if(e.keyCode==38){moveMatch(-1);return false}else{if(e.keyCode==40){moveMatch(1);return false}else{if(e.keyCode==27){typedText="";thismenu.setValue("");showMatches($list.find("> li"));return false}else{if(e.keyCode==8||e.keyCode==37){compare=(e.keyCode==37)?"":currentNode.substring(0,currentNode.length-1);if(selectedText==currentNode){currentNode=""}if(treePath.length>0&&currentNode.length==0){updateValue($current.parent().parent());return false}else{if(selectedText==value){typedText="";thismenu.setValue("");return false}}}else{if(e.keyCode==9||e.keyCode==13||e.keyCode==39||key==settings.delim){var $first=$current.find("> ul > li:first");if($first.length>0){updateValue($first)}else{if($.browser.msie){setSelection($self[0],0,0)}if(e.keyCode==9){$self.triggerHandler("blur");hideMatches();return true}else{$self.trigger("blur");hideMatches()}}return false}else{if(selectedText==value){typedText="";compare=key}}}}}}matchesCache=findMatches($lis,compare);if(matchesCache.length>0){typedText=treePath.join(settings.delim)+(treePath.length>0?settings.delim:"")+compare;updateValue(matchesCache.eq(0),true)}else{compare=compare.length?compare.substring(0,compare.length-1):"";matchesCache=findMatches($lis,compare);if(matchesCache.length>0){showMatches(matchesCache)}else{hideMatches()}}e.preventDefault();return false}function moveMatch(step){var $current=getCurrentListItem(),$next,pos=0;if($current.length==0){$current=matchesCache.filter(".mc_hover, .mc_hover_parent")}if($current.length==0||$keylist.is(":hidden")){$current=matchesCache.eq(0);step=0}matchesCache.each(function(i){if(this===$current[0]){pos=i;return false}});if(!matchesCache||matchesCache.length==0||$current.length==0){return false}pos=pos+step;if(pos<0){pos=matchesCache.length-1}else{if(pos>=matchesCache.length){pos=0}}$next=matchesCache.eq(pos);updateValue($next,true)}function findMatches($lis,compare){var matches=$([]);$lis.each(function(){var $li=$(this),label=getNodeText($li);if(label.substring(0,compare.length).toLowerCase()==compare){matches=matches.add($li)}});return matches}function updateValue($li,keepTypedText){var $siblings=keepTypedText?matchesCache:($li.length==0||$li.hasClass("mc_root"))?$list.find("> li"):$li.parent().find("> li");var treePath=getTreePath($li);var currentNode=treePath.pop().toLowerCase();if(!keepTypedText){typedText=treePath.join(settings.delim).toLowerCase()+(treePath.length>0?settings.delim:"")}thismenu.setValue($li.attr(settings.valueAttr),true);setSelection($self[0],typedText.length,currentNode.length+typedText.length);$siblings.filter(".mc_hover,.mc_hover_parent").removeClass("mc_hover mc_hover_parent");$li.addClass("mc_hover"+($li.is(".mc_parent")?"_parent":""));showMatches($siblings)}function getSelection(field){var text="";if(field.setSelectionRange){text=field.value.substring(field.selectionStart,field.selectionEnd)}else{if(document.selection){var range=document.selection.createRange();if(range.parentElement()==field){text=range.text}}}return text}function setSelection(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}else{if(field.setSelectionRange){field.setSelectionRange(start,end)}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end}}}field.focus()}function scrollIntoView($el,center){var el=$el[0];var scrollable=$keylist[0];var s={pTop:parseInt($keylist.css("paddingTop"),10)||0,pBottom:parseInt($keylist.css("paddingBottom"),10)||0,bTop:parseInt($keylist.css("borderTopWidth"),10)||0,bBottom:parseInt($keylist.css("borderBottomWidth"),10)||0};if((el.offsetTop+el.offsetHeight)>(scrollable.scrollTop+scrollable.clientHeight)){scrollable.scrollTop=$el.offset().top+(scrollable.scrollTop-$keylist.offset().top)-((scrollable.clientHeight/((center==true)?2:1))-($el.outerHeight()+s.pBottom))}else{if(el.offsetTop-s.bTop-s.bBottom<=(scrollable.scrollTop+s.pTop+s.pBottom)){scrollable.scrollTop=$el.offset().top+(scrollable.scrollTop-$keylist.offset().top)-s.pTop}}}if(settings.init!=null){settings.init.apply(thismenu,[$input,$hidden,$list])}}})(jQuery);

// quicklinks
var clauses=$('<ul id="clausemenu" class="mcdropdown_menu"><li rel="head1" class="sec">Preamble<ul><li rel="5">We the People</li><li rel="6">More Perfect Union</li><li rel="7">Establish Justice</li><li rel="8">Insure Domestic Tranquility</li><li rel="9">Provide for the Common Defense</li><li rel="11">Promote the General Welfare</li><li rel="56">General Welfare</li><li rel="12">Blessings of Liberty</li><li rel="13">Do Ordain and Establish</li><li rel="14">This Constitution</li></ul></li><li rel="head2" class="sec">Article I<ul><li rel="head3" class="sec">Section 1<ul><li rel="15">All Legislative Powers/Legislative Vesting</li></ul></li><li rel="head4" class="sec">Section 2<ul><li rel="16">House of Representatives/Member Composition</li><li rel="17">Qualifications for House Electors/Elector Qualifications</li><li rel="18">Qualifications for Being a Representative</li><li rel="19">Three-fifths</li><li rel="20">Enumeration/Census</li><li rel="26">Congressional Vacancies</li><li rel="21">Allocation of Representation</li><li rel="22">Writs of Election</li><li rel="23">House Leadership/Speaker of the House</li><li rel="24">Power of Impeachment/Impeachment</li></ul></li><li rel="head5" class="sec">Section 3<ul><li rel="267">Senate Composition</li><li rel="25">Election of Senators</li><li rel="26">Senate Vacancies</li><li rel="27">Qualifications of Senators</li><li rel="28">Presiding Office/Vice President as Presiding Officer Tie-breaker in the Senate</li><li rel="29">President Pro-Tempore</li><li rel="30">Try All Impeachments/Trial of Impeachment</li><li rel="31">Judgment in Cases of Impeachment/Punishment for Impeachment</li></ul></li><li rel="head6" class="sec">Section 4<ul><li rel="32">Times, Places, and Manner</li><li rel="33">Congressional Regulation of Elections</li><li rel="34">Congress Shall Assemble/Meetings of Congress</li></ul></li><li rel="head7" class="sec">Section 5<ul><li rel="35">Congressional Qualifications</li><li rel="36">Quorum to do Business/Congressional Quorum</li><li rel="37">Compulsory Attendance</li><li rel="38">Rules of Proceedings</li><li rel="39">Punish and Expel</li><li rel="40">Journal of Proceedings/House Journals</li><li rel="41">Publication of Journal</li><li rel="271">Yeas and Nays</li><li rel="42">Congressional Adjournment</li></ul></li><li rel="head8" class="sec">Section 6<ul><li rel="43">Congressional Compensation</li><li rel="270">Privilege from Arrest</li><li rel="44">Speech and Debate</li><li rel="45">Ineligibility/Sinecure</li><li rel="46">Conflict of Interest/Incompatibility</li></ul></li><li rel="head9" class="sec">Section 7<ul><li rel="47">Revenue Bills</li><li rel="48">Presentment</li><li rel="49">Presidential Veto</li><li rel="50">Reconsideration of Veto</li><li rel="271">Yeas and Nays</li><li rel="51">Veto Override</li><li rel="52">Pocket Veto/Not Returned</li><li rel="53">Order, Resolution, or Vote</li></ul></li><li rel="head10" class="sec">Section 8<ul><li rel="54">Power to Tax/Spending</li><li rel="56">General Welfare</li><li rel="57">Uniformity of Taxation/Uniformity</li><li rel="58">Borrow Money/Borrowing</li><li rel="59">International Commerce/Commerce with Foreign Nations</li><li rel="60">Interstate Commerce</li><li rel="61">Indian Commerce</li><li rel="62">Naturalization</li><li rel="63">Bankruptcy</li><li rel="64">Coinage</li><li rel="65">Weights and Measures</li><li rel="66">Counterfeiting</li><li rel="67">Post Office</li><li rel="68">Patent and Copyright/Science and Arts</li><li rel="69">Tribunals Inferior to the Supreme Court</li><li rel="268">Define and Punish Piracies/Felonies on the High Seas</li><li rel="71">Law of Nations</li><li rel="72">Declare War</li><li rel="73">Marque and Reprisal</li><li rel="74">Captures</li><li rel="75">Raise and Support Armies/Army</li><li rel="76">Armies Appropriation</li><li rel="77">Navy</li><li rel="78">Rules for the Military/Military Regulations</li><li rel="79">Militia</li><li rel="81">Militia Organization</li><li rel="82">Exclusive Jurisdiction/Enclave</li><li rel="83">Military Installations</li><li rel="84">Necessary and Proper</li><li rel="85">All Other Powers Vested</li></ul></li><li rel="head11" class="sec">Section 9<ul><li rel="86">Migration and Importation/Slave Trade</li><li rel="87">Habeas Corpus</li><li rel="88">Federal Bill of Attainder</li><li rel="89">Federal Ex Post Facto</li><li rel="20">Enumeration/Census</li><li rel="90">Direct Taxes</li><li rel="91">Exportation Tax</li><li rel="92">Port Preference</li><li rel="93">Appropriations</li><li rel="94">Expenditure Accountability</li><li rel="95">Title of Nobility</li><li rel="272">Emoluments</li></ul></li><li rel="head12" class="sec">Section 10<ul><li rel="96">State Treaties</li><li rel="73">Marque and Reprisal</li><li rel="97">State Coinage/State Legal Tender</li><li rel="98">State Bill of Attainder</li><li rel="99">State Ex Post Facto</li><li rel="100">Obligations of Contracts</li><li rel="101">State Title of Nobility</li><li rel="102">Import-Export/State Prohibition of Duties</li><li rel="103">Congressional Control</li><li rel="104">Compact</li><li rel="105">Imminent Danger</li></ul></li></ul></li><li rel="head13" class="sec">Article II<ul><li rel="head14" class="sec">Section 1<ul><li rel="106">Executive Power/Executive Vestige</li><li rel="107">Presidential Term</li><li rel="108">Vice President</li><li rel="109">Presidential Electors</li><li rel="110">Electoral College</li><li rel="111">Presidential Election/Presidential Vote</li><li rel="112">Natural Born Citizen/Presidential Eligibility</li><li rel="113">Qualifications for President</li><li rel="114">Presidential Succession</li><li rel="115">Presidential Compensation</li><li rel="116">Presidential Oath of Office</li></ul></li><li rel="head15" class="sec">Section 2<ul><li rel="117">Commander in Chief</li><li rel="118">Commander of Militia</li><li rel="119">Opinion in Writing/Opinion</li><li rel="120">Reprieves and Pardons/Pardons</li><li rel="121">Advice and Consent</li><li rel="122">Treaty Making/Treaty</li><li rel="123">Appointments</li><li rel="124">Appointments of Inferior Officers</li><li rel="125">Recess Appointments</li></ul></li><li rel="head16" class="sec">Section 3<ul><li rel="126">State of the Union</li><li rel="127">Presidential Recommendations</li><li rel="128">Convening of Congress/Extraordinary Occasions</li><li rel="129">Receive Ambassadors and Public Ministers</li><li rel="130">Faithful Execution of the Laws/Take Care/Recommendations</li><li rel="131">Commission Officers</li></ul></li><li rel="head17" class="sec">Section 4<ul><li rel="132">Treason and Punishment/Presidential Removal/Standards for Impeachment</li><li rel="133">High Crimes and Misdemeanors</li></ul></li></ul></li><li rel="head18" class="sec">Article III<ul><li rel="head19" class="sec">Section 1<ul><li rel="134">Judicial Power/Judicial Vesting</li><li rel="135">Supreme Court</li><li rel="136">Inferior Courts</li><li rel="137">Good Behavior</li><li rel="138">Judicial Compensation</li></ul></li><li rel="head20" class="sec">Section 2<ul><li rel="139">Law and Equity</li><li rel="140">Arising Under</li><li rel="141">Authorized Treaties Jurisdiction/Treaties</li><li rel="142">Affecting Ambassadors and Public Ministers/Ambassadors</li><li rel="143">Admiralty and Maritime Jurisdiction/Admiralty</li><li rel="144">United States Jurisdiction/Federal Party</li><li rel="145">Interstate Controversies/Interstate Disputes</li><li rel="146">Citizen-State Diversity Jurisdiction</li><li rel="147">Diversity Jurisdiction</li><li rel="148">Claiming Lands Jurisdiction/Land Grant Jurisdiction</li><li rel="149">Original Jurisdiction</li><li rel="150">Appellate Jurisdiction</li><li rel="151">Exceptions and Regulations</li><li rel="152">Trial by Jury in Criminal Cases</li></ul></li><li rel="head21" class="sec">Section 3<ul><li rel="153">Treason Definition/Aid and Comfort to the Enemy</li><li rel="154">Treason Conviction</li><li rel="155">Punishment of Treason</li><li rel="156">Attainder of Treason</li><li rel="157">Corruption of Blood</li></ul></li></ul></li><li rel="head22" class="sec">Article IV<ul><li rel="head23" class="sec">Section 1<ul><li rel="158">Full Faith and Credit</li><li rel="159">Prescribe and Prove</li></ul></li><li rel="head24" class="sec">Section 2<ul><li rel="160">Privileges and Immunities</li><li rel="161">Extradition/Interstate Rendition</li><li rel="162">Fugitive Slave</li></ul></li><li rel="head25" class="sec">Section 2<ul><li rel="163">New States</li><li rel="164">United States Territory/Public Property</li><li rel="165">United States Claims/Claims</li></ul></li><li rel="head26" class="sec">Section 3<ul><li rel="166">Republican Form of Government/Guarantee</li><li rel="167">Protection Against Invasion</li><li rel="274">Protection from Domestic Violence</li></ul></li></ul></li><li rel="head27" class="sec">Article V<ul><li rel="168">Amendments</li><li rel="169">Slave Trade Exception/Prohibition on Slave Trade</li><li rel="170">State Representation in the Senate</li></ul></li><li rel="head28" class="sec">Article VI<ul><li rel="171">Debt Assumption</li><li rel="172">Supremacy</li><li rel="173">Oath of Office/Oath</li><li rel="174">No Religious Test/Religious Test</li></ul></li><li rel="head29" class="sec">Article VII<ul><li rel="175">Ratification</li><li rel="176">Signing/Attestation</li></ul></li><li rel="head30" class="sec">Amendments I-X<ul><li rel="head31" class="sec">Amendment I<ul><li rel="177">Establishment/Establishment of Religion/Freedom of Religion I</li><li rel="178">Free Exercise/Free Exercise of Religion/Freedom of Religion II</li><li rel="179">Freedom of Speech/Freedom of Expression I</li><li rel="180">Freedom of the Press/Freedom of Expression II</li><li rel="181">Right to Assemble/Freedom of Association I</li><li rel="182">Petition the Government/Freedom of Petition/Freedom of Association II</li></ul></li><li rel="head32" class="sec">Amendment II<ul><li rel="183">Well Regulated Militia</li><li rel="184">Keep and Bear Arms</li></ul></li><li rel="head33" class="sec">Amendment III<ul><li rel="185">Quartering of Troops</li></ul></li><li rel="head34" class="sec">Amendment IV<ul><li rel="186">Unreasonable Search and Seizure</li><li rel="187">Warrants/Warrant</li></ul></li><li rel="head35" class="sec">Amendment V<ul><li rel="188">Grand Jury</li><li rel="189">Military Cases/Grand Jury Exception</li><li rel="190">Double Jeopardy</li><li rel="191">Self-Incrimination</li><li rel="214">Federal Due Process</li><li rel="193">Takings/Eminent Domain</li><li rel="194">Just Compensation</li></ul></li><li rel="head36" class="sec">Amendment VI<ul><li rel="195">Speedy Trial</li><li rel="196">Public Trial</li><li rel="197">Impartial Jury</li><li rel="275">Trial in the State or District</li><li rel="198">Arraignment</li><li rel="199">Confrontation of Witness</li><li rel="200">Compulsory Process</li><li rel="201">Assistance of Counsel/Right to Counsel</li></ul></li><li rel="head37" class="sec">Amendment VII<ul><li rel="202">Trial by Jury in Common Law Cases</li><li rel="203">Reexamination/Reexamination of Facts</li></ul></li><li rel="head38" class="sec">Amendment VIII<ul><li rel="204">No Excessive Bail</li><li rel="205">Cruel and Unusual Punishments </li></ul></li><li rel="head39" class="sec">Amendment IX<ul><li rel="206">Enumeration of Rights/Rights Retained by the People</li></ul></li><li rel="head40" class="sec">Amendment X<ul><li rel="207">Powers Not Delegated/Reserved Powers of the States</li></ul></li></ul></li><li rel="head41" class="sec">Amendments XI-XXVI<ul><li rel="head42" class="sec">Amendment XI<ul><li rel="208">State Immunity/Suits Against a State</li></ul></li><li rel="head43" class="sec">Amendment XII<ul><li rel="209">Electoral College Alteration</li></ul></li><li rel="head44" class="sec">Amendment XIII<ul><li rel="210">Abolition of Slavery</li><li rel="211">Slavery Enforcement</li></ul></li><li rel="head45" class="sec">Amendment XIV<ul><li rel="212">Citizenship</li><li rel="213">Privileges or Immunities</li><li rel="192">State Due Process</li><li rel="215">State Equal Protection</li><li rel="216">Apportionment of Representatives</li><li rel="217">Reduction of Representation</li><li rel="218">Insurrection or Rebellion/Disqualification for Rebellion</li><li rel="219">Disability Removal</li><li rel="220">Validity of Debts/Debts Incurred During Rebellion</li><li rel="221">Enforcement - Amend. XIV</li></ul></li><li rel="head46" class="sec">Amendment XV<ul><li rel="222">Suffrage-Race/Voting Rights Protection</li><li rel="223">Enforcement - Amend. XV</li></ul></li><li rel="head47" class="sec">Amendment XVI<ul><li rel="224">Income Tax</li></ul></li><li rel="head48" class="sec">Amendment XVII<ul><li rel="225">Direct Election of Senators/Popular Election of Senators</li><li rel="226">Qualifications for Electors</li><li rel="227">Senate Vacancies/Vacancies in the Senate</li><li rel="228">Temporary Appointments</li><li rel="229">Exemption</li></ul></li><li rel="head49" class="sec">Amendment XVIII<ul><li rel="230">Federal Prohibition</li><li rel="231">Concurrent Enforcement</li><li rel="232">Inoperative - Amend. XVIII</li></ul></li><li rel="head50" class="sec">Amendment XIX<ul><li rel="233">Suffrage-Sex</li><li rel="234">Enforcement - Amend. XIX</li></ul></li><li rel="head51" class="sec">Amendment XX<ul><li rel="235">Terms of Office</li><li rel="236">Congress Shall Assemble</li><li rel="237">Electoral Contingency</li><li rel="238">Executive Death</li><li rel="240">Inoperative - Amend. XX</li></ul></li><li rel="head52" class="sec">Amendment XXI<ul><li rel="241">Repeal of (Federal) Prohibition</li><li rel="242">State Prohibition</li><li rel="243">Inoperative - Amend. XXI</li></ul></li><li rel="head53" class="sec">Amendment XXII<ul><li rel="244">Presidential Term Limit</li><li rel="245">The Two Year</li><li rel="247">Inoperative - Amend. XXII</li></ul></li><li rel="head54" class="sec">Amendment XXIII<ul><li rel="248">District Appointment</li><li rel="277">Federal Capital and Presidential Electors</li><li rel="253">Enforcement - Amend. XXIII</li></ul></li><li rel="head55" class="sec">Amendment XXIV<ul><li rel="254">Prohibition of Poll Tax/Poll Taxes</li><li rel="255">Enforcement - Amend. XXIV</li></ul></li><li rel="head56" class="sec">Amendment XXV<ul><li rel="256">Presidential Vacancy/Presidential Succession</li><li rel="257">Vice Presidential Vacancy</li><li rel="258">Written Declarations</li><li rel="259">Assumption of Powers</li><li rel="260">Resumption of Powers</li><li rel="261">Further Inability</li><li rel="262">Decide the Issue of Presidential Ability</li></ul></li><li rel="head57" class="sec">Amendment XXVI<ul><li rel="263">Suffrage-Age</li><li rel="264">Enforcement - Amend. XXVI</li></ul></li><li rel="head58" class="sec">Amendment XXVI<ul><li rel="265">Congressional Compensation</li></ul></li></ul></li></ul>');$(document).ready(function(){var A=$('<input type="text" name="clause" id="clause" value="" />');$("#quicklinks").after(A);$("#clause").mcDropdown(clauses,{delim:">",select:followLink})});function followLink(){var B=$("#clause");var A=B.val();if(!isNaN(parseInt(A))){window.location.assign("http://www.consource.org/index.asp?sid=28&taxlist="+A)}};

// jquery.rating.dm.pack.js
;if(window.jQuery)(function($){$.rating={cancel:'Cancel Rating',cancelValue:'',split:0,starWidth:16,groups:{},event:{fill:function(n,a,b,c){this.drain(n);$(a).prevAll('.star_group_'+n).andSelf().addClass('star_'+(c||'hover'));var d=$(a).children('a');val=d.text();if(b.focus)b.focus.apply($.rating.groups[n].valueElem[0],[val,d[0]])},drain:function(n,a,b){$.rating.groups[n].valueElem.siblings('.star_group_'+n).removeClass('star_on').removeClass('star_hover')},reset:function(n,a,b){if(!$($.rating.groups[n].current).is('.cancel'))$($.rating.groups[n].current).prevAll('.star_group_'+n).andSelf().addClass('star_on');var c=$(a).children('a');val=c.text();if(b.blur)b.blur.apply($.rating.groups[n].valueElem[0],[val,c[0]])},click:function(n,a,b){$.rating.groups[n].current=a;var c=$(a).children('a');val=c.text();$.rating.groups[n].valueElem.val(val);$.rating.event.drain(n,a,b);$.rating.event.reset(n,a,b);if(b.callback)b.callback.apply($.rating.groups[n].valueElem[0],[val,c[0]])}}};$.fn.rating=function(e){if(this.length==0)return this;e=$.extend({},$.rating,e||{});this.each(function(i){var a=$.extend({},e||{},($.metadata?$(this).metadata():($.meta?$(this).data():null))||{});var n=(this.name||'unnamed-rating').replace(/\[|\]/,"_");if(!$.rating.groups[n])$.rating.groups[n]={count:0};i=$.rating.groups[n].count;$.rating.groups[n].count++;$.rating.groups[n].readOnly=$.rating.groups[n].readOnly||a.readOnly||$(this).attr('disabled');if(i==0){$.rating.groups[n].valueElem=$('<input type="hidden" name="'+n+'" value=""'+(a.readOnly?' disabled="disabled"':'')+'/>');$(this).before($.rating.groups[n].valueElem);if($.rating.groups[n].readOnly||a.required){}else{$(this).before($('<div class="cancel"><a title="'+a.cancel+'">'+a.cancelValue+'</a></div>').mouseover(function(){$.rating.event.drain(n,this,a);$(this).addClass('star_on')}).mouseout(function(){$.rating.event.reset(n,this,a);$(this).removeClass('star_on')}).click(function(){$.rating.event.click(n,this,a)}))}};eStar=$('<div class="star"><a title="'+(this.title||this.value)+'">'+this.value+'</a></div>');$(this).after(eStar);if(a.half)a.split=2;if(typeof a.split=='number'&&a.split>0){var b=a.starWidth;var c=(i%a.split);var d=Math.floor(b/a.split);$(eStar).width(d).find('a').css({'margin-left':'-'+(c*d)+'px'})};$(eStar).addClass('star_group_'+n);if($.rating.groups[n].readOnly)$(eStar).addClass('star_readonly');else $(eStar).addClass('star_live').mouseover(function(){$.rating.event.drain(n,this,a);$.rating.event.fill(n,this,a,'hover')}).mouseout(function(){$.rating.event.drain(n,this,a);$.rating.event.reset(n,this,a)}).click(function(){$.rating.event.click(n,this,a)});if(this.checked)$.rating.groups[n].current=eStar;$(this).remove();if(i+1==this.length)$.rating.event.reset(n,this,a)});for(n in $.rating.groups)(function(c,v,n){if(!c)return;$.rating.event.fill(n,c,e||{},'on');$(v).val($(c).children('a').text())})($.rating.groups[n].current,$.rating.groups[n].valueElem,n);return this};$(function(){$('input[@type=radio].star').rating()})})(jQuery);

// jquery.metaData.pack.js
(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(a,b){this.defaults.type=a;this.defaults.name=b},get:function(a,b){var c=$.extend({},this.defaults,b);if(!c.single.length)c.single='metadata';var d=$.data(a,c.single);if(d)return d;d="{}";if(c.type=="class"){var m=c.cre.exec(a.className);if(m)d=m[1]}else if(c.type=="elem"){if(!a.getElementsByTagName)return;var e=a.getElementsByTagName(c.name);if(e.length)d=$.trim(e[0].innerHTML)}else if(a.getAttribute!=undefined){var f=a.getAttribute(c.name);if(f)d=f}if(d.indexOf('{')<0)d="{"+d+"}";d=eval("("+d+")");$.data(a,c.single,d);return d}}});$.fn.metadata=function(a){return $.metadata.get(this[0],a)}})(jQuery);
