//index, revise
function checkPost() {
	if (document.post.course.value.length == 0) {
		alert('コース名が未入力です');
		document.post.course.focus();
		return false;
	} else if (document.post.area.value == 0) {
		alert('地域を選択して下さい');
		document.post.area.focus();
		return false;
	} else if (document.post.category.value == 0) {
		alert('種類を選択して下さい');
		document.post.category.focus();
		return false;
	} else if (document.post.lnglat.value.length == 0) {
		alert('コースの場所が指定されていません');
		return false;
	} else {
		return true;
	}
}
//bbs
function checkBBS() {
	if (document.post.category.value == 0) {
		alert('種類を選択して下さい');
		document.post.category.focus();
		return false;
	} else if (document.post.title.value.length == 0) {
		alert('タイトルが未入力です');
		document.post.title.focus();
		return false;
	} else if (document.post.nickname.value.length == 0) {
		alert('ニックネームが未入力です');
		document.post.nickname.focus();
		return false;
	} else if (document.post.comment.value.length == 0) {
		alert('コメントが未入力です');
		document.post.comment.focus();
		return false;
	} else if (document.post.number.value.length == 0) {
		alert('画像内の文字が未入力です');
		document.post.number.focus();
		return false;
	} else {
		return true;
	}
}
//movie
function checkMovie() {
	if (document.post.category.value == 0) {
		alert('種類を選択して下さい');
		document.post.category.focus();
		return false;
	} else if (document.post.title.value.length == 0) {
		alert('タイトルが未入力です');
		document.post.title.focus();
		return false;
	} else if (document.post.nickname.value.length == 0) {
		alert('ニックネームが未入力です');
		document.post.nickname.focus();
		return false;
	} else if (document.post.url.value.length == 0) {
		alert('YouTube欄が未入力です');
		document.post.url.focus();
		return false;
	} else if (document.post.number.value.length == 0) {
		alert('画像内の文字が未入力です');
		document.post.number.focus();
		return false;
	} else {
		return true;
	}
}
//bookmarklet
function checkBookmark() {
	if (document.post.category.value == 0) {
		alert('種類を選択して下さい');
		document.post.category.focus();
		return false;
	} else if (document.post.title.value.length == 0) {
		alert('タイトルが未入力です');
		document.post.title.focus();
		return false;
	} else if (document.post.nickname.value.length == 0) {
		alert('ニックネームが未入力です');
		document.post.nickname.focus();
		return false;
	} else if (document.post.number.value.length == 0) {
		alert('画像内の文字が未入力です');
		document.post.number.focus();
		return false;
	} else {
		return true;
	}
}
//event
function checkEvent() {
	if (document.post.category.value == 0) {
		alert('種類を選択して下さい');
		document.post.category.focus();
		return false;
	} else if (document.post.summary.value.length == 0) {
		alert('内容が未入力です');
		document.post.summary.focus();
		return false;
	} else if (document.post.number.value.length == 0) {
		alert('画像内の文字が未入力です');
		document.post.number.focus();
		return false;
	} else {
		return true;
	}
}
//movie
function checkCmt(m) {
	var namecmt = eval('document.cmtpost_' + m + '.name.value.length');
	var cmtcmt = eval('document.cmtpost_' + m + '.comment.value.length');
	var passcmt = eval('document.cmtpost_' + m + '.password.value.length');
	if (namecmt == 0) {
		alert('名前が未入力です');
		return false;
	} else if (cmtcmt == 0) {
		alert('コメントが未入力です');
		return false;
	} else if (passcmt == 0) {
		alert('パスワードが未入力です');
		return false;
	} else {
		return true;
	}
}
//index
function clip_copy(id) {
	var geturl = document.getElementById(id);
	if (document.all && navigator.userAgent.match(/windows/i) && geturl.value) {
	copy_obj = geturl.createTextRange();
	copy_obj.execCommand("Copy");
	alert("クリップボードにコピーしました。");
  }
}
//index, revise
function setMenuItem(n) {
	if(n==0){
		alert('種類を選択して下さい');
		//return false;
	} else {
		len = eval("document.post.type.options.length");
		for (i=len-1; i>=0; i--){
			eval("document.post.type.options[i] = null");
		}
		for (i=0; i<menuItem[n].length; i++){
			eval("document.post.type.options[i] = new Option(menuItem[n][i],menuValue[n][i])");
		}
	}
}
//movie
function cmtview(m_id) {
	remoteURL = "http://map.bangboo.com/cmtview.php?m_id=" + m_id;
	cmtcont = document.getElementById("cmt" + m_id).innerHTML;
	if ( cmtcont == "" )
	{
		self.frames.cmtviewfrm.location.href = remoteURL;
	}
	else
		document.getElementById("cmt" + m_id).innerHTML = "";
}
//movie
function tbview(m_id) {
	remoteURL = "http://map.bangboo.com/tbview.php?m_id=" + m_id;
	cmtcont = document.getElementById("cmt" + m_id).innerHTML;
	if ( cmtcont == "" )
		self.frames.cmtviewfrm.location.href = remoteURL;
	else
		document.getElementById("cmt" + m_id).innerHTML = "";
}