/*

This is a very handy function written by Simon Willison:
http://simon.incutio.com/archive/2004/05/26/addLoadEvent

It allows you to queue up a whole series of events to be triggered when the document loads.

If you simply use window.onload = func, then you run the risk of overwriting existing functions that are supposed to run when the onload event is triggered.

*/

function addLoadEvent(func) {

	var oldonload = window.onload;

	if (typeof window.onload != 'function') {

		window.onload = func;

	} else {

		window.onload = function() {

			oldonload();

			func();

		}
	}
}


window.onload = function copyrightDateInsert() {
		var creation_year = '2005';
		var client_name = 'Almisco.com, LLC';
		var d = new Date();
		var e = d.getFullYear();
		var content = document.getElementById('content');
			if (creation_year != e) {
				content.innerHTML += '<div class="copyright"><p>' + '&copy;&nbsp;Copyright&nbsp;' + creation_year + '-' + d.getFullYear() + '&nbsp;by&nbsp;' + client_name + "</p><\/div>";
			}
			else {
				content.innerHTML += '<div class="copyright"><p>' + '&copy;&nbsp;' + d.getFullYear() + '&nbsp;by&nbsp;' + client_name + "</p><\/div>";
			}
}



// email encoding function
function email(alias,url,lnktext, subject){
	if (subject == "") {
    	document.write ("<a href='mailto:" + alias + "@" + url + "' target='_blank'>" + lnktext + "</a>");
	} else {
    	document.write ("<a href='mailto:" + alias + "@" + url + "?subject=" + subject + "' target='_blank'>" + lnktext + "</a>");
	}
}