//
// code for creating a real date etc
//        
function getDate() {
	var returnDate;
	var day, daynum, month, year ;
	var myDate = new Date ();
	
	//process day of the week
	tempDay = myDate.getDay(); 
	
   if (tempDay==0 )
     day= "Sunday" ;	
    else 
   if (tempDay==1 )
     day= "Monday" ;
     else 
   if (tempDay==2 )
     day= "Tuesday" ;
     else 
   if (tempDay==3 )
     day= "Wednesday" ;
     else 
   if (tempDay==4 )
     day= "Thursday" ;
     else 
   if (tempDay==5 )
     day= "Friday" ;
      else 
   if (tempDay==6 )
     day= "Saturday" ;
     
     //process day of month
     daynum = myDate.getDate();
     
     
     //process month
     var tmpMonth = myDate.getMonth();
     if (tmpMonth == 0 )
     month="January";
     else 
     if (tmpMonth == 1 )
     month="February" ;   
     else 
     if (tmpMonth == 2 )
     month="March" ;  
     else 
     if (tmpMonth == 3 )
     month="April" ;  
     else 
     if (tmpMonth == 4 )
     month="May" ;  
     else 
     if (tmpMonth == 5 )
     month="June" ;  
     else 
     if (tmpMonth == 6 )
     month="July" ;  
     else 
     if (tmpMonth == 7 )
     month="August" ;
     else 
     if (tmpMonth == 8 )
     month="September" ; 
     else 
     if (tmpMonth == 9 )
     month="October" ;
     else 
     if (tmpMonth == 10 )
     month="November" ;
     else 
     if (tmpMonth == 11 )
     month="December" ;
     
     //process year
      year = myDate.getFullYear();
      
     returnDate = day +", "  + daynum + "  " + month + " "+ year ; 
     
     return returnDate;
 }
// end of real date -->	    

 

//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  return "" +
    (d<10?"0"+d:d) + "-" +
    mmm + "-" +
    (y<10?"0"+y:y);
}

  // get last modified date of the 
  // current document.
  
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }

  return s;
}

  // finally display the last modified date
  // as DD-MMM-YY
  //
  // end of short date -->
          
