<%-- $Id: addMapFooter.jsp,v 1.1.2.1 2004/04/01 11:14:52 asivakumar Exp $ --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

<script language="javascript">

function addCV()
{
    if(validateInputs() && validateSearch())
        {
            document.searchForm.method.value = "addMap";
            document.searchForm.submit();
        return true;
        }
    else
        {
            return false;
        }

}

function validateSearch()
{
   var numrows = parseInt(document.searchForm.rows.value);
    for(ci=0;ci<numrows;ci++)
    {
        criteriaValues = document.searchForm.elements["searchForm["+ci+"].criteriaValues"];
        var values = criteriaValues.value;
        
    }
    changeNames();
    document.searchForm.method.value = "search";
return true;
 }

function modifyCV()
{
    if(validateInputs() && validateSearch())
        {
            document.searchForm.method.value = "modifyMap";
            document.searchForm.submit();
        return true;
        }
    else
        {
            return false;
        }
}

function validateInputs()
{
        var value = document.searchForm.name.value;
        if(trimAll(value) == "")
        {
            alert("<fmt:message key='webclient.map.cv.addmap.js.error'/>");
            return false;
        }
        return true;
}

</script>

<tr class="propertyHeader"> 
    <td align="left" valign="top" class="propertyHeader"> <table width="596" border="0" cellspacing="0" cellpadding="6">
     <tr> 
     <td width="137" height="25" align="left"> 
<c:choose>
<c:when test ='${searchForm.map.actionToPerform == "addMap"}'>
 <input name="customview322" type="button" class="button" id="customview322" onClick="addCV()" value='<fmt:message key='webclient.map.cv.addmap.addbutton'/>'> 
</c:when>
<c:when test ='${searchForm.map.actionToPerform == "modifyMap"}'>
 <input name="customview322" type="button" class="button" id="customview322" onClick="modifyCV()" value='<fmt:message key='webclient.map.cv.addmap.modifybutton'/>'> 
</c:when>
</c:choose>
         
        </tr>
      </table></td>
  </tr>


