function mami_log(url)
{
url2="?["+url+"]";
ref=document.referrer;
document.write("<img src='http://www.yks.ne.jp/~mami/cgi/report.cgi?");
document.write(ref+url2+"' width=1 height=1>");
document.write("<img src='http://blog.nsk.ne.jp/util/acc.php?bl_id=1174&referrer=");
document.write(ref+"' width=1 height=1>");
}


function mami_log_bk(url)
{
url2="?["+url+"]";
if(document.referrer == parent.frames.location)
  { ref = top.document.referrer; }
  else { ref = document.referrer; }
document.write("<img src='http://www.yks.ne.jp/~mami/cgi/report.cgi?");
document.write(ref+url2+"' width=1 height=1>");
}


function cm()
{
  window.open("http://www2.nsknet.or.jp/~mami/cm.html","cm","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=580,height=450");
}


function top()
{
url="http://www2.nsknet.or.jp/~mami/";
if (window.name=="cm")
  {
  window.close("cm");
  window.open(url);
  }
  else {
       location.href(url);
       }
}


function dl(no)
{
location="http://www.yks.ne.jp/~mami/cgi/dcnt.cgi?n="+no;
}


function aj(no)
{
url="http://www.amazon.co.jp/exec/obidos/ASIN/"+no+"/ma3rin01-22";
window.open(url);
}

function rj(no)
{
url="http://px.a8.net/svt/ejp?a8mat=IEC9E+C9681E+5WS+C28PV&a8ejpredirect=http://www.rakuten.co.jp/"+no;
window.open(url);
}

function rij(no)
{
url="http://px.a8.net/svt/ejp?a8mat=IEC9E+C9681E+5WS+C28PV&a8ejpredirect=http://item.rakuten.co.jp/"+no;
window.open(url);
}

function cj(no)
{
url="http://px.a8.net/svt/ejp?a8mat=O6IQE+EDZ52Q+AIM+BW8O2&a8ejpredirect=http://www.chara-ani.com/list.asp?mode=t&tiid="+no;
window.open(url);
}



function mp(asx)
{
page=window.open("","mp","width=640,height=549");
page.focus();
page.document.open();
page.document.write("<html><head><title>まみりんBBS@ムービー再生ウインドウ</title></head>");
page.document.write("<body background='http://www2.nsknet.or.jp/~mami/bg.png' oncontextmenu='return false;' topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>");
page.document.write("<embed src='http://www2.nsknet.or.jp/~mami/asx/"+asx+".asx' width=640 height=549 type='application/x-mplayer2' DisplaySize=0 ShowStatusBar=1 Volume=0 enablecontextmenu=0>");
page.document.write("<img src='http://www.yks.ne.jp/~mami/cgi/report.cgi?");
page.document.write("http://?[MOVIE:"+asx+"]' width=1 height=1>");
page.document.write("</body></html>");
page.document.close();
}



function no_link()
{
  ref=document.referrer; 
  if(location.protocol!="file:" && ref.indexOf("http://www2.nsknet.or.jp/~mami/")!==0)
  {
  cm();
  window.alert("リンクはトップページへお願いします");
  location.replace("http://www2.nsknet.or.jp/~mami/");
  }
}


function mami_check()
{
  ref=document.referrer; 
  if(location.protocol!="file:" && ref.indexOf("http://www2.nsknet.or.jp/~mami/")!==0)
  {
  cm();
  window.alert("リンクはトップページへお願いします");
  location.replace("http://www2.nsknet.or.jp/~mami/");
  }
}


function mami_check2()
{
  ref=document.referrer; 
  if(location.protocol!="file:" && ref.indexOf("http://www2.nsknet.or.jp/~mami/")!==0)
  {
  cm();
  window.alert("リンクはトップページへお願いします");
  location.replace("http://www2.nsknet.or.jp/~mami/");
  }
}

function mami_fadein(speed)
{
  for(i=0; i<256; i=i+speed){ document.bgColor=i*65793; }
}


function mami_bgm(top_url)
{
  max=10;
  no=Math.floor(Math.random()*max);
  document.write("<embed src='"+top_url+"bgm/mami"+no+".mid' type='audio/midi' hidden=true width=0 height=0 autostart=true loop=true>");
}


