	var imageTextObject;
	var showCaseSlider;
	var t;
	var direction = ".buttonPrevShowCase";

$(document).ready(function() {
		
		showCaseSlider = ($("#jCarouselLiteShowcase li").length < 5) ? false : true ;
		showcaseTimer();
		hideNextPrevSliders();
		
		if($("#jCarouselLiteShowcase li").length > 5) {
			$('#jCarouselLiteShowcase ul').css('display', 'block');
				$("#jCarouselLiteShowcase").jCarouselLite({
				btnNext: ".buttonPrevShowCase",
				btnPrev: ".buttonNextShowCase",
				visible: 5,
				circular: true,
				start: 0,
				speed : 1000
			});
		}
		
		if ($("#jCarouselLiteSearch li").length > 6) {
			$('#jCarouselLiteSearch ul').css('display', 'block');
				$("#jCarouselLiteSearch").jCarouselLite({
				btnNext: ".buttonPrevSearch",
				btnPrev: ".buttonNextSearch",
				visible:6,
				circular: true,
				start: 0
			});
		}
		$("input[name='typeSelector']").click(function() {
			var selectedValue = $(this).val();
			$('#type').val(selectedValue);
		});
		
		$(".buttonNextShowCase").click(function () {
			direction = ".buttonNextShowCase";
		});
		
		$(".buttonPrevShowCase").click(function () {
			direction = ".buttonPrevShowCase";			
		});
		
		
		$('#jCarouselLiteShowcase img').hover(function(){
			clearTimeout(t);
		},function() { t=setTimeout("showcaseTimer()",1000);}
		);
			
		$("#imageClone").mouseout(function() {
			$("#imageDiv").css("display","none");
			t=setTimeout("showcaseTimer()",1000);			
		});
		if ($('ul#featureList').children().length > 1){
			$('ul#featureList').innerfade({
				speed: 'slow',
				timeout: 4000,
				type: 'sequence',
				containerheight: 'auto'
			});
		}
		//$('ul#featureList').children().css('display', 'block');
		
		//this code to delete border for ie6
		var isMSIE6 = $.browser.msie && /MSIE 6\.0/i.test(window.navigator.userAgent) && !/MSIE 7\.0/i.test(window.navigator.userAgent);
		var heightAttr = $(".imgwrapper img").attr("height");
		var widthAttr = $(".imgwrapper img").attr("width");

		if (isMSIE6 && $('ul.venueSquareItem').size() ) {
			$(".imgwrapper img").css("height", heightAttr - 1);
			$(".imgwrapper img").css("width", widthAttr - 2);		
		}
	});
	function showcaseTimer() {
		 if (showCaseSlider == false)
			return;
		rotateSlider(direction);
		t=setTimeout("showcaseTimer()",5000);
	}
	
	function rotateSlider(rotation) {
		$(rotation).click();
	}
	
	function hideNextPrevSliders() {
		if ($("#jCarouselLiteSearch li").length < 5)  {
			if ($("img").hasClass("mensButtonNextSearch")){
				$("img.mensButtonNextSearch").attr("src","http://image.confetti.co.uk/i/confettiV2Assets/showcases/showcase-arrow-blank.png").addClass("mensButtonNextSearchEmpty").removeClass("mensButtonNextSearch");
			}
			else {
				$("img.buttonNextSearch").attr("src","http://image.confetti.co.uk/i/confettiV2Assets/showcases/showcase-arrow-blank.png").addClass("buttonNextSearchEmpty").removeClass("buttonNextSearch");
				}
			$("img.buttonPrevSearch").attr("src","http://image.confetti.co.uk/i/confettiV2Assets/showcases/showcase-arrow-blank.png").addClass("buttonPrevSearchEmpty").removeClass("buttonPrevSearch");
		}
		
		if ($("#jCarouselLiteShowcase li").length < 5)  {
			$("img.buttonPrevShowCase").attr("src","http://image.confetti.co.uk/i/confettiV2Assets/showcases/showcase-arrow-blank.png").addClass("buttonPrevShowcaseEmpty").removeClass("buttonPrevShowCase");
			$("img.buttonNextShowCase").attr("src","http://image.confetti.co.uk/i/confettiV2Assets/showcases/showcase-arrow-blank.png").addClass("buttonNextShowcaseEmpty").removeClass("buttonNextShowCase");
		}
	}

