/**
 * Icons component
 */
var Anchors = {

	init: function() {
		var anchors = new Array();
		$('.anchor a').each(function() {
			try {
				var anchor = new Object();
				anchor.name = this.name;
				anchor.title = this.title;
				anchors.push(anchor);
			}
			catch(err) {
				// ignore
			}
		});
		if (anchors.length > 0) {
			var anchorhtml = '<ul class="anchors">';
			for (var i = 0; i < anchors.length; i++) {
				anchorhtml += '<li><a href="#' + anchors[i].name + '">' + anchors[i].title + '</a></li>';
			}
			anchorhtml += '</ul>';
			$('.anchorcontainer').html(anchorhtml);
		}
	}
};

$(document).ready(function() {
	Anchors.init();
});

