function TcatchWrite(){

	IMG = 5;	/* ランダム表示 パターン数 */

	num = Math.floor(Math.random() * IMG);
	num = num+1;
	
	ImgNo = (num + "");

	document.write("<p class=\"bg",ImgNo,"\">");
}

function BannerWrite(MTBlogURL, IMG_num, FILE, URL, width, height){

	num_b = Math.floor(Math.random() * IMG_num);
	num_b = num_b+1;
	
	ImgNo_b = (num_b + "");
	
	document.write('<a href="',URL[ImgNo_b],'" target="_blank"><img src="'+MTBlogURL+'img/',FILE[ImgNo_b],'" width="'+width+'" height="'+height+'" alt=""></a><br>');
}

function chgsub(id) {
	if (navigator.appVersion > "3") {
		cls = document.getElementById(id).className; /* 現状のclsを取得 */
		onid = cls.indexOf("_on", 0);
		if( onid != -1 ){ /* マウスオフのとき、現状のclsに_onを足したものをclsとする */
			cls = cls.substr(0, onid);
		}else{ /* マウスオンのとき、現状のclsから_onを引いたものをclsとする */
			cls = cls+"_on";
		}
		document.getElementById(id).className = cls; /* 新しいclsを代入 */
	}
	return false;
}
