//pulls image's meta data to update the text and link
	var setDescription = function(cur, next){
		var meta = jqN(next).closest("#slide-show").find(".copy");
		jqN(meta).find("span:not(.shade)").html(jqN(next).attr("alt") + ' <a href="' + jqN(next).attr("url") + '" class="more">More &raquo;</a>');
		jqN(meta).find("h2").text(jqN(next).attr("title"));
	};

	//builds the thumbnails for each slide in the slideshow
	var slideshowThumb = function(i, obj){ 
		/* make image hot with url setting */
		jqN(obj).click(function(){
			document.location.href = jqN(this).attr("url");
		});

		/* append thumbnail to thumbs box */
		var thumb_class = (jqN(obj).attr("className")!="")? jqN(obj).attr("className") + '-thm':'';
		var href = (jqN("#thumbClick").text().toLowerCase() == "on")? "onclick='thumbClick(\""+ jqN(obj).attr("url") +"\")'" : ""; 	
		var thumb_txt = (jqN(obj).attr("short"))? jqN(obj).attr("short") : jqN(obj).attr("title"); 	
 
		return '<div class="thumb ' + thumb_class + '"><a '+ href +'><img src="' + jqN(obj).attr("rel") + '" /><span class="title ' + jqN(obj).attr("className") + '">' + thumb_txt + '</span></a></div>'; 
	};
	
	var thumbClick = function(href){
		document.location.href = href;
	};
	
	
	jqN(document).ready(function() {
		if(jqN('#slide-show .slides').length && typeof(window.ss_off)=="undefined"){
			jqN('#slide-show .slides').cycle({
				fx:'fade', //fade, scrollUp, shuffle..
				timeout: (jqN("#slideCycle").text().toLowerCase() == "off")? 0 : 5000 , 
				next:'#slide-show .next', prev:'#slide-show .prev', 
				pager:'#slide-show .thumbs', 
				pagerAnchorBuilder: slideshowThumb, 
				pagerEvent: (jqN("#slideMouseover").text().toLowerCase() == "on")? 'mouseover' : 'click' ,
				before: setDescription
			});
		}
	});

