// JavaScript Document
	function insertDiv()
	{
		id_count+=1;

		/* ### create elements ### */
		// textnode
		var txtnode = document.createTextNode(" / ");
		
		// left
		var inputleft = mkInput();
		with (inputleft)
		{
			setAttribute('type', 'text');
			setAttribute('id', 'bf_f4_'+id_count+'_1');
			setAttribute('name', 'bf_f4_'+id_count+'_1');
			setAttribute('maxlength', '20');
		}
		setClassName(inputleft, 'w150');

		// right
		var inputright = mkInput();
		with(inputright)
		{
			setAttribute('type', 'text');
			setAttribute('id', 'bf_f4_'+id_count+'_2');
			setAttribute('name', 'bf_f4_'+id_count+'_2');
			setAttribute('size', '3');
			setAttribute('maxlength', '3');
		}

		// nobr
		var nobr = mkNobr();
		with(nobr)
		{
			appendChild(inputleft);
			appendChild(txtnode);
			appendChild(inputright);
		}

		// container
		var divbox = mkDiv();
		with(divbox)
		{
			setAttribute('id', 'bf_f4_'+id_count+'_box');
			appendChild(nobr);
		}

		/* ### insert elements ### */
		$('box_outer').appendChild(divbox);
	}

	function removeDiv()
	{
		$('box_outer').removeChild($('bf_f4_'+id_count+'_box'));
		id_count-=1;
	}

	function checkDiv(direction)
	{
		var min = 1;
		var max = 10;
		if (direction>=min && direction<=max)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	function mkDiv()
	{
		return document.createElement("DIV");
	}

	function mkInput()
	{
		return document.createElement("INPUT");
	}

	function mkNobr()
	{
		return document.createElement("NOBR");
	}

	function setClassName(tag, cls)
	{
		if (isIE)
		{
			tag.setAttribute('className', cls);
		}
		else
		{
			tag.setAttribute('class', cls);
		}
	}

	function countDiv()
	{
		id_count = $('box_outer').getElementsByTagName('DIV').length;
	}

	function insertForm(count)
	{
		countDiv();
		if (!checkDiv(count))
		{
			return false;
		}
		if (id_count == count)
		{
			return false;
		}
		else if(id_count < count)
		{
			while (id_count < count)
			{
				insertDiv();
			}
		}
		else if(id_count > count)
		{
			while (id_count > count)
			{
				removeDiv();
			}
		}
	}
	
