/**
 * global.js
 * base stuff for kinderfesthomberg.de
 * @autor np
 * @date 2011-04-08 
 */

function setupGallery() {
	/** first of all check for a gallery */
	if( $('#imagegallery').length==0) {
		return
	}
	$('#imagegallery').jcarousel({
		initCallback:function(obj,state) {
			obj.container.after( $('#galleryimage-wrapper') );
			obj.container.removeClass('imagegallery-noscript');
			
			/** setup click-event on a-tag */
			obj.container.find('a').click( function() {
				$('#galleryimage-image').attr('src', $(this).attr('rel') );
				return false;
			});
		},
		wrap:'circular',
		scroll:6
	});
}

jQuery(document).ready(function() {
	setupGallery();
});

