anchor.diff:    <head>
        <title>:: Sahana ::</title>
   
  -
  +     <script>
  +
  +     function add()
  +    {
  +        if(document.tsunamiAddDamagedHouse.inputVal.value != ""  ){
  +
  +            document.tsunamiAddDamagedHouse.damageType.value += document.tsunamiAddDamagedHouse.inputVal.value+",";
  +            document.tsunamiAddDamagedHouse.inputVal.value = "";
  +        }else {
  +            for (var i = 0; i < document.tsunamiAddDamagedHouse.choiseList.length; i++) {
  +                if(document.tsunamiAddDamagedHouse.choiseList.options[i].selected){
  +                	var newValue = document.tsunamiAddDamagedHouse.choiseList.options[i].value;
  +                    if((document.tsunamiAddDamagedHouse.damageType.value.indexOf(newValue+",")) != -1){
  +                        var confirm = window.confirm("You have already added "+newValue + ". Do you still want to add it again ?");
  +                        if(confirm){
  +                        	document.tsunamiAddDamagedHouse.damageType.value += newValue+",";
  +                        }
  +                    }else {
  +                   document.tsunamiAddDamagedHouse.damageType.value += document.tsunamiAddDamagedHouse.choiseList.options[i].value+",";
  +                   }
  +                }
  +            }
  +        }
  +    }
  +
  +
  +
  +    function minus()
  +    {
  +          var inValue;
  +        if(document.tsunamiAddDamagedHouse.inputVal.value != ""){
  +            inValue = document.tsunamiAddDamagedHouse.inputVal.value+","  ;
  +        }else {
  +            for (var i = 0; i < document.tsunamiAddDamagedHouse.choiseList.length; i++) {
  +
  +                if(document.tsunamiAddDamagedHouse.choiseList.options[i].selected){
  +
  +                   inValue =  document.tsunamiAddDamagedHouse.choiseList.options[i].value;
  +                }
  +            }
  +        }
  +        var outValue = document.tsunamiAddDamagedHouse.damageType.value;
  +        var startIndex = outValue.indexOf (inValue);
  +        if(outValue.indexOf (inValue,0) != -1){
  +        var endIndex = startIndex + inValue.length+1;
  +        outValue = outValue.substring (0,startIndex) + outValue.substring(endIndex,outValue.length);
  +        document.tsunamiAddDamagedHouse.damageType.value = outValue;
  +        document.tsunamiAddDamagedHouse.inputVal.value="";
  +        }
  +
  +    }
  +
  +
  +  </script>
   
   
        <link href="common/style.css" rel="stylesheet" type="text/css">
  
positive.code: 
               <tr>
                    <td align="right" vAlign="top" class="formText">Type of Damage : </td>
                    <td>
                    <select name="damageType" class="selectBoxes">
                    <%
                        String[] damage = DBConstants.DAMAGE_TYPE;
                        for(int i=0; i<damage.length; i++){
                          %><option><%=damage[i]%></option>
  
                            <%
                        }
                    %>
  
                    </select>
                    </td>
               </tr>
  
               <tr>
                    <td align="right" vAlign="top" class="formText">Comments </td>
                    <td>
                       <textarea  cols="38"  name="comments" rows="5"></textarea>
  
negative.code:  }
  %>
       </body>
        <jsp:include page="common/welcomefooter.inc"></jsp:include>
       <jsp:include page="common/footer.inc"></jsp:include>
    </html>
  <%
  