
var collectLinks = {
	
	init: function() {

		var $obj = $("#content");

		if (!$obj.length) return;

		var label = "<h4>Verwendete Links:</h4> \n";
		var content = label;
	
		var dateAndTime = new Date();
		var day = collectLinks.formatDate(dateAndTime.getDate());
		var month = collectLinks.formatDate(dateAndTime.getMonth() + 1);
		var year = dateAndTime.getFullYear();
		var hours = collectLinks.formatDate(dateAndTime.getHours());
		var minutes = collectLinks.formatDate(dateAndTime.getMinutes());

		var dateString = "<p>&nbsp;</p><p>Erzeugt am: "+day+"."+month+"."+year+" um " + hours + ":"+minutes+"</p> \n";
	
		var $links = $obj.find("a");
		$links.each(function() {
			content += "<p><strong>" + $(this).text() + "  :</strong>" + $(this).attr("href") + "</p> \n"; 
		});

		content += dateString;
		$("#footer").html(content);

	},

	formatDate: function (d) {
		if (d < 10)	 d = "0" + String(d);
		return d;
	}
}

 $(document).ready(collectLinks.init);
