 var fullPath = location.protocol + "//" + location.host + "/http";
 var visagePath = location.protocol + "//" + location.host;
 function printTopMenu() {
    var location = document.getElementById('qm0');    
            var data = eval( "(" + menuJSON + ")" );
            var faqsForCategory = data.menuList['MENU'];
            var html = "";
            /* Arrays are 1-based as a blank element must be added to the Atwone section to ensure there isn't a trailing ',' */
            for (var x=1; x < faqsForCategory.length; x++){
                var categoryurl = faqsForCategory[x].url;
                        if(categoryurl.indexOf("/") != 0){
                                    fSlash = "/";
                        }else{
                                    fSlash = "";
                        }
                        if(categoryurl.match("http://www.atec.net.au/http")){
                                    categoryurl = categoryurl.replace("http://www.atec.net.au/http", "http");
                                    html += "<li><a href=\"" + categoryurl + "\">" + faqsForCategory[x].title + "</a></li>";
                        }else{
                                    if(categoryurl.match("http")!=null){
                                                html += "<li><a href=\"" + categoryurl + "\">" + faqsForCategory[x].title + "</a></li>";
                                    }else if(theSession){
                                                html += "<li><a href=\"" + visagePath + "/session=" + theSession + fSlash + categoryurl + "\">" + faqsForCategory[x].title + "</a></li>";
                                    }else{
                                                html += "<li><a href=\"" + visagePath + "/" + categoryurl + "\">" + faqsForCategory[x].title + "</a></li>";
                                    }
                        }
    }            
            html += "</ul>";
            location.innerHTML = html;
 }