/**********************************************
 * RDN Consulting Web Page JavaScript Functions
 * © 2003 RDN Consulting, All Rights Resevered
 **********************************************/
 
//-----------------------------------------------------
// Transform an XML table using XSL
function xform(xmlfile,xslfile)
{
	// Load XML 
	var xml = new ActiveXObject("Microsoft.XMLDOM");
	xml.async = false;
	xml.load(xmlfile);
	// Load XSL
	var xsl = new ActiveXObject("Microsoft.XMLDOM");
	xsl.async = false
	xsl.load(xslfile);
	// Transform
	document.write(xml.transformNode(xsl));
}
//-----------------------------------------------------
function header()
{
	document.write('<p align="center"><a href="main.htm" target="main">');
	document.write('<img src="images/business-card.GIF" alt="RDN Consulting" border="0"></a>');
	document.write('</p><hr color="#ff0000" noShade><br>');
}
//-----------------------------------------------------
// Common footer
function footer(include_date)
{
	document.write("<br><br><TABLE id=\"foottable\" cellSpacing=\"1\" cellPadding=\"1\" width=\"40%\" align=\"center\" border=\"0\">");
	document.write("<tr><td colspan=3><hr color=\"#ff0000\" noShade></td></tr>");
	document.write("<tr align=\"center\"><td width=33%><FONT size=\"2\">");
	document.write("<a href=\"#top\">Top of Page</a>");
	document.write("</FONT></td><td width=33%><FONT size=\"2\">");
	jemailhead("webmaster","rdn-consulting","com");
	document.write("E-mail</a>");
	document.write("</FONT></td><td width=33%><FONT size=\"2\">");
	document.write("<a href=\"main.htm\" target=\"main\">Home</a>");
	document.write("</FONT></td></tr>");
	document.write("<tr><td align=\"center\" colspan=3>");
	document.write("<br>");
	document.write("<FONT size=\"1\">");
	if (include_date) {
		var cdate = date_lastmodified();
		document.write("Last Updated: "+cdate);
		document.write("<br>");
	}
	var y = (new Date()).getYear();
	if (y < 2000) y += 1900; // netscape
	document.write("© "+y+" RDN Consulting, All Rights Reserved.");
	document.write("</FONT>");
	document.write("</td></tr></TABLE>");
}
//-----------------------------------------------------
// SPAM free address
function jemailhead(user, domain, suffix) 
{
	document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">');
}
function jemail(user, domain, suffix) 
{
	jemailhead(user,domain,suffix);
	document.write(user + '@' + domain + '.' + suffix + '</a>');
}

//-----------------------------------------------------
/*
 * 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;
}

