<%--
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%>
<%-- Simulator.jsp --%>

<%@page info="Simulator" language="java"%>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
<%@taglib uri="/WEB-INF/console.tld" prefix="console"%>
<%@taglib uri="/WEB-INF/searchadmin.tld" prefix="searchadmin"%>

<jato:useViewBean className="com.sun.portal.search.admin.SimulatorViewBean"> 
<jsp:useBean id="viewBean" type="com.sun.portal.search.admin.SimulatorViewBean" />

<HTML>
<TITLE><searchadmin:text key="simulator.title"/></TITLE>
<%@include file="/ps/searchadmin/CSHeader.jsp"%>
<script language="javascript" src="../ps/searchadmin/js/urlmagic.js"></script>
<script language="javascript">
if (parent.headerFrame) {
    parent.headerFrame.helpDocURL = "<jato:text name="helpDocURL"/>";
    parent.headerFrame.helpPage = "<searchadmin:text key="help.robot.simulator"/>";
}
</script>

<searchadmin:AdminMenu selected="Simulator" images="../ps/searchadmin/images"/>

<console:form name="Simulator" defaultCommandChild="OKButton">

<TABLE border="0" cellpadding="0" cellspacing="10" width="100%">

    <TR>
      <TD height="2">
	<DIV class="help-text"><searchadmin:text key="simulator.desc"/></DIV>
	</TD>
    </TR>


    <TR>
      <TD height="2"> 
        <TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
	<TR>
	<TD valign="center"><DIV class="properties-level3-label-text"><searchadmin:text key="urls"/>&nbsp;:&nbsp;</DIV></TD>
	<TD>
	    <TABLE border="0" cellspacing="0" cellpadding="0">
	    <TR>
	    <TD colspan="3">
		<jato:listbox name="TestURLList" multiple="true" size="10"/>
<script language="javascript">
addToSelBeforeSubmitArray('Simulator', 'Simulator.TestURLList');
var frm=document.forms['Simulator'];
frm.onsubmit = selBeforeSubmit;

function validBeforeAdd() {
    var t = document.forms['Simulator'].elements['UrlText'];
    if (validateServer(t, '')) {
	var list = document.forms['Simulator'].elements['Simulator.TestURLList'];
	var OptList = list.options;
	var str = t.value;
	str = strTrim(str);

	for (ndx = 0; ndx < OptList.length; ndx++) {
	    if (OptList[ndx].value == str) {
		alert('<searchadmin:text key="simulator.error.existurl"/>');
		return;
	    }
	}
	addToList('Simulator', 'UrlText', 'Simulator.TestURLList');
	t.value="";
    }
}
</script>
	    </TD>
	    </TR>
	    <TR>
	    <TD>
		<input type="text" name="UrlText" size="35">
	    </TD>
	    <TD>
		<console:button name="AddButton" onClick="javascript:validBeforeAdd(); return false;"/>
	    </TD>
	    <TD>
		<console:button name="DelButton" onClick="javascript:removeSelFromList('Simulator', 'Simulator.TestURLList'); return false;"/>
	    </TD>
	    </TR>
	    </TABLE>
	</TD>
	</TR>
	</TABLE>
      </TD>
    </TR>
    <TR>
    <TD><DIV class="properties-level3-label-text"><jato:checkbox name="checkDNS" elementId="simulator.checkdns" /><LABEL for="simulator.checkdns"><searchadmin:text key="simulator.checkdns"/></LABEL></DIV></TD>
    </TR>
    <TR>
    <TD><DIV class="properties-level3-label-text"><jato:checkbox name="checkRedirect" elementId="simulator.checkredir" /><LABEL for="simulator.checkredir"><searchadmin:text key="simulator.checkredir"/></LABEL></DIV></TD>
    </TR>

    <TR>
	<TD>
	    <jato:text name="RunResult" escape="false" />
	</TD>
    </TR>
    <TR> 
      <TD align="right" height="2"> 
        <TABLE border="0" cellpadding="0" cellspacing="0">
          <TR> 
            <TD> 
		<console:button name="OKButton" />
	    </TD>
            <TD width="5"><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
            <TD> 
		   <console:button name="ResetButton" />
            </TD>
            <TD><IMG src="../ps/searchadmin/images/blank.gif" width="10" height="1" alt=""></TD>
            <TD>  </TD>
          </TR>
        </TABLE>
      </TD>
    </TR>
</TABLE>

</console:form>

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

</HTML>
</jato:useViewBean>
