
function initNav() {
	for (var i=0;i<6;i++) if (document.getElementById('nav'+i) != undefined) initNavBtn(document.getElementById('nav'+i));
	for (var i=0;i<6;i++) {
		preloadImgObjs[i] = new Image();
		preloadImgObjs[i].src = preloadFileNames[i];
	}

    init();
}


var preloadFileNames = new Array();
var preloadImgObjs = new Array();

function initNavBtn(obj) {
	var index = parseInt(obj.id.substr(3, 1));
	obj.index = index;
	obj.onmouseover = function() {this.src = '/_images/nav' + this.index + '_over.gif'};
	obj.onmouseout = function() {this.src = '/_images/nav' + this.index + '.gif'};
	preloadFileNames.push('/_images/nav' + index + '.gif');
	
	
}


function init() {
  if (!document.getElementById) return;
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
     if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');

            newImg = this.getAttribute('hsrc'); 
            this.setAttribute('src',newImg);
       
        }
        imgarr[i].onmouseout = function() {
			this.setAttribute('src',imgOriginSrc);
        }
    }
  }
}	