/*
 * 2階層目以降の場合Ajaxの通信先が変わってしまう問題を解決するため
 * Cho 2010/08/26
 */
var includeDir = "";

/**
 * タグIDと埋め込みIDを指定して登録済みコンテンツを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param include_id コンテンツの埋め込みID
 * @return 戻り値なし
 */
function includeContent(target_tag_id, include_id)
{
	postDataAndUpdate(includeDir + "getContent.php", { target : target_tag_id, include_id : include_id }, null);
}

/**
 * 指定のタグにブログ記事リストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeBlogArticleList(target_tag_id, limit_count)
{
	postDataAndUpdate(includeDir + "getBlogArticleList.php", { target : target_tag_id, limit_count : limit_count }, null);
}

/**
 * 指定のタグにらんイベントリストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeRanEventList(target_tag_id, limit_count)
{
	postDataAndUpdate(includeDir + "getContentList.php", { target : target_tag_id, limit_count : limit_count, content_type : '1' }, null);
}

/**
 * 指定のタグにお知らせリストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeNoticeList(target_tag_id, limit_count)
{
	postDataAndUpdate(includeDir + "getContentList.php", { target : target_tag_id, limit_count : limit_count, content_type : '0' }, null);
}

/**
 * 指定のタグにお知らせリストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeUserLoginForm(target_tag_id, php_session, session_id)
{
	postDataAndUpdate(includeDir + "getUserLoginForm.php?" + php_session + "=" + session_id, { target : target_tag_id }, null);
}

/**
 * 指定のタグにお知らせリストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeUserArticleList(target_tag_id, content_type, limit_count)
{
	postDataAndUpdate(includeDir + "getUserArticleList.php", { target : target_tag_id, limit_count : limit_count, content_type : content_type }, null);
}

/**
 * 指定のタグに新着コメントリストを埋め込む
 * @param target_tag_id 埋め込み対象のHTMLタグのID
 * @param limit_count 記事の数上限
 * @return 戻り値なし
 */
function includeNewComments(target_tag_id, limit_count)
{
	postDataAndUpdate(includeDir + "getNewCommentList.php", { target : target_tag_id, limit_count : limit_count, dir : includeDir }, null);
}

/** 
 * 
 * @param mode 
 * @param callback_func 
 * @return なし
 */
function postMainForm(mode, callback_func)
{
	document.MainForm.mode.value = mode;
	postAndUpdateForm('MainForm', callback_func);
}

/** 
 * 
 * @param action 
 * @param mode 
 * @param callback_func 
 * @return なし
 */
function postMainFormOtherAction(action, mode, callback_func)
{
	document.MainForm.action = action;
	document.MainForm.mode.value = mode;
	postAndUpdateForm('MainForm', callback_func);
}

/** 
 * 
 * @param mode 
 * @param id 
 * @param callback_func 
 * @return なし
 */
function postMainFormWithId(mode, id, callback_func)
{
	document.MainForm.mode.value = mode;
	document.MainForm.id.value = id;
	postAndUpdateForm('MainForm', callback_func);
}

/** 
 * 
 * @param mode 
 * @return submit()の戻り値。
 */
function submitMainForm(mode)
{
	document.MainForm.mode.value = mode;
	return document.MainForm.submit();
}

/** 
 * 
 * @param mode 
 * @param id 
 * @return submit()の戻り値。
 */
function submitMainFormWithId(mode, id)
{
	document.MainForm.mode.value = mode;
	document.MainForm.id.value = id;
	return document.MainForm.submit();
}

