var img_cache = new Object();
var this_page = "links";
var this_id = "";


function parse_images() {
	if (document.getElementById) {
		var ar = document.getElementsByTagName('img');
		for( var x = 0; ar[x]; x++ ) {
			var im = ar[x];
			if(im.getAttribute) { 
				im.hoversrc = im.getAttribute('hoversrc');
				im.activesrc = im.getAttribute('activesrc')
			}
			if(im.hoversrc) {	
			
				if((im.parentNode.getAttribute('link_id') == this_page) || (im.parentNode.getAttribute('link_id') == this_id)) {
					if(im.activesrc) im.src = im.activesrc;
					else im.src = im.hoversrc;	
					continue;
				}
			
				im.rootsrc = im.src;				
				im.onmouseout = function () {
					this.src = this.rootsrc;
				}
				
				if(!img_cache[im.hoversrc]) {
					img_cache[im.hoversrc] = new Image();
					img_cache[im.hoversrc].src = im.hoversrc;
				}
				
				im.onmouseover = function () {			
					this.src = this.hoversrc;										
				}
			}
		}
	}
}