function mami_update()
{
  last = new Date(document.lastModified);
  x = ""+last.getFullYear();
  y = "0"+(last.getMonth()+1);
  z = "0"+last.getDate();
  y = y.substring(y.length-2,y.length+1);
  z = z.substring(z.length-2,z.length+1);
  with (document) {
 write("[更新日は");
 write(x+"/"+y+"/"+z);
 write("です]");
  }
}


function mes_start()
{
  document.mes.box.value=msg;
  msg=msg.substring(1,msg.length)+msg.substring(0,1);
  setTimeout("mes_start()",300);
}


function mami_mes(message)
{
  document.write("<form name='mes'><input type='text' size='50' name='box'></form>");
  msg="　　　　　　　　　　　　　　　　　　　　"+message;
  mes_start();
}


function mami_ref()
{
  ref=document.referrer;
  document.write("☆ここへは「");
  if(ref!="" && ref!="[unknown origin]"){ document.write(ref); }
    else{ document.write("手打ち/ブックマーク/お気に入り"); }
  document.write("」から来たのね☆");
}



function clock_start()
{
  ct = new Date();
  x = ""+ct.getFullYear();
  y = "0"+(ct.getMonth()+1);
  z = "0"+ct.getDate();
  h = "0"+ct.getHours();
  m = "0"+ct.getMinutes();
  s = "0"+ct.getSeconds();
  d = "d"+ct.getDay();
  y = y.substring(y.length-2,y.length+1);
  z = z.substring(z.length-2,z.length+1);
  h = h.substring(h.length-2,h.length+1);
  m = m.substring(m.length-2,m.length+1);
  s = s.substring(s.length-2,s.length+1);
  x0 = x.substring(0,1);
  x1 = x.substring(1,2);
  x2 = x.substring(2,3);
  x3 = x.substring(3,4);
  y0 = y.substring(0,1);
  y1 = y.substring(1,2);
  z0 = z.substring(0,1);
  z1 = z.substring(1,2);
  h0 = h.substring(0,1);
  h1 = h.substring(1,2);
  m0 = m.substring(0,1);
  m1 = m.substring(1,2);
  s0 = s.substring(0,1);
  s1 = s.substring(1,2);
  with (document) {
 a1.src=""+url+"clk/"+x0+".gif";
 a2.src=""+url+"clk/"+x1+".gif";
 a3.src=""+url+"clk/"+x2+".gif";
 a4.src=""+url+"clk/"+x3+".gif";
 b1.src=""+url+"clk/"+y0+".gif";
 b2.src=""+url+"clk/"+y1+".gif";
 c1.src=""+url+"clk/"+z0+".gif";
 c2.src=""+url+"clk/"+z1+".gif";
 d1.src=""+url+"clk/"+d+".gif";
 e1.src=""+url+"clk/"+h0+".gif";
 e2.src=""+url+"clk/"+h1+".gif";
 f1.src=""+url+"clk/"+m0+".gif";
 f2.src=""+url+"clk/"+m1+".gif";
 g1.src=""+url+"clk/"+s0+".gif";
 g2.src=""+url+"clk/"+s1+".gif";
  }
  setTimeout('clock_start()',1000);
}


function mami_clock(top_url)
{
  url = top_url;
  with (document) {
 write("日付は");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='a1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='a2'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='a3'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='a4'>");
 write("<IMG SRC='"+url+"clk/y.gif' width=6 height=12>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='b1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='b2'>");
 write("<IMG SRC='"+url+"clk/y.gif' width=6 height=12>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='c1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='c2'>");
 write("<IMG SRC='"+url+"clk/a.gif' width=6 height=12>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='d1'>");
 write("<IMG SRC='"+url+"clk/b.gif' width=6 height=12>");
 write("です　現在時刻は");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='e1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='e2'>");
 write("<IMG SRC='"+url+"clk/x.gif' width=6 height=12>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='f1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='f2'>");
 write("<IMG SRC='"+url+"clk/x.gif' width=6 height=12>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='g1'>");
 write("<IMG SRC='"+url+"clk/z.gif' width=12 height=12 name='g2'>");
 write("です");
  }
  for (i=0; i<=9; i++){
    document.write("<img src='"+url+"clk/"+i+".gif' width=1 height=1>");
  }
  for (i=0; i<=6; i++){
    document.write("<img src='"+url+"clk/d"+i+".gif' width=1 height=1>");
  }
  setTimeout('clock_start()',9000);
}

