 	// go through titles to make sure that any very long ones are handled as such.
	$(".featuredTitle").each(function(that){
			//console.log($(this)[that]);
		}
	);

	$(document).ready( function() {
		
		$('#topCarouselWrapper')[0].innerHTML = $('#topCarouselWrapperData')[0].innerHTML;		
		$('#topCarouselWrapperData')[0].innerHTML = '';
		
		//set up our two carousels
		$("#featuredLarge").jCarouselLite({
				btnPrev: "#featuredNext",
				btnNext: "#featuredPrev",
				btnDoubleNext: "#featuredPrev2",
				circular: "true",
				visible:1,
				scroll:1,
				easing: "expoinout",
				speed: 500
		});
 
		$("#featuredSmall").jCarouselLite({
				btnPrev: "#featuredNext",
				btnNext: "#featuredPrev",
				circular: "true",
				btnDoubleNext: "#featuredPrev2",
				visible:2,
				scroll:1,
				easing: "expoinout",
				speed: 500,
				onBuild : setupFeaturedClicks,
				afterEnd : setupFeaturedClicks
			});

		//once the carousel is built, take off the overflow hiding which is required for safari to render the rest of the page properly
		$('#topCarouselWrapper > div').css({
			'overflow':'visible',
			'top':'0'
			}
		);
		
		// now make sure the blurb is truncated if needed
		truncateCopyToParent('#featuredLarge ul li .featuredItemCopy .featuredItemBlurb', 48, 35);

		/////////////////////////////
		// FUNCTIONS
		/////////////////////////////
		
		
		function setupFeaturedClicks(a) {
			// clear any possibly conflicting actions
			$(a).unbind();
			// make sure the book panel appears clickable
			$(a).addClass('clickable');
			// set up the first book to move one step
			$(a[0]).click(function(){
				$('#featuredPrev').click();
			});
			// set up the 2nd book to move two steps
			$(a[1]).click(function(){
				$('#featuredPrev2').click();
			});
		}
	
		// and do a little cleanup for layout purposes
		$("#featuredSmall").width(299);
		$('a').click(function() {this.blur();});
		
		$('#topCarouselWrapper').css('visibility','visible');
		
	});

//Added from sifr.js -  the whole js file was messing up the editors list collection title on the home page
var parseSelector=(function(){var _1=/\s*,\s*/;var _2=/\s*([\s>+~(),]|^|$)\s*/g;var _3=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var _4=/^[^\s>+~]/;var _5=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function parseSelector(_6,_7){_7=_7||document.documentElement;var _8=_6.split(_1),_9=[];for(var i=0;i<_8.length;i++){var _b=[_7],_c=toStream(_8[i]);for(var j=0;j<_c.length;){var _e=_c[j++],_f=_c[j++],_10="";if(_c[j]=="("){while(_c[j++]!=")"&&j<_c.length){_10+=_c[j]}_10=_10.slice(0,-1)}_b=select(_b,_e,_f,_10)}_9=_9.concat(_b)}return _9}function toStream(_11){var _12=_11.replace(_2,"$1").replace(_3,"$1*$2");if(_4.test(_12)){_12=" "+_12}return _12.match(_5)||[]}function select(_13,_14,_15,_16){return (_17[_14])?_17[_14](_13,_15,_16):[]}var _18={toArray:function(_19){var a=[];for(var i=0;i<_19.length;i++){a.push(_19[i])}return a}};var dom={isTag:function(_1d,tag){return (tag=="*")||(tag.toLowerCase()==_1d.nodeName.toLowerCase())},previousSiblingElement:function(_1f){do{_1f=_1f.previousSibling}while(_1f&&_1f.nodeType!=1);return _1f},nextSiblingElement:function(_20){do{_20=_20.nextSibling}while(_20&&_20.nodeType!=1);return _20},hasClass:function(_21,_22){return (_22.className||"").match("(^|\\s)"+_21+"(\\s|$)")},getByTag:function(tag,_24){return _24.getElementsByTagName(tag)}};var _17={"#":function(_25,_26){for(var i=0;i<_25.length;i++){if(_25[i].getAttribute("id")==_26){return [_25[i]]}}return []}," ":function(_28,_29){var _2a=[];for(var i=0;i<_28.length;i++){_2a=_2a.concat(_18.toArray(dom.getByTag(_29,_28[i])))}return _2a},">":function(_2c,_2d){var _2e=[];for(var i=0,_30;i<_2c.length;i++){_30=_2c[i];for(var j=0,_32;j<_30.childNodes.length;j++){_32=_30.childNodes[j];if(_32.nodeType==1&&dom.isTag(_32,_2d)){_2e.push(_32)}}}return _2e},".":function(_33,_34){var _35=[];for(var i=0,_37;i<_33.length;i++){_37=_33[i];if(dom.hasClass([_34],_37)){_35.push(_37)}}return _35},":":function(_38,_39,_3a){return (pseudoClasses[_39])?pseudoClasses[_39](_38,_3a):[]}};parseSelector.selectors=_17;parseSelector.pseudoClasses={};parseSelector.util=_18;parseSelector.dom=dom;return parseSelector})();

