

    // Wrapper for showCalendar to enable form field to be populated to be passed as parameter for result function
  function createCalendar(anchorName,formField){
          calFormRef = formField.split('.');
          calForm = calFormRef[0];
          calField = calFormRef[1];
          if(document.forms[calForm][calField]){
                  cal.showCalendar(anchorName)
          }else{
                  alert('Invalid argument passed to createCalendar() function')
          }
  }



  // Function to get input back from calendar popup
  function showDate(y,m,d) {
          d < 10 ? d = '0' + d:d = d;
          m < 10 ? m = '0' + m:m = m;
          document.forms[calForm][calField].value = d + '/' + m + '/' + y
          clearData(1);
  }

    function clearData(searchType){
        if(searchType != '0'){
            document.wedding_list_search.weddingNo.value = "";
        }
        else {
            document.wedding_list_search.groomsName.value = "";
            document.wedding_list_search.bridesName.value= "";
            document.wedding_list_search.weddingDate.value = "";
        }
    }
    