$(document).ready( function() {

	// set image swap events for all rollovers
	
	$('.rollover').hover(

		function() {

			this.src = this.src.replace( '-up', '-over' );

		},

		function() {

			this.src = this.src.replace( '-over', '-up' );

		}

	);
	
	$('.left_col_rollover').hover(

		function() {
			$(this).children().attr("src", $(this).children().attr("src").replace( '-up', '-over' ));
		},

		function() {

			$(this).children().attr("src", $(this).children().attr("src").replace( '-over', '-up' ));

		}
	
	);

	

	// add iehover class to support hover for li

	/*if ( jQuery.browser.msie ) {

		$('div#nav_main>ul>li').hover(

			function() {

				$(this).addClass( 'iehover' );

			},

			function() {

				$(this).removeClass( 'iehover' );

			}

		);

	}*/

});



// start preloading hover images after page is done

$(window).bind( 'load', function() {

	var imagePaths = new Array();

	var numPreloads = 0;

	$('.rollover').each( function() {

		s = $(this).attr("src").replace( '-up', '-over' );

		imagePaths.push( s );

		numPreloads++;

	});

	

	

	for ( var i = 0; i < numPreloads; i++ ){

		var img = document.createElement( 'img' );

		img.src = imagePaths[i];

	}

	

	/*var img = document.createElement( 'img' );

	$(img).bind( 'load', function() {

		if( preload[0] ) {

			this.src = preload.shift();

		}

	}).trigger( 'load' );*/

});
