 function setSelected(dayvalue, monthvalue, yearvalue)
        {
          for (var i = 0; i < document.CALCULATOR.thedated.length; i++)
          {
            if (document.CALCULATOR.thedated.options[i].text == dayvalue)
              document.CALCULATOR.thedated.options[i].selected = true;
          }
          for (var i = 0; i < document.CALCULATOR.thedatem.length; i++)
          {
            if (document.CALCULATOR.thedatem.options[i].value == monthvalue)
              document.CALCULATOR.thedatem.options[i].selected = true;
          }
          for (var i = 0; i < document.CALCULATOR.thedatey.length; i++)
          {
            if (document.CALCULATOR.thedatey.options[i].text == yearvalue)
              document.CALCULATOR.thedatey.options[i].selected = true;
          }
    }
    
    function setSelected2(dayvalue2, monthvalue2, yearvalue2)
        {      
             for (var i = 0; i < document.CALCULATOR.thedate2d.length; i++)
             {
               if (document.CALCULATOR.thedate2d.options[i].text == dayvalue2)
                 document.CALCULATOR.thedate2d.options[i].selected = true;
             }
             for (var i = 0; i < document.CALCULATOR.thedate2m.length; i++)
             {
               if (document.CALCULATOR.thedate2m.options[i].value == monthvalue2)
                 document.CALCULATOR.thedate2m.options[i].selected = true;
             }
             for (var i = 0; i < document.CALCULATOR.thedate2y.length; i++)
             {
               if (document.CALCULATOR.thedate2y.options[i].text == yearvalue2)
                 document.CALCULATOR.thedate2y.options[i].selected = true;
             }
    }    
