//the defition must consist with defined in content_common.js, since this function may be called from util.php::makeupkwstr,2009.9.8
function removerelatic(node, wid, cbRemoveRelatic)
{
	var argv = removerelatic.arguments;
  	var argc = removerelatic.arguments.length;
  	var type = (argc > 3) ? argv[3] : 1;
  	
	var ans = confirm("確定解除本篇文章與這個關鍵字的關聯嗎?");
	if(ans)
		xajax_removeRelatic("", wid, "callback_removerelatic", type);
}

function setkeyword(ri)
{
	var keyword = "";
	keyword = prompt("幫這篇文章設定關鍵字，若為一組關鍵字請在關鍵字之間以','或是空白做區隔，例如\"陽明山,小油坑\"","");
	
	if((keyword != null)&&(keyword != ""))
	{
		
		if(keyword.length>64)
		{
			alert("關鍵字字串超過32個中文字，請重新設定。");
			return;
		}

		xajax_setKeywords(keyword, ri, "callback_removerelatic");
	}
}

//2009.9.2
function onAccessJournal(postid, userid)
{
	//no function here
}

//2009.9.2
function GetRelaticArticlesFromTagStr(tagidstr, start, limit, postid, authormode, authorid)
{
	xajax_getRelaticArticlesFromTagStr("gadgetcontainer", tagidstr, start, limit, postid, authormode, authorid);
}

//2009.9.8
function callback_removerelatic()
{
	if((document.location.href.indexOf("pid=")!=-1)||(document.location.href.indexOf("r=")!=-1))
		document.location.reload();
	else
	{	if(document.location.href.indexOf("?")!=-1)
		{
			document.location.href=document.location.href+"&pid="+postid;
		}
		else 	document.location.href=document.location.href+"?pid="+postid;
	}
}
