<!--
jQuery.preloadImages = function() {
	var preloads = arguments[0];
	var pathPrefix = arguments[1];
	for ( var imgCnt = preloads.length - 1; imgCnt > 0; imgCnt-- ) {
		jQuery('<img>').attr('src', pathPrefix + preloads[imgCnt]);
	}
};

// Preload required images
var preloads = ['people-on.png', 'portraits-on.png', 'contact-on.png', 'bio-on.png', 'landscape-architecture-on.png', 'spaces-on.png'];
$.preloadImages(preloads, '/images/');

$(document).ready(function(){
	// Highlight selected page
	var page = window.location.pathname;
	page = page.replace('.php', '');
	page = page.replace('/', '');
	if ( page == '' || page == 'index' ) {
		// Andy change here
		page = 'portraits';
	}
	else if ( page == 'landscape-architecture' ) {
		page = 'landscapeArchitecture';
	}
	if ( $('#'+page).attr('src') != undefined ) {
		var imgSrc = $('#'+page).attr('src');
		imgSrc = imgSrc.replace('-off', '-on');
		$('#'+page).attr('src', imgSrc);	
	}
	// Handle categories image mouse overs
	$('#categories img').mouseover( function(e){
		var imgSrc = $(this).attr('src');
		imgSrc = imgSrc.replace('-off', '-on');
		$(this).attr('src', imgSrc);
	});
	$('#categories img').mouseout( function(e){
		if ( page != $(this).attr('id') ){
			var imgSrc = $(this).attr('src');
			imgSrc = imgSrc.replace('-on', '-off');
			$(this).attr('src', imgSrc);
		}
	});
	// Handle categories image mouse overs
	$('#navigation img').mouseover( function(e){
		var imgSrc = $(this).attr('src');
		imgSrc = imgSrc.replace('-off', '-on');
		$(this).attr('src', imgSrc);
	});
	$('#navigation img').mouseout( function(e){
		if ( page != $(this).attr('id') ){
			var imgSrc = $(this).attr('src');
			imgSrc = imgSrc.replace('-on', '-off');
			$(this).attr('src', imgSrc);
		}
	});
});

// -->

