How to display the selected date from a popup to the selected id
<p>In my project i have a requirement like Date should be displayed with previous and next links and adjacent to next link there is popup jquery calendar to select the particular date. This i have implemented as follows</p>

<pre><code>&lt;script&gt;
    function ShowSchedule() {
        document.getElementById("today").innerHTML = date;
    }

    function ShowDay(isNextDay) {
        if (isNextDay) {
            currentTime = new Date(currentTime.getFullYear(), month, currentTime.getDate() + 1);
            date = month_name[currentTime.getMonth()] + " " + currentTime.getDate() + ", " + currentTime.getFullYear();
            ShowSchedule();
        }
        else {
            currentTime = new Date(currentTime.getFullYear(), month, currentTime.getDate() - 1);
            date = month_name[currentTime.getMonth()] + " " + currentTime.getDate() + ", " + currentTime.getFullYear();
            ShowSchedule();
        }
    }

    $(function() {
        $('#tday').datepick({
            changeMonth: false,
            dateFormat: 'M dd, yyyy',
            showTrigger: '#calImg'
        });
    });
&lt;/script&gt;

&lt;body&gt;
    &lt;form&gt;
        &lt;div&gt;
            &lt;a id="prev" href="#" onClick="ShowDay(false)"&gt;Prev&lt;/a&gt;
            &lt;span id="today"&gt;
            &lt;/span&gt;
            &lt;a id="next" href="#" onClick="ShowDay(true)"&gt;Next&lt;/a&gt;
            &lt;input id="tday" /&gt;
        &lt;/div&gt;
        &lt;script&gt;
            ShowSchedule();
        &lt;/script&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>By using the above code am able to display the current system date with previous and next links along with the calendar popup. But the problem is after selecting the date from the popup calendar i need to display selected date current date position. i.e. For example today date is May 25, 2012, If the user selects date as May 20, 2012 then the selected date should displayed in the place of May 25, 2012 along with previous and next links</p>

<p>Any help would be appreciated</p>
