$(function() {
	$('img').noContext();
	$('#topsearchinput').example('Search keyword...');
	
	$('a.clueTip').cluetip({
		arrows: true,
		clickThrough: false		
	});
	
	$('.seocart_Product #mainImage').after('<span class="clickToEnlarge">Click Image Above To Enlarge</span>');
	
	/*$('.seocart_Subcategory .item .itemimage, .seocart_Category .item .itemimage').hover(
		function() { 
			var $item = $(this).closest('.item');
			var $largeimage = $item.next('.itemlargeimage');
			if ($largeimage) {
				
				// get large image src, width, height
				var largeimagesrc = $('input[name="largeimagesrc"]',$largeimage).val();
				var largeimagewidth = new Number($('input[name="largeimagewidth"]',$largeimage).val());
				var largeimageheight = new Number($('input[name="largeimageheight"]',$largeimage).val());
				
				if (largeimagesrc != "") {
					$largeimage.css({
						'left': $item.position().left + 105,
						'top': $item.position().top
					}).show();
					
					// show loading image
					$largeimage.prepend('<div class="loadingAnimation"><img src="/cirkuit/includes/images/loadingAnimations/circular.gif" width="16" height="16" border="0" alt="loading"></div>');
					
					// load image
					var watchImage = new Image(largeimagewidth,largeimageheight);
					watchImage.src = '/'+largeimagesrc;

					// remove loading image
					$('.loadingAnimation',$largeimage).remove();
					
					// show large image
					$largeimage.prepend(watchImage);
				}
				else {
					$largeimage.css({
						'left': $item.position().left + 105,
						'top': $item.position().top
					}).show();
				}				
				
			}
			if (console && console.log) {
				console.log('over: ',$item.position(),$item.next('.itemlargeimage'));
			}
		},
		function() { 
			var $item = $(this).closest('.item');
			var $largeimage = $item.next('.itemlargeimage');
	
			if ($largeimage) {
				$('img',$largeimage).remove();
				$largeimage.hide();
			}
		}	
	);*/
	
	/*var testimonialSlider = $('div.testimonialsSlider');
	if (testimonialSlider.length > 0) {
		$(testimonialSlider).cycle({
			fx: 'fade',
			speed: 1400
		});
	}*/
	
	var scrollTop = $("#BackToTop");
	if (scrollTop) {
		$(scrollTop).hide().removeAttr("href");
		$(window).scrollTop() > 400 && $(scrollTop).fadeIn("slow");
		$(window).scroll(function(){
			$(window).scrollTop() > 400 ? $(scrollTop).fadeIn("slow") : $(scrollTop).fadeOut("slow")
		});
		$(scrollTop).click(function(){
			$("html, body").animate({
				scrollTop: "0px"
			}, 400)
		});
	}
});
