var currentSlide = 1;jQuery().ready( function( $ ) {		slides = $("#reviewcycle #tier");		// loop every 7 seconds	setInterval( function() { $("#cyclenav a.next").click(); }, 7000 );		//clicks	$("#cyclenav ul li a").click( function( e ) {		e.preventDefault();		carasel_scroll( $(this).attr("rel") );	});		$("#cyclenav a.previous").click( function( e ) {		e.preventDefault();		if( currentSlide == 1 )			carasel_scroll(4);		else			carasel_scroll( currentSlide - 1 );	});		$("#cyclenav a.next").click( function( e ) {		e.preventDefault();		if( currentSlide == 4 )			carasel_scroll(1);		else			carasel_scroll( currentSlide + 1 );	});		function carasel_scroll( position ) {		currentSlide = Number(position);		$( ".slides" ).stop();		$(".slides").animate( {			left: '-' + ( (1000 * Number(position)) - 1000 ) + 'px'			},		 400 );		 $("#cyclenav ul li a").removeClass("active");		 $("#cyclenav ul li a[rel='" + currentSlide + "']").addClass("active");	}		// sub cat	currentCat = 1;	$( ".rblock .item .direct.prev" ).click( function(e) {		e.preventDefault();		if( $(this).closest(".rblock").hasClass("cat") )			currentCat = rblock_scroll( $(this).closest(".rblock"), currentCat - 1 )	});		$( ".rblock .item .direct.more" ).click( function(e) {		e.preventDefault();		if( $(this).closest(".rblock").hasClass("cat") )			currentCat = rblock_scroll( $(this).closest(".rblock"), currentCat + 1 )	});		//manufacturers	currentMan = 1;	$( ".rblock .item .direct.prev" ).click( function(e) {		e.preventDefault();		if( $(this).closest(".rblock").hasClass("manuf") )			currentMan = rblock_scroll( $(this).closest(".rblock"), currentMan - 1 )	});		$( ".rblock .item .direct.more" ).click( function(e) {		e.preventDefault();		if( $(this).closest(".rblock").hasClass("manuf") )			currentMan = rblock_scroll( $(this).closest(".rblock"), currentMan + 1 )	});		function rblock_scroll( rblock, number ) {		if( number == 0 )			return 0;		if ( number > ( Math.round($(rblock).find("ul").length / 2) ) )			return number - 1;						$(rblock).find(".uls").stop();					$(rblock).find(".uls").animate( {			left: '-' + ( (336 * number) - 336 ) + 'px'			},		 400 );				// hide arrows if need be		if( number == 1 ) {			$(rblock).find( '.direct.prev' ).hide();		} else{			$(rblock).find( '.direct.prev' ).show();		}						if( number >= ( Math.round($(rblock).find("ul").length / 2) ) ) {			$(rblock).find( '.direct.more' ).hide();		} else {			$(rblock).find( '.direct.more' ).show();		}				return number;	} 	// single	$( "#revthumbs img" ).hover( function() {			$("#revhigh .img img").attr("src", $(this).attr("rel"));			$("#revhigh .img").append("<div class='loading'></div>");			$("#revhigh .img img").ready( function() {				$("#revhigh .loading").remove();			});		},		function() {				} 	);	});jQuery( "#revthumbs" ).ready( function($) {$('#revthumbs a[rel=lightbox]').lightBox( {		imageLoading: themeURL + '/media/base/images/lightbox-ico-loading.gif',		imageBtnClose: themeURL + '/media/base/images/lightbox-btn-close.gif',		imageBtnPrev: themeURL + '/media/base/images/lightbox-btn-prev.gif',		imageBtnNext: themeURL + '/media/base/images/lightbox-btn-next.gif',	}); // Select all links that contains lightbox in the attribute rel});//User review helpfuljQuery( "#comments" ).ready( function($) {	$(".user-review .user-review-helpful a").live( 'click', function(e) {		e.preventDefault();		a = $(this);		$.ajax({		    type: "GET",		    url: themeURL + '/ajax-actions.php',		    		    data: ({ comment_id: $(this).closest(".user-review-helpful").attr("rel"), action: 'rate_user_review', value: $(this).attr("rel") }),		    success: function( data ){		    	$(a).closest(".user-review-rating").html(data);		    }		});	});});