// javaScript functions



//
// 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)?'January':( 2==m)?'Febuary':(3==m)?'March':( 4==m)?'April':( 5==m)?'May':(6==m)?'June':
	( 7==m)?'July':( 8==m)?'August':(9==m)?'September':(10==m)?'October':(11==m)?'November':'December';

  return "" + mmm + " " + (d<10?"0"+d:d) + ", " + (y<10?"200"+y:"20"+y);
  
 // 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

// document.write( "This page was updated on " + date_lastmodified() );
// document.write("This page was updated on " + date_lastmodified() + ".<br>" );

function write_credits(dateTxt, txtColor, txtClass){
	
	document.write("<div class='" + txtClass + "' ALIGN='center'>");
	document.write("<font color=" + txtColor + " size='2'>");
	document.write("&copy;Pat Tyler 2007-2011, Friends of Mission Granbury<br />");
	document.write("1310 Weatherford Highway, P. O. Box 1343, Granbury, TX 76049<br />");
	document.write("Hotline: 817-579-6848 &sect; Office: 817-579-6866<br />");
	if (dateTxt==""){
	// myDate = short_date.getMonth() + "/" + short_date.getDate() + "/" + short_date.getyear();
	// document.write("This page was last updated on "+document.lastModified+ ".<br>");
	document.write("This page was updated on " + date_lastmodified() + ".<br>" );
	}
	else {document.write("This page was updated " + dateTxt +".<br>");
	}
	document.write("Webmaster: <a class='" + txtClass + "' href='mailto:webmaster@timbercove-hoa.org'>Pat Tyler</a><br>");
	document.write("</font></div>");
}



