Adapting the 3-column layout script to work with my blog

I’m in the process of adapting a 3 column layout script to work with my blog. This is a work in progress. The script has several big disadvantages, but I kinda like it, so I’m in the process of coming up with workarounds to make posts with many images and code examples look good.

Ultimately I’d like to figure out how to force it to figure out the column heights but then shift upward to the next

tag to “break” within spaces.

To counter the issue with Safari not showing the contents of the text area, I’m putting code in downloadable form, until I solve the cloneNode/textarea contents conundrum.

Some posts have very wide images, and I’m replacing those with clickable thumbnails, which will pop up a full sized image.

Forcing one-column layout:
However, some posts are just too complex to change, so I’ve added in a token to force the page to load in one column, which eliminates most spacing issues. An example is HERE

At the end of the article text, I add:

<script language="JavaScript" type="text/JavaScript">
var layoutToken=0;
initialize();
</script>

which sets the value of a variable called “layoutToken” to 0 and initializes it.

In the article.js script, I’ve added a couple of lines in the function initArticle() :
(at approx. line 532)

if (layoutToken == 0) columnMode = 1;
else columnMode = 3;

which simply means: “if the value of layoutToken is equal to 0, set the column mode to one column, otherwise go to three columns.”