function check_fast_config(TheForm) {
	if(TheForm.line_num.value == "") {
		alert("페이지 표시 갯수를 입력하세요.");
		TheForm.line_num.focus();
		return false;
	}
	return true;
}

function modify_Fast(URL) {
	var _url = URL.split("?");
  var url = _url[0];
  var pars = _url[1];

	var sObj = new Ajax.Request(
		url,
		{
			method: 'get',
			parameters: pars,
			onComplete: FastModify,
			onFailure: FailureFastModify
		}
	);
}

function FailureFastModify(request) {
  return;
}

function FastModify(sRequest) {
	if(sRequest.responseXML) {
		var channelList = sRequest.responseXML.getElementsByTagName('live_fast_channel');
		if(!channelList.length) return;
		var nodeList = sRequest.responseXML.getElementsByTagName('live_fast_item');
		if(!nodeList.length) return;
		var id = getNodeValues(nodeList[0].getElementsByTagName('id')[0]);
		var text = getNodeValues(nodeList[0].getElementsByTagName('content')[0]);
		var form = $('fast_write_form');
		if(form) {
			form.mode.value = 'modify_proc';
			form.id.value = id;
			form.content.value = text;
			form.content.focus();
		}
	}
}

function check_fast_form(TheForm) {
	if(TheForm.content.value == "") {
		alert("속보 내용을 입력하세요.");
		TheForm.content.focus();
		return false;
	}
	return true;
}

function unset_fast_write_form(fid) {
	var form = $(fid);
	if(form) {
		form.id.value = "";
		form.mode.value = "write";
		form.content.value = "";
	}
}

function getNodeValues(node) {
	var childs = node.childNodes;
	for(var i=0; i<childs.length; ++i) {
		if(childs[i].nodeType == 3 || childs[i].nodeType == 4) {
			return trim(childs[i].data);
		}
	}
}
 
function trim(s) {
	s += '';
	return s.replace(/^\s*|\s*$/g, '');
}
