//----------------------------------------------------------------------------------------
//	Function:	writeFooter
//	Purpose:	Displays webpage footer
//	Use:		Type in javascript -> writeFooter(string-variable);
//				ex: 	writeFooter("2003");
// Parameters:	yrCopyright ->  type: string
//								the year you wish to display
//								if empty then default is current year
//----------------------------------------------------------------------------------------
function writeFooter(yrCopyright)
{
	var whichDrive = "";
	var url = getURL();

	if ("string" != typeof(yrCopyright))
	{
		var cur = new Date();
		yrCopyright = fixDate(cur);
	}

	document.write('<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>');
	document.write('<font face="Tahoma, Arial, Helvetica" size="-2">');
	document.write('[<A class="a_footer" href="' + url + '">HOME</A>]<br>');
	document.write('[<A class="a_footer" href="' + url + 'data_storage.html">Data &amp; Storage Management</A>] ');
	document.write('[<A class="a_footer" href="' + url + 'system_networks.html">System &amp; Network Management</A>] ');
	document.write('[<A class="a_footer" href="' + url + 'security.html">Security</A>]<br>');
	document.write('[<A class="a_footer" href="' + url + 'request_info.html">Information Request</A>]</font><br><br><br>');
	document.write('<font face="Tahoma, Arial, Helvetica" size="-1">');
	document.write('<i><b>© ' + yrCopyright + ' Unylogix Technologies Inc.</b></i></font><br><br>');
	document.write('<font face="Tahoma, Arial, Helvetica" size="-2">');
	document.write('Mailing address</font><br>');
	document.write('<font face="Tahoma, Arial, Helvetica" size="-2">5590 Les Becquets • Montreal • Quebec • Canada • H1S 1S2<br>Phone <b>514-253-5200</b> • Fax 514-256-4037<br>For information and sales: <b>');
	writeEmail("info");
	document.write('</b><br>Support and technical issues: <b>');
	writeEmail("support");
	document.write('</b><br>http://www.unylogix.com</FONT><br>&nbsp;');
	
	return writeFooter;	
}

//----------------------------------------------------------------------------------------
//	Function:	writeEmail
//	Purpose:	Encode emails posted on website in HEX to prevent spamming
//	Use:		Type in javascript -> writeEmail(string-variable);
//				ex: 	writeEmail("test"); prints a link to test@unylogix.com
// Parameters:	sId ->  type: string
//						the email address you wish to link
//						options - info, support
//				sDisplayText -> type: string
//						 to print another text as link
//				doWrite ->  type: boolean
//							true	displays link (default) 
//							false	doesn't display link
//----------------------------------------------------------------------------------------
function writeEmail(sId, sDisplayText, doWrite)
{
	if ("string" != typeof(sId)) return "";
	if ("string" != typeof(sDisplayText)) sDisplayText = "";
	if ("boolean" != typeof(doWrite)) doWrite = true;
	
/* ---------- Hexadecimal encoding of email address - not currently used - replaced by next section --------------------//
	var sStartTag	= '<a class="a_footer" href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;';
	var sEndTag1	= '">';
	var sEndTag2	= '</a>';
	var sDomain		= '&#x40;&#x75;&#x6E;&#x79;&#x6C;&#x6F;&#x67;&#x69;&#x78;&#x2e;&#x63;&#x6f;&#x6d;';
	var sInfo		= '&#x67;&#x65;&#x74;&#45;&#x69;&#x6e;&#x66;&#x6f;';
	var sSupport	= '&#x67;&#x65;&#x74;&#45;&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#x74;';
	var sWebmaster	= '&#x77;&#x65;&#x62;&#x6d;&#x61;&#x73;&#x74;&#x65;&#x72;';
	var sELink		= "";
----------------------------------------------------------------------------------------------------------------------- */	

// --------- Character encoding of email address - currently used ------------------------------------------------------//
	var sStartTag	= '^<^a^ c^l^a^s^s^=^"^a^_^f^o^o^t^e^r^" ^h^r^e^f^=^\"^m^a^i^l^t^o^:^';
	var sEndTag1	= "^\"^>^";
	var sEndTag2	= "^<^/^a^>^";
	var sDomain		= "^@^u^n^y^l^o^g^i^x^.^c^o^m^";
	var sInfo		= "^i^n^f^o^-^1^";
	var sSales		= "^s^a^l^e^s^";
	var sSupport	= "^s^u^p^p^o^r^t^-^1^";
	var sWebmaster	= "^w^e^b^m^a^s^t^e^r^";
	var sELink		= "";
// -------------------------------------------------------------------------------------------------------------------------	

//	for(var x=31; x<266; x++)
//		document.write(x + " &#x" + x + ";<BR>");

	switch (sId)
	{
		case "info" :
			sELink	= sInfo;
			break;

		case "support" :
			sELink	= sSupport;
			break;
			
		case "sales" :
			sELink	= sSales;
			break;

		case "webmaster" :
			sELink	= sWebmaster;
			break;
		default:
			return "";
	}
	if (sDisplayText == "")
		sDisplayText = sELink + sDomain;
	sELink	= sStartTag + sELink + sDomain + sEndTag1 + sDisplayText + sEndTag2;
	sELink	= sELink.replace(/\^/g, "");
	if (doWrite)
		document.write(sELink);

	return sELink;
}

//----------------------------------------------------------------------------------------
//	Function:	fixDate
//	Purpose:	Verifies content of date and replaces with current date if empty
//	Use:		Type in javascript -> fixDate(string-variable);
//				ex: 	fixDate("2005"); 
//  Parameters:	date ->  type: string
//					 	 the date you wish to display
//----------------------------------------------------------------------------------------
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
	
  return date.getFullYear();
}

// End of file

