$(document).ready(function() { 	/* ******************************	   =global javscript for ARROW	********************************/	/****************************************		front page superfish menus		http://users.tpg.com.au/j_birch/plugins/superfish/#getting-started	****************************************/	$('ul#sub-nav').superfish({		animation: { opacity:'show' },		autoArrows: false,		speed: 250,		delay: 750 // 0.75 second delay on mouseout		});		/****************************************		front page product rotator	****************************************/		$('#product-rotator-inner').before('<div id="rnav">').cycle({ 	    fx: 'scrollLeft', 	    speed: 1500,		easing: 'easeOutQuad',	    timeout: 7000,		delay: -2000, 	    pager: '#rnav',		pause: 1	});		$('#print-page').find('a.product-print').click(function(){		// get visible tab		var thisURL = $(this).attr('href');		var visibleTab = $('div .tab-content:not(.ui-tabs-hide)').attr('id').split("#");		window.open(thisURL + "&tab=" + visibleTab,"Print", "");		return false;	});		$('#print-page').find('a.print').click(function(){		window.print();	});	/****************************************		 jQuery carousel setup		http://sorgalla.com/projects/jcarousel/#Configuration	****************************************/		//inner product detail tool scroller - aplly only if 4+ photos exist	if ($('#results-loader ul.thumb-scroller li').size() > 4) {		$('#results-loader ul.thumb-scroller').jcarousel({			animation: 500,			easing: 'easeInOutQuad',			scroll: 3,			buttonNextHTML: '<div>next</div>',			buttonPrevHTML: '<div>Prev</div>'		});	}		//inner product detail image viewer -> fades product image, then swaps img src attribute, then fades in new image	$('ul.thumb-scroller li a').each(function(){		$(this).click(function(){			var newImg = $(this).attr('href'); //get src url of full image			$(this).parents().filter('div#results-loader').children('div.photo-holder').addClass('loading').children('img').stop().fadeTo(250, .1, function(){				$(this).css('display', 'none');				$(this).attr('src', newImg);			});			return false;		});		});	//fadein images after they have preloaded	$("div.photo-holder>img").load(function(){		$("div.photo-holder>img:hidden").fadeIn(50).fadeTo(250, 1);		$('div.photo-holder').removeClass('loading');	});		/****************************************		product details tabs		http://stilbuero.de/jquery/tabs_3/	****************************************/		$('#product-info ul#tab-nav').tabs();		/****************************************		front page hover quotes functionality	****************************************/	$('#main-left #tool-scroller ul.tools li a').each(function () {	    //create nested span dynamically		var hoverText = $(this).text();		$(this).append('<span class="hover-quote"></span>');		$(this).find('span.hover-quote').html(hoverText);						var showDistance = 0;		var hideDistance = 10;	    var time = 250;	    var hideDelay = 70;	    var hideDelayTimer = null;	    var beingShown = false;	    var shown = false;	    var quote = $('span.hover-quote', this).css('opacity', 0);	    // set the mouseover and mouseout on both element	    $(this).parent('li').hover(function () {			// stops the hide event if we move from the trigger to the quote element			if (hideDelayTimer) 				clearTimeout(hideDelayTimer);			if (beingShown || shown) {				return;			} else {				beingShown = true;				// reset position of quote box				quote.css({ 					position: 'absolute', 					display: 'block'				}).animate({					top: showDistance,					opacity: 1				}, time, 'swing', function() {					beingShown = false;					shown = true;				});			}	    },function () {			// reset the timer if we get fired again - avoids double animations			if (hideDelayTimer) 				clearTimeout(hideDelayTimer);			hideDelayTimer = setTimeout(function () {				hideDelayTimer = null;				quote.animate({					top: hideDistance,					opacity: 0				}, time, 'swing', function () {					// once the animate is complete, set the tracker variables					shown = false;					quote.css({'display' : 'none', 'top' : hideDistance });				});			}, hideDelay);	    });	});});