﻿// Copyright (c) 2009 HEditor.com
function links_list_text(path, page, records, words) {
    createHTTP();
    var xmldoc;
    if (window.ActiveXObject) {xmldoc = new ActiveXObject("Microsoft.XMLDOM");}
    else if (document.implementation && document.implementation.createDocument) {xmldoc = document.implementation.createDocument("", "doc", null);}
    xmldoc.async = false;
    xmldoc.load(path + "/" + page + ".xml");
    var root = xmldoc.documentElement;
    if (root != null) {
        clear(root);
        var nodes = root.childNodes.length;
        if (nodes < records) {records = nodes;}
        if (records > 0) {
            document.writeln("<ul>");
            for (var i = (nodes - 1); i > (nodes - 1 - records); i--) {
                clear(root.childNodes[i]);
                clear(root.childNodes[i].childNodes[1]);
                clear(root.childNodes[i].childNodes[2]);
                if (isNetscape) {document.writeln("<li><a href=\"" + root.childNodes[i].getElementsByTagName("website")[0].firstChild.nodeValue + "\" title=\"" + root.childNodes[i].getElementsByTagName("title")[0].firstChild.nodeValue + "\" target=\"_blank\">" + root.childNodes[i].getElementsByTagName("title")[0].firstChild.nodeValue.substring(0, words) + "</a></li>");}
                else {document.writeln("<li><a href=\"" + root.childNodes[i].selectNodes("website")(0).text + "\" title=\"" + root.childNodes[i].selectNodes("title")(0).text + "\" target=\"_blank\">" + root.childNodes[i].selectNodes("title")(0).text.substring(0, words) + "</a></li>");}}
                            document.writeln("</ul>");}}}