
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto({
			slideshow: false, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: true, /* true/false */
			allow_resize: true, /* Resize the photos bigger than viewport. true/false */
			default_width: 500,
			default_height: 344,
			counter_separator_label: ' of ', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			horizontal_padding: 20, /* The padding on each side of the picture */
			deeplinking: false,
			overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
			keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
			changepicturecallback: function(){
				//alert((set_position+1));
				
				//alert(((set_position+1) / 20));
				
				var page = Math.ceil((set_position+1) / 20);
				
				var t_page = Math.ceil($(pp_images).size() / 20);
				
				//alert(t_page);
				
				$('#pages li a').each(function(index) {
					//alert(index + ': ' + $(this).text());
					$(this).removeClass('active');
					
				  });
				
				 $('.list_wrap div').each(function(index) {
					//alert(index + ': ' + $(this).text());
					$(this).removeClass('show');
					$(this).addClass('hide');
					
				  });
				 
				 
				 $('#btn_prev').removeClass('btn_prev_disable');
				  $('#btn_prev').removeClass('btn_prev');
				  
				  $('#btn_next').removeClass('btn_next_disable');
				  $('#btn_next').removeClass('btn_next');
				  
				  
				  if(page < t_page){
					$('#btn_next').addClass('btn_next');
				  }else{
					$('#btn_next').addClass('btn_next_disable');
				  }
				  
				  if(page > 1){
					$('#btn_prev').addClass('btn_prev');
				  }else{
					$('#btn_prev').addClass('btn_prev_disable');
				  }
				 
				 
				 
				 $('#p_' + page).addClass('active');
				  
				  $('#page' + page).removeClass('hide');
				  $('#page' + page).addClass('show');
				
				//setPage(page);
				curr_page = page;
				
				
				
			},
			markup: '<div class="pp_pic_holder"> \
						<div >&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"><div class="ppt"></div><a class="pp_close" href="#">Close</a></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details"> \
											<div class="pp_nav"> \
												<a href="#" id="btn_prev" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" id="btn_next" class="pp_arrow_next">Next</a> \
											</div> \
											<p class="pp_description"></p> \
											{pp_social} \
											 \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div>',
			gallery_markup: '<div class="pp_gallery"> \
								<a href="#" class="pp_arrow_previous">Previous</a> \
								<div> \
									<ul> \
										{gallery} \
									</ul> \
								</div> \
								<a href="#" class="pp_arrow_next">Next</a> \
							</div>',
			social_tools: false /* html or false to disable */
		});
	});

