jQuery(document).ready(function()
{
	
	// img mit anker element wrappen
	jQuery("#promiPictures img").wrap("<a rel='lightbox-promis'></a>");

	// span element nach img element einfuegen
	jQuery("#promiPictures a img").after("<span>&nbsp;</span>");

	// span element mit title-attribut des img elementes befuellen
	jQuery("#promiPictures a").each(function(i){
		var pt = jQuery(this).children("img").attr("title");
		jQuery(this).children("span").html(pt);
	});

	// anker title-attribut setzen
	jQuery("#promiPictures a").each(function(i){
		var pa = jQuery(this).children("img").attr("alt");
		jQuery(this).attr("title",pa);
	});

	// scr-attribut des img elementes dem href-attribut des ankers uebergeben
	jQuery("#promiPictures a").each(function(i){
		var pl = jQuery(this).children("img").attr("src");
		var _source = pl.split("/");
		var _file = _source[3].substr(6);
		var source = "/" + _source[0] + "/" + _source[1] + "/" + _source[2] + "/" + _file;
		jQuery(this).attr("href",source);
	});

	// anker mit li element wrappen
	jQuery("#promiPictures a").wrap("<li></li>");
	
	// slimbox initiieren
	jQuery("a[rel^='lightbox']").slimbox({},null,function(el) {
		return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
	});

});
