/*==========================================================
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>src</th>";
  str+="  <th>width</th>";
  str+="  <th>height</th>";
  str+="</tr>\n";
  atag=document.all.tags("IMG");
  for(i in atag){
    x = atag[i].src;
    if(x==null){continue;}
    x="<img src="+atag[i].src+"><br>"+x;
    x=x.link(x);
    str+="<tr>\n";
    str+="  <td>"+atag[i].alt+"<br></td>";
    str+="  <td>"+x+"<br></td>";
    str+="  <td>"+atag[i].width+"<br></td>";
    str+="  <td>"+atag[i].height+"<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;
