
function iCab_CollectLinksInWindow(win) {
    if (win && win.document) {
        var links = win.document.getElementsByTagName("a");
        if (links && links.length > 0) {
            for (var i=0; i<links.length; i++) {
                var link = links[i];
                if (link.href) {
                    var href = link.href;
                    var title = link.innerText;
                    if (iCab_AllLinks.length > 0) {
                        iCab_AllLinks += "&";
                    }
                    iCab_AllLinks += encodeURIComponent(href)+":"+encodeURIComponent(title);
                }
            }
        }
    
        if (win.frames) {
            for (i=0; i<win.frames.length; i++) {
                try {
                    if (win.frames[i] != win) {
                        iCab_CollectLinksInWindow(win.frames[i]);
                    }
                } catch(err) {
                }
            }
        }
    }
}

var iCab_AllLinks = "";
iCab_CollectLinksInWindow(window);
iCab_AllLinks;


