function decorateLinks() {
	var linksCount = 0;
	var linksTotal = document.links.length;
	var baseUrl = 'http://www.allods.net/images/maps/';
	var linkPatterns = {'maps': 'map.gif', 'quests': 'quest.gif', 'items': 'item.gif', 'npc': 'npc.gif', 'skill': 'skill.gif', 'profile': 'profile.gif'};
	for (linksCount = 0; linksCount < linksTotal; linksCount++) {
                for (var linkPattern in linkPatterns) { 
                	var linkObject = document.links[linksCount];
                	if ((linkObject.href.search(new RegExp('allods\.net\/' + linkPattern + '\/(?=[0-9])', 'i')) != -1) 
                	|| (linkObject.href.search(new RegExp('allods\.net\/' + linkPattern + '\/\\w*\/(?=[0-9])', 'i')) != -1)
                        || (linkObject.href.search(new RegExp('allods\.net\/' + linkPattern + '\/.*\/.*\/', 'i')) != -1)
                	&& (linkObject.parentNode.id != 'navline' && linkObject.parentNode.className != 'skillLine')) { 
				var iconImage = new Image();
				iconImage.src = baseUrl + linkPatterns[linkPattern];
				linkObject.parentNode.insertBefore(iconImage, linkObject);
				setObjectStyle(iconImage, "margin-bottom: -4px; ");
			}
		}
	}
}

function setObjectStyle(object, styleText) { 
	if (object.style.setAttribute) { 
		object.style.setAttribute("cssText", styleText ); 
	} else { 
		object.setAttribute("style", styleText ); 
	} 
}

