var path = 'navigation';

var cbSwap = new Array();

function initCommonBlocks() {	
	for(i = 0; i < document.images.length; i++) {
		if((obj=document.images[i]).src.indexOf(path) != -1) {
			sourcePath = obj.src;
			pathToActive = getPath(sourcePath);
			
			temp = new Image();
			temp.src = pathToActive;
			
			cbSwap[i + 'n'] = new Image();
			cbSwap[i + 'n'].src = pathToActive;
			
			obj.oldSrc = sourcePath;
			obj.actSrcInd = i + 'n';
			
			obj.onmouseover = function(){this.src=cbSwap[this.actSrcInd].src};
			obj.onmouseout = function(){this.src=this.oldSrc};			
		}
	}	
}

function getPath(pForImg) {
	var ext, res;
	
	ext = pForImg.substr(pForImg.lastIndexOf("."));
	res = pForImg.substr(0, pForImg.length - ext.length);
	res += "_a" + ext;
	
	return res;
}

if (!parent.document.getElementById('templateframe')) {
	if( window.addEventListener ) {
		window.addEventListener("load", initCommonBlocks, "false");
	} else if( window.attachEvent ) {
		window.attachEvent("onload", initCommonBlocks);
	} else {
		window['onload'] = initCommonBlocks;
	} 
}
