// preload navigation images and their mouseovers function init() { if ( document.getElementById ) var x = document.getElementById( 'navigation' ).getElementsByTagName( 'IMG' ); else if ( document.all ) var x = document.all[ 'navigation' ].all.tags( 'IMG' ); else return; var preloads = new Object(); var imageId; for ( var i = 0; i < x.length; i++ ) { // check if the image has id - if it doesn't then it is not a navigation item // also check if the image contains 'over' text - if it does then this is // the mouseover image of the current page and it should not be preloaded if( x[ i ].id == '' || x[ i ].src.match( 'over' ) != null ) continue; imageId = x [ i ].id.replace('ctl00_cphUpperMenu_upperMenu_navigation', ''); if(imageId == 'Left' || imageId == 'Right') continue; preloads[ 'n' + x[ i ].id ] = new Image; preloads[ 'n' + x[ i ].id ].src = 'Images/navigation_'+ imageId+ '.gif'; preloads[ 'o' + x[ i ].id ] = new Image; preloads[ 'o' + x[ i ].id ].src = 'Images/navigation_'+ imageId + '_over.gif'; x[ i ].onmouseover = function () { this.src = preloads[ 'o' + this.id ].src; } x[ i ].onmouseout = function () { this.src = preloads[ 'n' + this.id ].src; } } }