//ロールオーバーで画像変更（上部メニュー）
var defImg;
var a;
var b;
function ImgChange(target, img){
  if(document.getElementById){
    defImg = document.getElementById(target).getAttribute("src");
	a=defImg;	//（例→./img/chumon.png）
	b = a.length;	//aの文字数
	a=a.substring(0,b);	//（例→chumon.png。./img/を削除）

	c=a.substring(a.length-4,a.length);
	//alert("「" + c + "」");

	a=a.substring(0,a.length-4);//（例→chumon。.pngを削除）
	//alert("「" + a + "」");


    //document.getElementById(target).setAttribute("src", a + "_2.png");
    document.getElementById(target).setAttribute("src", a + "_2"+ c );
  }
}
function ImgBack(target){
  if(document.getElementById){
    document.getElementById(target).setAttribute("src",defImg);
  }
}
//文字数カウント（webフォームなど）
function ShowLength( str ) {
	if (str.length > 800) {
		document.getElementById("inputlength").innerHTML = str.length + "文字／<span class=\"red\">800文字を超えています！</span>";
	} else {
		document.getElementById("inputlength").innerHTML = str.length + "文字／残り" + (800-str.length) + "文字";
	}
}

function msover(i){
	//入力中
	document.forms[0].elements[i].style.backgroundColor="#f0f0f0";
	//document.forms[0].elements[i].style.borderColor="#000";	
	//document.forms[0].elements[i].style.border="solid 1px black";
}
function msout(i){
	//通常
	document.forms[0].elements[i].style.backgroundColor="#fff";
	//document.forms[0].elements[i].style.borderColor="#D4D0C8";


}
