// -- DIVアコーディオン -------
//	w_change(id,max_height)
//	id : 変更するID
//	max_height : 開くDIVの高さ(最大値)
// ----------------------------
function w_change(id,max_height) {
	this.id = id;
	this.m_h = max_height;

	if(typeof(getComputedStyle) != 'undefined') {
		current_width = getComputedStyle(document.getElementById(id),'').getPropertyValue('height');
		this.h = current_width.replace('px','');
	} else {
		current_width = document.getElementById(id).currentStyle['height'];
		this.h = current_width.replace("px","");
	}
	if (this.h == "auto") {
		document.getElementById(id).style.height = this.m_h + "px";
		this.h = this.m_h;
	} else if (this.h) {
		document.getElementById(id).style.height = this.h + "px";
	}

	if (this.h > 0) {
		mytime = setInterval(div_close,1);
	} else {
		mytime = setInterval(div_open,1);
	}
}

function div_close() {
	this.h = this.h - 4;
	if (this.h > 0) {
		document.getElementById(id).style.height = this.h + "px";
	} else {
		document.getElementById(id).style.height = "0px";
		clearInterval(mytime); 
	}
}

function div_open() {
	if (this.h < this.m_h) {
		this.h = Number(this.h) + 4;
		document.getElementById(id).style.height = this.h + "px";
	} else {
		clearInterval(mytime); 
	}
}

