{=func:set_bouquet_edit_form=}
{=include-block:Y_Blocks.txt;head=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript">
//<![CDATA[
function do_submit()
{
	show_waitbox(true);
	for (i=document.getElementById('channels').bchannels.length-1; i >= 0 ; i--) {
		document.getElementById('channels').bchannels.options[i].selected=true;
	}
	document.getElementById('channels').submit();
}
function do_abort()
{
	document.location.href="/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected={=selected=}";
}
function movechannels(source, destination)
{
	for (i=0; i < source.length; i++) {
		if (source.options[i].selected==true) {
			destination.options[destination.length] = new Option(source.options[i].text, source.options[i].value);
		}
	}
	for (i=source.length-1; i >= 0 ; i--) {
		if (source.options[i].selected==true) {
			source.options[i] = null;
		}
	}
}
function poschannel(box, direction)
{
	if (direction==0) {
		for (i=1; i < box.length  ; i++) {
			if (box.options[i].selected==true) {
				buffer = new Option(box.options[i].text, box.options[i].value);
				box.options[i].selected=false;
				box.options[i]= new Option(box.options[i-1].text, box.options[i-1].value);
				box.options[i-1]=buffer;
				box.options[i-1].selected=true;
			}
		}
	} else {
		for (i=box.length-2; i >= 0  ; i--) {
			if (box.options[i].selected==true) {
				buffer = new Option(box.options[i].text, box.options[i].value);
				box.options[i].selected=false;
				box.options[i]=new Option(box.options[i+1].text, box.options[i+1].value);
				box.options[i+1]=buffer;
				box.options[i+1].selected=true;
			}
		}
	}
}
//]]>
</script>
</head>

<body>
{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=}
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:help_url=Neutrino:yWeb:BoxControl#Bouquet-Editor=}{=var-set:menu=Bouquet &quot;{=name=}&quot; workon=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
		<form action="/control/changebouquet" method="post" id="channels" enctype="x-www-form-urlencoded">
		<p><input type="hidden" name="selected" value="{=selected=}" /></p>
		<table cellspacing="5">
		<tr>
			<td>
				<select multiple="multiple" size="20" name="bchannels">
				{=bouquet_channels=}
				</select>
			</td>
			<td align="center">
				<input type="button" value="up" onclick="poschannel(document.getElementById('channels').bchannels, 0);" /><br /><br />
				<input type="button" value="down" onclick="poschannel(document.getElementById('channels').bchannels, 1);" /><br /><br />
				<input type="button" value="&gt;&gt;&gt;" onclick="movechannels(document.getElementById('channels').bchannels, document.getElementById('channels').achannels);" /><br /><br />
				<input type="button" value="&lt;&lt;&lt;" onclick="movechannels(document.getElementById('channels').achannels, document.getElementById('channels').bchannels);" /><br /><br />
			</td>
			<td>
				<select multiple="multiple" size="20" name="achannels">
				{=all_channels=}
				</select>
			</td>
		</tr>
		</table>
		<input type="hidden" name="redirect" value="/Y_Boxcontrol_Bouquet_Editor_Main.yhtm"/>
		<p><input type="button" value="submit" onclick="do_submit();" />
		<input type="button" value="abort" onclick="do_abort();" /></p>
		All changes must be still stored!
		</form>
	</div>
</div>
</body>
</html>
