Ext.namespace('fenceco','fenceco.public');

fenceco.public.gallery = function() {

    var init = function( group ) {

		Ext.ux.Lightbox.register( 'a.' + group , true ); 
		
		new Ext.ux.Carousel('entryfenceimage', {
            itemSelector: 'img',
            interval: 5,
        	transitionEasing: 'easeIn'  ,
        	autoPlay: true,
            showPlayButton: true,
            pauseOnNavigate: true,
            freezeOnHover: true,
            navigationOnHover: true              
    	});
	}
	
	var select = function( groupId , pageNum ) {

		if( typeof pageNum == 'undefined' ) {
			
			pageNum = 1;
		}
		
	    window.location = 'gallery.php?galleryid=' + groupId + '&pagenum=' + pageNum;
	}

    return {
    
        init : function( group ) {
        
            init( group );
        },
        
        select : function( id , num ) {
        
            select( id , num );
        }
    }
}();