<!--
var can_submit = true;
var timeout_timer = 0;
function contactHide() {
	disableNotes = false;
	o = getObj('contact_div');
	if (o) o.style.display = 'none';
}
function contact_show(obj, pos) {
	if (typeof(hideAlbums) == 'function') hideAlbums();
	if (typeof(hideGroups) == 'function') hideGroups();
	disableNotes = true;
	o = getObj('contact_div');
	o.style.display = 'block';
	if (pos == 'tr') {
		o.style.left = getOffsetLeft(obj) + obj.offsetWidth;
		o.style.top = getOffsetTop(obj) - o.offsetHeight - 20;
	} else if (pos == 'mc') {
		x = obj.offsetWidth - o.offsetWidth; if (x < 5) x = 5;
		o.style.left = getOffsetLeft(obj) + x / 2;
		y = obj.offsetHeight - o.offsetHeight; if (y < 5) y = 5;
		o.style.top = getOffsetTop(obj) + y / 2;
	} else if (pos == 'tl') {
		o.style.left = getOffsetLeft(obj) + obj.offsetWidth - o.offsetWidth;
		o.style.top = getOffsetTop(obj) - o.offsetHeight;
	} else {
		o.style.left = getOffsetLeft(obj) + 10;
		o.style.top = getOffsetTop(obj) + 10;
	}
/*
	o = getObj('contact_form');
	o.elements['message[subject]'].value = subject;
	o.elements['message[text]'].value = body;
*/
}
function check_contact() {
	if (!can_submit) return false;
	o = getObj('contact_form');
	if (!/.+@.+\..+/.test(o.elements['message[email]'].value)) {
		alert('有効な電子メールアドレスを入力してください。');
		getObj('contact_submit').disabled = false;
		return false;
	}
	if (o.elements['message[subject]'].value.length < 1) {
		alert('題名を入力してください。');
		getObj('contact_submit').disabled = false;
		return false;
	}
	if (o.elements['message[text]'].value.length < 1) {
		alert('メッセージを入力してください。');
		getObj('contact_submit').disabled = false;
		return false;
	}
	can_submit = false;
	getObj('contact_buttons').style.display = 'none';
	o = getObj('contact_status');
	o.innerHTML = 'お待ちください...';
	o.style.display = 'block';
	timeout_timer = setTimeout('contact_timeout();', 8000);
	return true;
}
function contact_timeout() {
	timeout_timer = 0;
	getObj('contact_buttons').style.display = 'none';
	getObj('contact_submit').disabled = false;
	o = getObj('contact_status');
	o.innerHTML = '大変申し訳ありませんが、サーバーエラーが発生しております。';
	o.style.display = 'block';
	setTimeout('getObj("contact_status").style.display="none"; getObj("contact_buttons").style.display="block"; can_submit = true;', 3000);
}
function contact_error(err) {
	alert(err);
}
function contact_sent() {
	if (timeout_timer) {
		clearTimeout(timeout_timer);
		timeout_timer = 0;
	}
	getObj('contact_buttons').style.display = 'none';
	getObj('contact_submit').disabled = false;
	o = getObj('contact_status');
	o.innerHTML = 'メールの送信が完了しました。';
	o.style.display = 'block';
	setTimeout('getObj("contact_status").style.display="none"; getObj("contact_buttons").style.display="block"; can_submit = true;', 2000);
}
//-->
