// Author:  Mark Pettit of {z}indexProductions


	// banner fade-in
var duration = 1500;
var steps = 20;


function opacityFilter(value) {
	var object=document.getElementById("banner");
	object.style.opacity=value;
	object.style.filter="alpha(opacity=" + (value * 100) + ");";
}

function changeOpacity() {
	for (i = 0; i <= 1; i += (1 / steps)) {
		setTimeout ("opacityFilter(" + i + ")", i * duration);
	}
}


	// Gallery Rollovers -- jQuery

$(document).ready(function() {
		
		var $thumbsImg1 = $('#thumbs img');
		var $thumbsImg = $('#thumbGridWrapper img');
		var $thumbsA1 = $('#thumbs a');
		var $thumbsA = $('#thumbGridWrapper a');
		
		// Preload all rollovers -- trick courtesy of Atlanta Jones
		$thumbsImg.each(function() {  // new
			// Set the original src
			rollsrc = $(this).attr("src");
			rollOVR = rollsrc.replace('1', '_alt');
			newImg = new Image(); // create new image obj
			$(newImg).attr("src", rollOVR); // set new obj's src
		});
		
		$thumbsImg1.each(function() { // old
			// Set the original src
			rollsrc = $(this).attr("src");
			rollOVR = rollsrc.replace('1', '_alt');
			newImg = new Image(); // create new image obj
			$(newImg).attr("src", rollOVR); // set new obj's src
		});
		
		// Navigation rollovers
		$thumbsA.mouseover(function(){ // new
			imgsrc = $(this).children("img").attr("src");
			
			if (typeof(imgsrc) != 'undefined') {
			imgsrcOVR = imgsrc.replace('1', '_alt');
			$(this).children("img").attr("src", imgsrcOVR);
			}
			
		});
		
		$thumbsA1.mouseover(function(){  // old
			imgsrc = $(this).children("img").attr("src");
			
			if (typeof(imgsrc) != 'undefined') {
			imgsrcOVR = imgsrc.replace('1', '_alt');
			$(this).children("img").attr("src", imgsrcOVR);
			}
			
		});
		
		// on mouseout
		$thumbsA.mouseout(function(){  // new
			if (typeof(imgsrc) != 'undefined') {
			$(this).children("img").attr("src", imgsrc);
			}
		});
		
		$thumbsA1.mouseout(function(){  // old
			if (typeof(imgsrc) != 'undefined') {
			$(this).children("img").attr("src", imgsrc);
			}
		});
		
	// navigation highlight
		$('.highlightCategory').fadeTo('50', 1);
		
		
});(jQuery);

