// JavaScript Document
var gallery = {
	lightBoxConfig: {			
		fixedNavigation:true,
		imageLoading:			'public/css/lightbox/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
		imageBtnPrev:			'public/css/lightbox/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
		imageBtnNext:			'public/css/lightbox/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
		imageBtnClose:			'public/css/lightbox/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
		imageBlank:				'public/css/lightbox/images/lightbox-blank.gif'
	},
	
	init: function( )
	{
		$('.gallery').each(function(){
			gallery.view( this.id.toString().replace('gallery_',''));
		});
	},
	
	
	view: function( id ){
		$.get(baseUrl+ 'gallery/' + id , {},function(d){
			if( d.error == '0'){
				$('#gallery_' + id).html(d.content);
				//$('#gallery_' + id + ' a').lightBox(gallery.lightBoxConfig);
				// $('#gallery_' + id + ' a').colorbox({'slideshow':true  });
				$('#gallery_' + id + ' a').fancybox({
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'titlePosition' 	: 'over'
				});
				 layout.resizeTimer  = setTimeout( layout.resize , 1000 );

			}
		},'json');
	}
}

$(document).ready(function(){
	gallery.init();
});
