function resizeContentFrame(contentFrame)
{
	var newHeight = contentFrame.contentWindow.document.body.offsetHeight + 10;// + 35;
	contentFrame.height = newHeight;
	
	var frameUri = contentFrame.contentWindow.document.URL;
	if(frameUri.lastIndexOf("galerie.html") > -1)
		initSlimbox(contentFrame.contentWindow.document);
}

function initSlimbox(document)
{	
	$("a[rel^='lightbox']", document).slimbox({counterText: "Bild {x} von {y}"}, function(el) {
		return [el.href, el.getAttribute('slimboxdesc')];
	}, null);
}

function initTooltip()
{
	// Copy 'slimboxdesc' attribute content to 'title' attribute for each link in the document.
	$.each($('a'), function(i, el){ el.setAttribute('title', el.getAttribute('slimboxdesc')) });
	
	// Init tooltip plugin
	$('a').tooltip({ 
	    track: true, 
	    delay: 0, 
	    showURL: false, 
	    showBody: " - ", 
	    fade: 250 
	});
}
