/*==========================================================
Script by jin-ren
　リンク解析
　ページ上のリンクをリストアップします。
                                                2002/09/08
==========================================================*/
var obj, document, id, ndoc, nid, atag ,str, x;

obj = new ActiveXObject("Sleipnir.API");
id = obj.GetDocumentID(obj.ActiveIndex);
document = obj.GetDocumentObject(id);

if (document == null)
{
  obj.MessageBox("Document を作成できません");
}
else
{

  str ="<html>\n";
  str+="<head>\n<title>リンク解析</title>\n";
  str+="<style>";
  str+="th{font:bold 12px;background-color:#cccccc;}";
  str+="td{font:10px;}";
  str+="</style>";
  str+="</head>";
  str+="<body>\n";
  str+="<table border=1>";
  str+="<tr>";
  str+="  <th>リンク</th>";
  str+="  <th>href</th>";
  str+="  <th>hash</th>";
  str+="  <th>target</th>";
  str+="  <th>name</th>";
  str+="  <th>search</th>";
  str+="</tr>\n";
  atag=document.links;
  for(i in atag){
    x = atag[i].href;
    if(x==null){continue;}
    x=x.link(x);
    str+="<tr>\n";
    str+="  <td>"+atag[i].innerText+"<br></td>";
    str+="  <td>"+x+"<br></td>";
    str+="  <td>"+atag[i].hash+"<br></td>";
    str+="  <td>"+atag[i].target+"<br></td>";
    str+="  <td>"+atag[i].name+"<br></td>";
    str+="  <td>"+atag[i].search+"<br></td>";
    str+="</tr>\n";
  };
  str+="</table>\n";
  str+="</body>\n";
  str+="</html>\n";

  nid = obj.NewWindow("about:blank",true);
  ndoc = obj.GetDocumentObject(nid);
  ndoc.write(str);
  ndoc.location.reload();
  ndoc = null;
  document = null;
}
obj.Beep();
obj = null;
