/*
	MultiColumn text reflower v1.4 by Randy Simons
		Modified version v1.4.Adrian001 as per http://adrian.kirk-burnnand.com/?p=39 by Adrian Kirk-Burnnand.
	
	License: (BSD-license)
		Copyright (c) 2007, Randy Simons

		All rights reserved.

		Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
		-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
		-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
		-Neither the name of Randy Simons nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

		THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
		"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
		LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
		A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
		CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
		EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
		PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
		PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
		LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
		NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
		SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	
	More information and contact:
		http://randysimons.com
*/
var multicolumn = null;var MultiColumnResizeTimer=null;var MultiColumnList=null;var MultiColumnSettings={extraHeight:15,minSplitHeight:0,minHeight:0,readOnText:"... read on",readOnHideOnColumnsFit:true,classReadOn:"readOn",classNameScreen:"article multicolumn-Columnized",classNamePrint:"article multicolumn-Print",numberOfColumns:null};function MultiColumn(_1,_2){this.getStyle=function(_3,_4,_5){var y=null;if(_3.currentStyle){y=_3.currentStyle[_5];}else{if(window.getComputedStyle&&document.defaultView.getComputedStyle(_3,null)){y=document.defaultView.getComputedStyle(_3,null).getPropertyValue(_4);}}return y;};this.generateColumns=function(){var i=0;var _8;var _9=this.columnContainer.getElementsByTagName("div").item(0);var _a=document.createElement("span");_a.style.display="block";_a.style.clear="both";_a.style.zoom="1";this.columnContainer.appendChild(_a);if(this.settings.numberOfColumns!=null){_8=this.settings.numberOfColumns;}else{_8=Math.floor(this.columnContainer.offsetWidth/(_9.offsetWidth));var _b=this.columnContainer.getElementsByTagName("P").length;if(_b<_8){_8=_b;}}var _c=Math.floor((this.columnContainer.offsetWidth-10)/_8)-parseInt(this.getStyle(_9,"padding-right","paddingRight"))-parseInt(this.getStyle(_9,"padding-left","paddingLeft"));for(i=1;i<_8;i++){this.columnContainer.insertBefore(_9.cloneNode(false),this.columnContainer.firstChild);}_9.style.width=_c+"px";var _d=this.columnContainer.getElementsByTagName("div");var _e;if(_9.offsetHeight<=this.settings.minSplitHeight){var _f=_9.offsetHeight;}else{var _10=Math.max(parseInt((_9.offsetHeight+_8*this.settings.extraHeight)/_d.length),this.settings.minHeight);}for(i=0;i<_d.length-1;i++){var _11=_d.item(i);_11.style.width=_c+"px";while(_11.offsetHeight<_10&&_9.hasChildNodes()){if(_9.firstChild.nodeType==1){_11.appendChild(_9.firstChild);}else{_9.removeChild(_9.firstChild);}}var _12=_11.lastChild;var _13=_d.item(i+1);switch(_12.nodeName.toLowerCase()){case "p":new ParapgraphWrapper(_11,_12,_13,_10);break;case "ul":case "ol":new ListWrapper(_11,_12,_13,_10);break;default:}new HeadingWrapper(_11,_13);if(this.settings.readOnText!=null){_11.appendChild(this.readOnNode.cloneNode(true));}}var _14=0;for(i=0;i<_d.length;i++){_14=Math.max(_14,_d.item(i).offsetHeight);}if(this.settings.readOnHideOnColumnsFit==true&&getWindowDimensions()["height"]>_14){for(i=0;i<_d.length;i++){if(_d.item(i).lastChild.className==this.settings.classReadOn){_d.item(i).lastChild.style.display="none";}}}else{for(i=0;i<_d.length;i++){if(_d.item(i).lastChild.className==this.settings.classReadOn){_d.item(i).lastChild.style.display="";}}}for(i=0;i<_d.length;i++){_14=Math.max(_14,_d.item(i).offsetHeight);}for(i=0;i<_d.length;i++){_d.item(i).style.height=_14+"px";}};this.settings=_2;this.columnContainer=_1;moveAllImages(this.columnContainer);if(this.settings.readOnText!=null){this.readOnNode=document.createElement("p");this.readOnNode.className=this.settings.classReadOn;this.readOnNode.appendChild(document.createElement("a"));this.readOnNode.firstChild.setAttribute("href","#readOn");this.readOnNode.firstChild.appendChild(document.createTextNode(this.settings.readOnText));var _15=document.createElement("a");_15.setAttribute("name","readOn");this.columnContainer.parentNode.insertBefore(_15,this.columnContainer);}if(this.settings.classNameScreen!=null){this.columnContainer.className=(this.columnContainer.className!=null?this.columnContainer.className+" ":"")+this.settings.classNameScreen;}if(this.settings.classNameScreen!=null){this.columnContainer.className=this.settings.classNameScreen;}this.originalContent=_1.cloneNode(true);if(this.settings.classNamePrint!=null){var _16=this.originalContent.cloneNode(true);_16.className=this.settings.classNamePrint;this.columnContainer.parentNode.insertBefore(_16,this.columnContainer);}if(MultiColumnList===null){MultiColumnList=new Array;if(window.addEventListener){window.addEventListener("resize",multiColumnSetResizeTimer,false);}else{window.attachEvent("onresize",multiColumnSetResizeTimer);}}MultiColumnList.push(this);this.generateColumns();}function multiColumnSetResizeTimer(){if(MultiColumnResizeTimer){clearTimeout(MultiColumnResizeTimer);}MultiColumnResizeTimer=setTimeout(multiColumnResize,100);}function multiColumnResize(){if(!window.addEventListener&&window.attachEvent){window.detachEvent("onresize",multiColumnSetResizeTimer);}for(var i=0;i<MultiColumnList.length;i++){var _18=MultiColumnList[i];var _19=_18.originalContent.cloneNode(true);_18.columnContainer.parentNode.replaceChild(_19,_18.columnContainer);_18.columnContainer=_19;_18.generateColumns();}if(!window.addEventListener&&window.attachEvent){setTimeout("window.attachEvent('onresize',multiColumnSetResizeTimer)",0);}}function ParapgraphWrapper(_1a,_1b,_1c,_1d){this.sourceColumn=_1a;this.height=_1d;this.processElement=function(_1e,_1f){var _20;while(_20=_1e.lastChild){if(_20.nodeType==1){var _21=_20.cloneNode(false);_1f.insertBefore(_21,_1f.firstChild);if(this.processElement(_20,_21)){return true;}}else{if(_20.nodeType==3){if(this.wrapTextNode(_20,_1f)){return true;}}}_1e.removeChild(_20);}return false;};this.wrapTextNode=function(_22,_23){var _24=_22.nodeValue;var _25=_24.split(/\s/);var _26=new Array();while(this.sourceColumn.offsetHeight>this.height&&_25.length>0){_26.push(_25.pop());_22.nodeValue=_25.join(" ");}var _27=(/^\s/.test(_24)?" ":"")+(_26.reverse().join(" "))+(/\s$/.test(_24)?" ":"");_23.insertBefore(document.createTextNode(_27),_23.firstChild);return this.sourceColumn.offsetHeight<=this.height;};_1c.insertBefore(_1b.cloneNode(false),_1c.firstChild);this.processElement(_1b,_1c.firstChild);if(_1b.offsetHeight==0){this.sourceColumn.removeChild(_1b);}}function ListWrapper(_28,_29,_2a,_2b){var _2c=_29.cloneNode(false);_2a.insertBefore(_2c,_2a.firstChild);while(currentElement=_29.lastChild){if(_28.offsetHeight<=_2b){break;}if(currentElement.nodeName.toLowerCase()=="li"){_2c.insertBefore(currentElement,_2c.firstChild);}else{_29.removeChild(currentElement);}}var _2d=1;var _2e=_29.childNodes;for(var i=0;i<_2e.length;i++){if(_2e[i].nodeName.toLowerCase()=="li"){_2d++;}}_2c.start=_2d;if(_29.offsetHeight==0){_28.removeChild(_29);}}function HeadingWrapper(_30,_31){if(/^h[1-6]$/i.test(_30.lastChild.nodeName)){_31.insertBefore(_30.lastChild,_31.firstChild);}}function moveAllImages(_32){var _33=_32.getElementsByTagName("IMG");if(_33.length>0){var _34=null;var _35=document.createElement("p");_35.id="multicolumn-Images";_35.className="multicolumn-Images";var _36=false;var _37=_32.getElementsByTagName("P").length;if(_37<=_33.length+8||_37<2){_36=true;}for(var i=_33.length-1;i>=0;i--){if(!_36){_34=document.createElement("a");_34.setAttribute("name","photo"+i);if(_35.childNodes.length==0){_35.appendChild(_33[i].cloneNode(false));_35.appendChild(_34);}else{_35.insertBefore(_34,_35.firstChild);_35.insertBefore(_33[i].cloneNode(false),_35.firstChild);}_33[i].style.height="auto";_33[i].style.width="100%";_34=document.createElement("a");_34.setAttribute("href","#photo"+i);_34.appendChild(_33[i].cloneNode(false));_34.appendChild(document.createElement("br"));_34.appendChild(document.createTextNode("Full photo follows below."));if(_33[i].parentNode.nodeName!="P"){_33[i].parentNode.replaceChild(_34,_33[i]);}}else{if(_35.childNodes.length==0){_35.appendChild(_33[i]);}else{_35.insertBefore(_33[i],_35.firstChild);}}}_32.parentNode.insertBefore(_35,_32.nextSibling);}}function getWindowDimensions(_39){var _3a,target2;_39=null;if(_39){_3a=_39.window;target2=_39.document;}else{_3a=window;target2=window.document;}var _3b=new Array();if(typeof (window.innerWidth)=="number"){_3b["width"]=_3a.innerWidth;_3b["height"]=_3a.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){_3b["width"]=target2.documentElement.clientWidth;_3b["height"]=target2.documentElement.clientHeight;}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){_3b["width"]=target2.body.clientWidth;_3b["height"]=target2.body.clientHeight;}else{_3b["width"]=0;_3b["height"]=0;}}}_39=null;return _3b;}
