if(top.frames.length > 0)
{
top.location.href = self.location;
}

$(document).ready(function() {
$('a[rel^="lightbox"]').fancybox({
				'titlePosition' 	: 'over',
				'centerOnScroll': true,
				'overlayColor' : '#000',
				'overlayOpacity': 0.9,
				'margin': 10,
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			$('.entry img').css('max-width',$('.entry').css('width'));
			$('.entrytext img').css('max-width',$('.entrytext').css('width'));
});
$(window).resize(function() {
			$('.entry img').css('max-width',$('.entry').css('width'));
			$('.entrytext img').css('max-width',$('.entrytext').css('width'));
});
function formatItem(row) {
//	return "<i>" + row[1] + "</i> | " + row[0] + "";
	return "" + row[1] + "";
}
$(document).ready(function() {
	$("#searchbox").autocomplete("http://www.mega-on.net/wp/wp-content/themes/my_wp-andreas09//autocomplete.php", { 
		minChars:2, 
		matchSubset:1, 
		matchContains:1, 
		cacheLength:1, 
		max:15,
    	formatItem:formatItem, 
		selectOnly:1,
		selectFirst:false,
		scroll:false
	});
	
$("#searchbox").autocomplete().result(function(){
$("#searchform").submit();
$("#content").html('<h2>Laden ...</h2>');
 });

});

