// JavaScript Document
$(document).ready(function(){
	
	$("#left-menu li").hover(function(){
			
			$(this).find('.left-more-arrow').css({'background-image' : 'url(images/left-over-menu-left.png)'});
			
			$(this).find('.left-drop-menu').show();
									  
	}, function(){
	
			$(this).find('.left-more-arrow').css({'background-image' : 'url(images/left-over-menu-left-or.png)'});
			
			$(this).find('.left-drop-menu').hide();
	});
						   
						   
});


/////////  Main Slide Show -----------------------------------------------------Slide Show

function slideSwitch(slideTo) {
	
	
    var $active = $('#slideshow div.active');

    if ( $active.length == 0 ) $active = $('#slideshow .slides:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow .slides:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );
	

    $active.addClass('last-active');
	
	// added “slideTo” variable to allow transition to a selected slide
// defaults to null, but if it’s >= 0, it will use this index for “$next”
		var slideTo = ( slideTo+1 )? slideTo : null;
		if ( slideTo != null ) $next = $('#slideshow .slides').eq(slideTo);
		
		
    	$next.css({opacity: 0.0})
		
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
					
		
		//$('.slide-button').find('img').removeClass('brdr');
		// $('.slide-button').find('img').eq(intex).addClass('brdr');
		$active.removeClass('active last-active');
        });
		
	//	thumb nail Border animation
					var intex = $('#slideshow .slides').index($next);
											
					$('.slide-button').removeClass('active');
					
					$('.slide-button').eq(intex).addClass('active');

}



$(document).ready(function(){
						   
						   $("#slideshow div").css({opacity: 0.0});
							$("#slideshow div:first").css({opacity: 1.0});
							
							$('.slide-button').eq(0).addClass('active');
							
							var playSlideshow = setInterval( "slideSwitch()", 3000 );
							
							// create buttons to move to specific slide
							var $slideButtons = $("#slide-buttons .slide-button");
							$slideButtons.click(function(){
							// stop the slideshow, to keep it from trying to overlap our transition
							clearInterval(playSlideshow);
							// call the function using the index of the clicked button
							var tst=$slideButtons.index(this);
							
							
							slideSwitch(tst);
							// restart the slideshow
							setTimeout( playSlideshow = setInterval( "slideSwitch()", 3000 ), 3000);
							});
							
							
							 $('#slideshow').hover(function() {
    clearInterval(playSlideshow);},
	function() {
    playSlideshow =  setInterval( "slideSwitch()", 3000 );
		});
						   
						   });


//--------------------------------------------------------------------------------------------------------------------------------------------

//----------------Photo Gallery Tabs--------------------------------------------


$(document).ready(function(){
						   
						   
		// Video Gallery Tab click				   
		$('#video-btn').click(function(){
									   
			$(this).addClass('active');
			$(this).removeClass('normal');
			
			$('#photo-btn').removeClass('active');
			$('#photo-btn').addClass('normal');
			
			$('#video-gall').show();
			
			$('#photo-gall').hide();
		
		});
		
		//Photo Gallery Tab Click
		$('#photo-btn').click(function(){
									   
			$(this).addClass('active');
			$(this).removeClass('normal');
			
			$('#video-btn').removeClass('active');
			$('#video-btn').addClass('normal');
			
			$('#photo-gall').show();
			
			$('#video-gall').hide();
		
		});


})


//  Business directory Review 

$(document).ready(function(){

	$("#quick-review").hide();
	$("#quick-enquiry").hide();
	$("#send-friend").hide();
	
	$('#review-btn').click(function(){  // review show
		$("#quick-enquiry").slideUp(500);
		$("#send-friend").slideUp(500);
		$("#quick-review").slideDown(500);
	});
	
	$('#enquire-now-btn').click(function(){ // enquire show
		$("#quick-review").slideUp(500);
		$("#send-friend").slideUp(500);
		$("#quick-enquiry").slideDown(500);
	});
	
	$('#send-friend-btn').click(function(){ // send a friend show
		$("#quick-enquiry").slideUp(500);
		$("#quick-review").slideUp(500);
		$("#send-friend").slideDown(500);
	});
	
	$('.close-btn-small').click(function(){
		
		$(this).parent('div').slideUp();
		
	});
						   
})

