// SlideShow Effect On load Javascript
jQuery(document).ready(function() 
{
		/*$("#gallery_right").easySlider({
		controlsBefore:	'<p id="controls">',
		controlsAfter:	'</p>',
		auto: true, 
		continuous: true,
		speed: 800
		});*/
		
});

/*...............................................................................................
	Images slide show configuration
		all the elements specified should be given  
			eg if "slideShowHandlesContainer" is the id of the container then it should be given as #slideShowHandlesContainer
				if the same is class then it should be ".slideShowHandlesContainer" etc
 ................................................................................................*/
	
	imagesSlideShowHandlesContainer = 	".slider_bottom"; 
	imagesSlideShowLeftHandle 		=	".slider_bottom_left";
	imagesSlideShowRightHandle 		=	".slider_bottom_right";
	imagesSlideShowImagesContainer = 	".gallery_slideshow"; 
/*...............................................................................................
	Images slide show configuration
 ................................................................................................*/
//slider content images sliding function
jQuery(document).ready(function(){
	//counter to hold the current image
	currentSlideImagesCount = 0;
	//get all the images for slid show
	var $slidingImages = jQuery(imagesSlideShowImagesContainer+" img");
	//alert("length"+$slidingImages.length);
	//proceed only if the there are more than 1 image
	if($slidingImages.length>1){
		//hide all other images
		$slidingImages.css({"display":"none"});
		//get the first image being displayed
		$slidingImagesFirstImage = $slidingImages[currentSlideImagesCount];
		//at first hide the left button
		jQuery(imagesSlideShowLeftHandle).css({"display":"none"});
		//display the first image
		jQuery($slidingImagesFirstImage).css({"display":"block"});
		//handle the click on right handle
		jQuery(imagesSlideShowRightHandle).click(function(){
			//fadeout the current image
			jQuery($slidingImages[currentSlideImagesCount]).fadeOut("normal",function(){
				//increment the images array counter																	
				currentSlideImagesCount++;
				//show the next image
				jQuery($slidingImages[currentSlideImagesCount]).fadeIn("normal",function(){
					
					
					//show or hide the left and right handles
					if($slidingImages.length-1==currentSlideImagesCount){
						jQuery(imagesSlideShowRightHandle).css({"display":"none"},"normal");
					}
					else{
						jQuery(imagesSlideShowRightHandle).css({"display":"block"});
					}
					
					jQuery(imagesSlideShowLeftHandle).css({"display":"block"});
					
					
					
				});
			});
		}); //end of handle the click on right handle
		
		//handle the click on left handle
		jQuery(imagesSlideShowLeftHandle).click(function(){
			//hide the current image
			jQuery($slidingImages[currentSlideImagesCount]).fadeOut("normal",function(){
				//decrement the counter
				currentSlideImagesCount--;
				//show the previous image
				jQuery($slidingImages[currentSlideImagesCount]).fadeIn("normal",function(){
					
					
					//show or hide the left and right handles
					if(currentSlideImagesCount==0){
						jQuery(imagesSlideShowLeftHandle).css({"display":"none"},"normal");
					}
					else{
						jQuery(imagesSlideShowLeftHandle).css({"display":"block"});
					}
					
					jQuery(imagesSlideShowRightHandle).css({"display":"block"});
					
				});
			});
		}); //end of handle the click on left handle
		
	} //if($slidingImages.length>1){
	//hide scrolling buttons
	else{
		jQuery(imagesSlideShowHandlesContainer).css({"display":"none"});
	}
});
	

