
function init() {
	var frm = document.forms[0];
	if (frm.PROFLINK) {
		toggle(frm.PROFLINK, 'MA');
	}
	
	checkExpand('file_additional');
}

function toggle(fromObj, name) {
	var obj = eval("document.forms[0]." + name);
	if (obj != undefined) {
		if (fromObj.checked) {
			obj.disabled = true;
			clearCookie("bbsprof");
		} else {
			obj.disabled = false;
			setCookie("bbsprof", "1");
		}
	}
}
function setCookie(key, val, tmp) {
	exDay = new Date();
	exDay.setHours(exDay.getHours()+1);
	tmp = key + "=" + escape(val) + "; ";
	tmp += "expires=" + exDay.toGMTString() + ";domain=6404.teacup.com;path=/hiropon/";
	document.cookie = tmp;
}
function clearCookie(key) {
	exDay = new Date();
	exDay.setHours(exDay.getHours()-1);
    document.cookie = key + "=" + "delete;expires=" + exDay.toGMTString() + ";domain=6404.teacup.com;path=/hiropon/";
}

function imgSizeChange(img, m_width, m_height, m_src, l_width, l_height, l_src) {
	if(img.width == m_width) {
		img.src = l_src;
		img.width = l_width;
		img.height = l_height;
		img.alt='クリックで縮小';
	} else {
		img.src = m_src;
		img.width = m_width;
		img.height = m_height;
		img.alt='クリックで拡大';
	}
}

function checkExpand(ch) {
	var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
	if(obj && obj.style) obj.style.display=
		"none" == obj.style.display ? "" : "none"
}

function addFavorite() {
	var supported = false;
	if (window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel(document.title, location.href, "");
		supported = true;
	}
	else if (window.external) {
		try {
			window.external.AddFavorite(location.href, document.title);
			supported = true;
		}
		catch (e) {}
	}
	if (!supported)
		alert("お使いのブラウザではサポートされていません");
}

function postFormChange() {
	var frm = document.frmPost;
	frm.BODA.value = frm.BODA.value ? 0 : 1;
	frm.M.value = 'WF';
	frm.submit();
}