function init_toggle() {
    var top = document.getElementById('top');
    top.getElementsByTagName('h1')[0].setAttribute('id', 'more');
            
    var paras = top.getElementsByTagName('p');
    for (var i = 0; i < paras.length; i++) {
        if (paras[i].className != 'cutline') {
            var anchors = document.createElement('a');
            anchors.href = '#more';
            anchors.innerHTML = 'Back&hellip;'; // set all anchors to 'Back...'
            paras[i].appendChild(anchors);
        }
    }
    
    anchors = top.getElementsByTagName('a');
    var cols = [anchors[1].parentNode, anchors[3].parentNode];
    for (i = 0; i < cols.length; i++) {
        cols[i].style.display = 'none';
    }
    
    var a = [anchors[0], anchors[2]];
    for (i = 0; i < a.length; i++) {
        a[i].innerHTML = 'Read&nbsp;more'; // reset these anchors to 'Read more'
    }
    
    function toggle() {
        for (i = 0; i < cols.length; i++) {
            if (cols[i].style.display != 'none') {
                cols[i].style.display = 'none';
                a[i].style.display = '';
            } else {
                cols[i].style.display = 'block';
                a[i].style.display = 'none';
            }
        }
    }
    
    for (i = 0; i < anchors.length; i++) {
        anchors[i].onclick = toggle;
    }
}
    
window.onload = function() {
    if (document.getElementsByTagName && document.createElement) { 
        init_toggle();
    }       
}

/* Natalie Downe <http://natbat.net/2006/Dec/7/trycatchjavascript/> */

var css = document.createElement('link');
css.rel = 'stylesheet';
css.type = 'text/css';
css.media = 'screen';
css.href = 'css/noscript.css';

function setCSS(css) {
    try {
        document.getElementsByTagName('head')[0].appendChild(css);
    } catch (e) {
        setTimeout(function(){setCSS(css)}, 100);
    }
}

if (document.getElementsByTagName && document.createElement) {
    setCSS(css);
    css = null;
}
