    // #################### [+] Text-only state maintainer ####################
    // Checks the page url, if it finds the text-only parameter,
    // then it cycles through the anchors, tagging the text-only 
    // param to APNIC URLs. When it finds the text-only switch 
    // anchor, it either removes or appends the text-only param. 
    // and ammends the title text and content accordingly.
    // ########################################################################

    var attributes = window.location.href; // Get current URL
    var text = "view=text-only";           // Set text-only param
    var switchId = "text-only";            // Set the switch id

    // If text-only is ON
    if(attributes.indexOf(text)!=-1){      
        var allAnchors = document.getElementsByTagName("a");
        for (var i=0; i<allAnchors.length; i++){
            var theLink = allAnchors[i];
            // If APNIC url, doesn't already have param and not the switch...
            if((theLink.href.match(/^http[s]?\:\/\/www.apnic.net/i))&&
               (!theLink.href.match(text)&&(!theLink.id.match(switchId)))){
               // ... add correct param delimeter...
               if(theLink.href.match(/\?/)){
                   theLink.href+="&"
                }
                else{
                   theLink.href+="?"
                }
                // ... and add the param text
                theLink.href+=text;
            }
            // If the text-only switch...
            if(theLink.id.match(switchId)){
                // ... make the URL the current one, minus the param
                var regExpString = '[?&]?' + text;
                theLink.href=attributes.replace(new RegExp(regExpString),'');
                theLink.title = "click to exit text-only"; // Title text
                theLink.innerHTML = "<span>Exit text-only</span>"; // Link Text
            }
        }
    }
    // Else text-only is OFF
    else{
        var theLink = document.getElementById(switchId); // Get the switch link
        var paramChar = "?";                                // Set default param delimeter
        if(attributes.indexOf(paramChar)!=-1){paramChar ="&"}        // Change delimeter if needed
        // Make the URL the current one, plus the delimeter and the param
        theLink.href = attributes + paramChar + text;
        theLink.title = "click for text-only"; // Title text
        //theLink.innerHTML += " [off]"; // Link text
    }

