<%--
    Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved
    Use is subject to license terms.
--%>

 
<html>
<%@page info="ProxyletRuleList" language="java"%>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
<%@taglib uri="/WEB-INF/console.tld" prefix="console"%>
<jato:useViewBean className="com.sun.portal.proxylet.admin.ProxyletRulesReorderViewBean"> 


<head>
<title><jato:text name="titleHtmlPage" /></title>
<link rel="stylesheet" href="../console/css/adminstyle.css">
<script language="javascript" src="../console/js/consolecomp.js"></script>
</head>


<body leftMargin="0" rightMargin="0" topMargin="0"
    marginheight="0" marginwidth="0" class="default-body">
<script language="javascript">
var pageLoaded = 0;
function chkMoveDown(frmName, ListName) {
    var frm = document.forms[frmName];

    if (frm != null) {
			var list = frm.elements[ListName];

			if (list != null) {
					var optList = list.options;
					var size = optList.length;
                                if(size > 2) {
				var opt = optList[size-2];
				if (opt.selected) {
						return false;
				}
				else
				   shiftDown(frmName,ListName,'');
                            }
			}
    }
}

function chkMoveUp(frmName, ListName) {
    var frm = document.forms[frmName];

    if (frm != null) {
			var list = frm.elements[ListName];

			if (list != null) {
					var optList = list.options;
					var size = optList.length;
				if(size > 1) {
				var opt = optList[size-1];
				if (opt.selected) {
						return false;
				}
				else
				   shiftUp(frmName,ListName,'');
				}
			}
    }
}

function selectAll(frmName, ListName) {
    var frm = document.forms[frmName];

    if (frm != null) {
			var list = frm.elements[ListName];

			if (list != null) {
					var optList = list.options;
					var size = optList.length;
					for(var i=0;i<size;i++) {
						var opt = optList[i];
						if ( opt.value != "_______________________________________" )
							opt.selected = true;
				}
			}
    }
}

</script>


<console:form name="ProxyletRulesReorder" method="post">





<div class="left-margin">
<div class="table-header-label">
 <jato:text name="ProxyletRulesLabel"/>:
</div>
<hr noshade size="1">

<table border=0 cellpadding=1 cellspacing=0>
		<tr>
		<td nowrap valign="top">
		<table border=0 cellpadding=2 cellspacing=0>
		<tr><td valign="top">
		<table border=0 cellpadding=2 cellspacing=0>
		<tr><td>
		<jato:listbox multiple="true" name="ProxyletRules" size="10" onChange="javascript:copyOptionToTextBox(this, 'ProxyletRulesReorder.RuleTextBox');" extraHtml="id='ProxyletRulesReorder.ProxyletRules' width='200'" />
		</td></tr>
		<tr><td><input type="text" name="ProxyletRulesReorder.RuleTextBox" id="ProxyletRulesReorder.RuleTextBox" size="40">
		</td></tr>
		<tr></td>
			<table border=0 cellpadding=0 cellspacing=0>
			<tr><td>		
			<div class="help-small-text"><jato:text name="ProxyletRulesHelp"/></div>
			</td></tr>		
			</table>		
		</td></tr>
		<tr><td align="left">
		
		<table border=0 cellpadding=0 cellspacing=0>
		<tr><td>
		<console:button name="addButton" onClick="javascript:addToList('ProxyletRulesReorder', 'ProxyletRulesReorder.RuleTextBox', 'ProxyletRulesReorder.ProxyletRules');return false;" />
		</td>
		<td>
		<console:button name="removeButton" onClick="javascript:removeSelFromList('ProxyletRulesReorder', 'ProxyletRulesReorder.ProxyletRules');return false;" />
		</td>
		<td>
		<console:button name="upButton" onClick="javascript:chkMoveUp('ProxyletRulesReorder', 'ProxyletRulesReorder.ProxyletRules');return false;" />
		</td>		
		<td>
		<console:button name="downButton" onClick="javascript:chkMoveDown('ProxyletRulesReorder', 'ProxyletRulesReorder.ProxyletRules');return false;" />
		</td>		
		</tr>
		</table>
		
		</td></tr>
		</table>
		
		</td><td valign="top">&nbsp;</td>
		</tr>
		</table>
		</td>
		</tr>


</table>

<p>
<hr noshade size="1">
</div>

<table border=0 cellpadding=0 cellspacing=0>
    <tr>
        <td width="98%" align="right">
            <console:button name="SubmitButton" onClick="selectAll('ProxyletRulesReorder', 'ProxyletRulesReorder.ProxyletRules');return true;" />
        </td>
        <td width="1%">
            <console:button name="CancelButton" onClick="window.close(); return false;" />
        </td>
    	<td width="1%"><img src="../console/images/spacer.gif" alt="" width=10></td>
    </tr>
</table>
</td></tr></table>
</console:form>

</body>
<script language="javascript">
pageLoaded = 1;
</script>
</jato:useViewBean>

</html>
