/**
 * Byond gallery plugin
 * Usage: jQuery('#test').byondGallery(type, id);
 */
(function($)
{
    /**
     * @param {String} type
     * @param {String} elId - UL element id attribute value 
     */
    $.fn.byondGallery = function(type, elId)
    {
    	// Note: Default style is hidden
    	var el = $('#' + elId);
    	
    	switch(type) {
		    case 'list':
		    	// Show all
		    	el.show();
		    	break;
		    case 'scrollLeft': case 'shuffle':
		    	// More available: blindX, blindY, blindZ, cover, curtainX, curtainY, fade, fadeZoom, growX, 
		    	//growY, none, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz, scrollVert, shuffle, 
		    	//slideX, slideY, toss, turnUp, turnDow, turnLeft, turnRight, uncover, wipe, zoom, fade

		    	// Show all - but slide one in at a time
		    	el.show().cycle({
		    		fx: type // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		    	});
		    	break;
    		case 'random':
    			var randNum = Math.floor(Math.random()*el.children().length+1);
    			el.children().each(function(i) {
    				$(this).toggle(i+1 == randNum);
    				el.show();
    			});
	    		break;
    	}
    };
})(jQuery);

