function xDate(disp) 
{ 
    // RUNTIME INITIALIZATION 
    rightNow = new Date(); 
    year = rightNow.getFullYear(); 
    date = rightNow.getDate(); 
    thisDay = rightNow.getDay(); 
    thisMonth = rightNow.getMonth(); 
    allDaysLong=new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); 
    allDaysShort=new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); 
    allMonthsLong=new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); 
    allMonthsShort=new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'); 
    var todayis; 
     
    // DATE IN NUMBER FORMAT 
    if (disp==30||disp==31||disp==32||disp==33) thisMonth++; 

    // DATE IN WORD FORMAT (LOWERCASE BY DEFAULT) 
    else 
    { 
        // UPPERCASE NAMES 
        if (parseInt(disp) > 19 && parseInt(disp) < 30) 
        { 
            allMonthsLong[thisMonth]=allMonthsLong[thisMonth].toUpperCase(); 
            allDaysLong[thisDay]=allDaysLong[thisDay].toUpperCase(); 
            allMonthsShort[thisMonth]=allMonthsShort[thisMonth].toUpperCase(); 
            allDaysShort[thisDay]=allDaysShort[thisDay].toUpperCase(); 
        } 
    } 

    // WHAT AND HOW TO DISPLAY INFORMATION 
    if (disp == '0') todayis='&nbsp;'; 
    else if (disp == '10') todayis=allDaysLong[thisDay]+', '+allMonthsLong[thisMonth]+' '+date+', '+year; 
    else if (disp == '11') todayis=allMonthsLong[thisMonth]+' '+date+', '+year; 
    else if (disp == '12') todayis=allMonthsLong[thisMonth]+' '+date; 
    else if (disp == '13') todayis=allDaysLong[thisDay]; 
    else if (disp == '14') todayis=allMonthsLong[thisMonth]; 
    else if (disp == '15') todayis=allDaysShort[thisDay]+', '+allMonthsShort[thisMonth]+' '+date+', '+year; 
    else if (disp == '16') todayis=allMonthsShort[thisMonth]+' '+date+', '+year; 
    else if (disp == '17') todayis=allMonthsShort[thisMonth]+' '+date; 
    else if (disp == '18') todayis=allDaysShort[thisDay]; 
    else if (disp == '19') todayis=allMonthsShort[thisMonth]; 
    else if (disp == '20') todayis=allDaysLong[thisDay]+', '+allMonthsLong[thisMonth]+' '+date+', '+year; 
    else if (disp == '21') todayis=allMonthsLong[thisMonth]+' '+date+', '+year; 
    else if (disp == '22') todayis=allMonthsLong[thisMonth]+' '+date; 
    else if (disp == '23') todayis=allDaysLong[thisDay]; 
    else if (disp == '24') todayis=allMonthsLong[thisMonth]; 
    else if (disp == '25') todayis=allDaysShort[thisDay]+', '+allMonthsShort[thisMonth]+' '+date+', '+year; 
    else if (disp == '26') todayis=allMonthsShort[thisMonth]+' '+date+', '+year; 
    else if (disp == '27') todayis=allMonthsShort[thisMonth]+' '+date; 
    else if (disp == '28') todayis=allDaysShort[thisDay]; 
    else if (disp == '29') todayis=allMonthsShort[thisMonth]; 
    else if (disp == '30') todayis=thisMonth+'/'+date+'/'+year; 
    else if (disp == '31') todayis=date+'/'+thisMonth+'/'+year; 
    else if (disp == '32') todayis=thisMonth+'/'+date; 
    else if (disp == '33') todayis=date+'/'+thisMonth; 
    else if (disp == '5') todayis=date; 
    else if (disp == '6') todayis=year; 
    else todayis='Error: xDate(?);'; 

    return todayis; 
} 

