
function PopupCalendar( url )
{
	newwindow=window.open(url,'name','height=250,width=320');
	if (window.focus) {newwindow.focus()};
}

function PopupMapKey( url )
{
	newwindow=window.open(url,'name','height=360,width=280');
	if (window.focus) {newwindow.focus()};
}

function CloseWindow()
{
    window.close();
}

function GetDateString( objDate )
{
    var strDate;
    
    intMonth = objDate.getMonth() + 1;
    intDay = objDate.getDate();
    intYear = objDate.getFullYear() ;
    
    intYear = GetCorrectedYear( intYear );
    
    strDate = intMonth + '/' + intDay + '/' + intYear;
    
    return strDate;
        

}

function GetCorrectedYear(year) {
    
    if ( year < 2000 )
    {
        year = ( year % 1900 ) + 2000;
    }
    
    return year;
}

function GetTimeString( objDate )
{
    var strTime;
    var strAP = "";

    intHour = objDate.getHours();
    intMinutes = objDate.getMinutes();
        
    if ( intMinutes < 10 )
    {
        intMinutes = '0' + intMinutes;    
    }
    
    if (intHour < 12)
   {
       strAP = "AM";
       }
    else
       {
       strAP = "PM";
       }
    if (intHour == 0)
       {
       intHour = 12;
       }
    if (intHour > 12)
       {
       intHour = intHour - 12;
   }
    
    strTime = intHour + ':' + intMinutes + ' ' + strAP;
    
    return strTime;
}

function ShowCopyLink( )
{
    var objControl = document.getElementById( 'CopyLink' );
    objControl.style.display = 'block';
    
    var objTextBox = objControl.childNodes[ 5 ];
    
    objTextBox.select();
}

function CloseCopyLink()
{
    var objControl = document.getElementById( 'CopyLink' );
    objControl.style.display = 'none';
}
