<!-- Need to be special for the view side -->

function setSelectedDate(baseName, theMonth, theDate, theYear)
{
    var fullDate = document.getElementById(baseName);
    if (fullDate)
    {
        //this is if it wasn't broken down into month/date/year inputs
        fullDate.value = joinDate(theMonth, theDate, theYear);
    }
    else
    {
        var dateItem = document.getElementById(baseName + "_year");
        
        if (dateItem)
        {
            selectOption(dateItem, theYear + ".0");
        }
        
        dateItem = document.getElementById(baseName + "_month");
        
        if (dateItem)
        {
            selectOption(dateItem, theMonth + ".0");
        }
        
        dateItem = document.getElementById(baseName + "_date");
        
        if (dateItem)
        {
            selectOption(dateItem, theDate);
        }
    }
    hideCalendar();
}

function getOffsetTop(input)
{
    var totOffset = 0;
    
    do 
    {
        if (input.tagName.toLowerCase() != "tr")
        {
            totOffset += input.offsetTop;
        }
        
        input = input.parentNode;
    }
    while (input.tagName.toLowerCase() !="body")
    
    return totOffset;
}

function getOffsetLeft(input)
{
    var totOffset = 0;
    
    do 
    {
        if (input.tagName.toLowerCase() != "tr")
        {
            totOffset += input.offsetLeft;
        }
        
        input = input.parentNode;
    }
    while (input.tagName.toLowerCase() != "body")
    
    return totOffset;
}

<!-- end -->