jQuery(document).ready(function(){
	//add a class to the li of the gallery links for easier hover selection below
	jQuery('#nav li a.n-galleries').parent().addClass('gallery-wrap');
	//homepage gallery hover on nav effects
	jQuery('#nav li.gallery-wrap a').hover(
		function(e){
			var itemClasses = jQuery(this).attr('class');
			var aItemClasses = itemClasses.split(' ');
			var showItemId = '';
			for(z = 0; z < aItemClasses.length; z++)
			{
				var dIndex = aItemClasses[z].indexOf('n-');
				if(dIndex > -1)
					showItemId = aItemClasses[z].substring(dIndex + 2);
			}
			
			//change art label
			jQuery('.art-label').html(navTitle(showItemId));
		},
		function(e){			
			//clear art label
			jQuery('.art-label').html('&nbsp;');
		}
	);
	
	//cycle fader
	jQuery('.page-banner').cycle({
		fx: 'fade', // choose your transition type, ex: blindX, blindY, blindZ, cover, curtainX, curtainY, fade, fadeZoom, growX, growY, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz, scrollVert, shuffle, slideX, slideY, toss, turnUp, turnDown, turnLeft, turnRight, uncover, wipe, zoom
		speed:  3000 ,  //  time each trans takes
		pause:  0 , // 1 is on, pasues on hover
		random:  1 ,  // 1 is on
		timeout: 1000 ,  // time before the start of each, use 0 for click to next
		cleartype:  1 // helps things in IE 6
	});

	
});

function navTitle(currentItemId){
	var linkLabels = {
		"galleries":"Galleries of artwork",
		"gallery1":"Early Work Felt/Mixed Media 1987-1993",
		"gallery2":"Collage; Stiffened Fabrics &amp; Photo Trans 1997-2005",
		"gallery3":"Glossy Surfaces 2006-2008",
		"gallery4":"Works On Paper 2008",
		"gallery5":"Glossy Circles 2008",
		"gallery6":"Installations 2010",
		"gallery7":"Strip & Label Series 2010-2011"
	};
	
	return linkLabels[currentItemId];
}


