/**
 * Function concatenating several strings to build an emailaddress
 * @param {Object} add : username of the person to send the email to
 * @param {Object} dom : domain (site)
 * @param {Object} ext : iso country extension
 * @param {Object} string : string to display as link on the site
 */
function encodeEmailAddress(add, dom, ext, string){
	var first = 'ma';
	var second = 'il';
	var third = 'to:';
	document.write('<a href="'+first+second+third+add+'&#64;'+dom+'.'+ext+'">'+string+'</a>');
}

/**
 * Creates a basic array
 */
function makeArray() {
	for (i = 0; i<makeArray.arguments.length; i++)
	this[i + 1] = makeArray.arguments[i];
}

/**
 * Function showing the date under the format "dd/MM/yy"
 */
function showShortDate(){
	var date = new Date();
	var d  = date.getDate();
	var day = (d < 10) ? '0' + d : d;
	var m = date.getMonth() + 1;
	var month = (m < 10) ? '0' + m : m;
	var yy = date.getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;
	document.write(day + "/" + month + "/" + year);
}

/**
 * Function showing the date under the format "dd [monthname] yyyy"
 */
function showLongDate(){
	var months = new makeArray('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
	var date = new Date();
	var day = date.getDate();
	var month = date.getMonth() + 1;
	var yy = date.getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;
	document.write(day + " " + months[month] + " " + year);	
}

/**
 * Function checking if an integer is < then 10
 * @param {Object} i : integer to be checked
 */
function checkTime(i) {
	if (i<10) {
		i="0" + i;
	}
	return i;
}

/**
 * Function showing the actual time under the format "hh:mm:ss"
 */
function showTime(){
	var today=new Date();
	var hrs=today.getHours();
	var min=today.getMinutes();
	var sec=today.getSeconds();
	min=checkTime(min);
	sec=checkTime(sec);
	document.write(hrs+":"+min+":"+sec);
	t=setTimeout('startTime()',500);
}

function showSeperator(sep){
	document.write(" "+sep+" ");
}

