/**
* @file
* @brief    sigplus Image Gallery Plus initialization for Slimbox2
* @author   Levente Hunyadi
* @version  1.2
* @remarks  Copyright (C) 2009-2010 Levente Hunyadi
* @remarks  Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
* @see      http://hunyadi.info.hu/projects/sigplus
*/

jQuery(document).ready(function($) {
	$("a[rel^='lightbox']").slimbox(
		// options
		{},
		// link mapper
		function(el) {
			var span = $('span[title]', el);
			var image = $('img', el);
			if (span) {
				return [$(el).attr('href'), $(span).attr('title')];
			} else if (image) {
				return [$(el).attr('href'), $(image).attr('title')];
			} else {
				return [$(el).attr('href'), $(el).attr('title')];
			}
		},
		// link filter
		function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		}
	);
});
