
/*-- Javascript Styles --*/


		function MM_showHideLayers() { //v9.0
			var i,p,v,obj,args=MM_showHideLayers.arguments;
			for (i=0; i<(args.length-2); i+=3) 
				with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
				if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    		obj.visibility=v; 
			}
		}
		$(document).ready(function(){
			$('.gallery_listing li a').click(function(){

				if ($(this).attr('class') == 'prev') {
					var prevli = $(this).parents('.gallery_listing').find('.active').parent('li').prev().find('a');
		
					if (prevli.attr('class') != 'prev') {
						prevli.trigger('click');
					}
				}
				
				else if ($(this).attr('class') == 'next') {
					var nextli = $(this).parents('.gallery_listing').find('.active').parent('li').next().find('a');
		
					if (nextli.attr('class') != 'next') {
						nextli.trigger('click');
					}
				}

				else {
				
				//switch out the image
				$(this).parents('.gallery').find('.galleria_container img').attr('src',$(this).attr('href'));
				
				//switch out the caption
				$(this).parents('.gallery').find('.caption').text($(this).attr('title'));

				//unselect the old active item
				$(this).parents('.gallery_listing').find('.active').attr('class','');

				//mark the current item as active
				$(this).attr('class','active');
				
				}

				return false;
			});

		});



