
	var arrClockWeekdays = new Array();
	var arrClockMonths   = new Array();

	arrClockWeekdays[1] = "Sunnudagurinn";
	arrClockWeekdays[2] = "Mánudagurinn";
	arrClockWeekdays[3] = "Þriðjudagurinn";
	arrClockWeekdays[4] = "Miðvikudagurinn";
	arrClockWeekdays[5] = "Fimmtudagurinn";
	arrClockWeekdays[6] = "Föstudagurinn";
	arrClockWeekdays[7] = "Laugardagurinn";

	arrClockMonths[1]  = "janúar";
	arrClockMonths[2]  = "febrúar";
	arrClockMonths[3]  = "mars";
	arrClockMonths[4]  = "apríl";
	arrClockMonths[5]  = "maí";
	arrClockMonths[6]  = "júní";
	arrClockMonths[7]  = "júlí";
	arrClockMonths[8]  = "ágúst";
	arrClockMonths[9]  = "september";
	arrClockMonths[10] = "október";
	arrClockMonths[11] = "nóvember";
	arrClockMonths[12] = "desember";

	function fncLeadingZeros(strString, intLength) {
		var intCount;

		for (intCount=strString.length;intCount<intLength;intCount++) {
			strString = "0" + strString;
		}

		return strString;
	}

	function fncClock(strHTML) {
		var objDate, strText;
		strText = strHTML;
		objDate = new Date();

		strText = strText.replace("%hr", fncLeadingZeros((objDate.getHours()).toString(),   2));
		strText = strText.replace("%mi", fncLeadingZeros((objDate.getMinutes()).toString(), 2));
		strText = strText.replace("%se", fncLeadingZeros((objDate.getSeconds()).toString(), 2));

		strText = strText.replace("%mn", arrClockMonths[(objDate.getMonth() + 1)]);
		strText = strText.replace("%m",  fncLeadingZeros((objDate.getMonth() + 1).toString(), 2));
		strText = strText.replace("%d",  objDate.getDate());
		strText = strText.replace("%y",  objDate.getYear());
		strText = strText.replace("%w",  arrClockWeekdays[objDate.getDay() + 1]);

		return strText;
	}


