var scrj = 1;
function Scroll() {
   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat")
      var scdist = document.body.parentNode.scrollTop;
   else
      var scdist = document.body.scrollTop;
   if(scrj<80 && scdist) {
      scdist = (scdist>2) ? Math.ceil(scdist*.15) : 1;
      scrj++;
      scrollBy(0,-scdist);
      setTimeout("Scroll()",20);
   } else {
      scrollTo(0,0);
      scrj = 1;
   }
}
function openWin(URL,W,H,C) {
	if (C == 1) {
		scrW=screen.width;
		scrH=screen.height;
		openX = ((scrW/2) - (W/2));
		openY = ((scrH/2) - (H/2));
	} else {
		openX = 0;
		openY = 0;
	}
	scrH=screen.height -100;
	if (scrH < H){
		Ha = 500;
		Wa = W + 18;
		scrBars = 'yes';
	} else {
		Ha = H;
		Wa = W;
		scrBars = 'no';
	}
	winname = "image_" + URL.substring(0,3);
	if (navigator.appName == "Microsoft Internet Explorer") {
		if (navigator.platform.substr(0,3) == "Mac") {
			childWin = window.open("",winname,"directories=no,menubar=no,location=no,scrollbars="+ scrBars +",status=no,width=" + Wa+ ",height=" + Ha + ",left=" +  openX + ",top=" + openY );
		} else{
			childWin = window.open("",winname,"directories=no,menubar=no,location=no,scrollbars="+ scrBars +",status=no,width=" + Wa+ ",height=" + Ha + ",left=" +  openX + ",top=" + openY );
		}
	} else {
	childWin = window.open("",winname,"directories=no,menubar=no,location=no,scrollbars=no,status="+ scrBars +",width=" + Wa+ ",height=" + Ha + ",screenX=" +  openX + ",screenY=" + openY );
	}
	drawhtml(W,H,URL);
}

function drawhtml(W,H,URL){
childWin.focus();
childWin.document.open("text/html");
childWin.document.write("<html><head><title>SHIZECON.NET</title></head><body bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>\r\n");
childWin.document.write("<a href='JavaScript:self.close();'><img src=\""+URL+"\" width="+W+" height="+H+" border=0 alt=\"画像をクリックして閉じる\"></a>\r\n");
childWin.document.write("</body></html>");
return true;
}
