function hideImprint() {
	$('info').hide();
}
function rs_LoadSlideShow() {
	var feed = "http://www.raggasuffin.de/rss.php";
	var options = {
		displayTime : 2000,
		transistionTime : 600,
		scaleImages : false,
		linkTarget : google.feeds.LINK_TARGET_SELF,
		numResults : 8
	};
	var ss = new GFslideShow(feed, "rs_slideshow", options);
}
function sf_LoadSlideShow() {
	var feed = "http://streetfiles.org/api/superfeed/";
	var options = {
		displayTime : 5000,
		transistionTime : 600,
		scaleImages : false,
		linkTarget : google.feeds.LINK_TARGET_SELF,
		numResults : 8,
		thumbnailUrlResolver : myUrlResolver
	};
	var ss = new GFslideShow(feed, "sf_slideshow", options);
}
function fl_LoadSlideShow() {
	var feed = "http://pipes.yahoo.com/pipes/pipe.run?_id=zrTFPaut3RGUx_no_g6H4A&_render=rss";
	var options = {
		displayTime : 5000,
		transistionTime : 600,
		scaleImages : false,
		linkTarget : google.feeds.LINK_TARGET_SELF,
		numResults : 8,
		thumbnailUrlResolver : myUrlResolver
	};
	var ss = new GFslideShow(feed, "fl_slideshow", options);
}
function LoadIssuuBar(m) {
	var feed = "http://search.issuu.com/api/1_0/generic?q=tag:" + m
			+ "&type=document&sort=created&reverse=yes";
	var options = {
		numResults : 10,
		scaleImages : true,
		thumbWidth : null,
		thumbHeight : 90,
		preferedImgType : null,
		linkTarget : '_blank',
		autoCleanup : true
	};
	var ytb = new IssuuBar(feed, "issuu", options);
}
// other:
// http://search.issuu.com/api/1_0/generic?q=tag:graffiti&type=document&sort=created
function gm_PixBar() {
	var feed = "http://search.issuu.com/graffiti-magazine/docs/recent.rss";
	var options = {
		numResults : 7,
		scaleImages : true,
		thumbnailSize : PixBar.THUMBNAILS_SMALL,
		thumbWidth : 70,
		thumbHeight : null,
		preferedImgType : null,
		linkTarget : '_blank',
		autoCleanup : true
	};
	var sfb = new PixBar(feed, "gm", options);
}
function myUrlResolver(entry) {
	var content = entry.content;
	var start = content.indexOf("src=") + 5;
	var stop = content.indexOf(".jpg") + 4;
	var thumburl = content.substring(start, stop);
	return (thumburl);
}
function LoadBlogWithThumb() {
	var sM = new Array()
	sM["graffiti-magazine"] = "graffiti-magazine.net";
	sM["berlinpiraten"] = "berlinpiraten.de";
	sM["suedappeal"] = "fashionkills.de";
	sM["streetfiles"] = "streetfiles.org";
	sM["graffitinews"] = "graffitinews.net";
	sM["hurtyoubad"] = "hurtyoubad.com";
	var options = {
		scaleImages : true,
		linkTarget : google.feeds.LINK_TARGET_BLANK,
		numResults : 7,
		sourceMap : sM
	};

	var feed = "http://pipes.yahoo.com/pipes/pipe.run?_id=8P7nRfuK3RG_Eh3ABR50VA&_render=rss";
	var ss = new BlogListWithThumbs(feed, 'pipe', options);
}
function getPix(jData) {
	if (jData == null) {
		alert("There was a problem parsing search results.");
		return;
	}
	var ff = new FlickrBar(jData, 'flickridoo');
}
function googleNews(m, container) {

	/*
	 * var searchControl = new google.search.SearchControl(false); // Add in a
	 * full set of searchers var options_blogs = new
	 * google.search.SearcherOptions();
	 * options_blogs.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	 * searchControl.addSearcher(new google.search.BlogSearch(),options_blogs);
	 * var options_news = new google.search.SearcherOptions();
	 * options_news.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	 * searchControl.addSearcher(new google.search.NewsSearch(),options_news); //
	 * tell the searcher to draw itself and tell it where to attach
	 * searchControl.draw(document.getElementById("googlenews")); // execute an
	 * inital search searchControl.execute("Graffiti");
	 */
	var searcher = new google.search.NewsSearch();
	searcher.setNoHtmlGeneration();
	searcher.execute(m);
	searcher.setSearchCompleteCallback(this, renderSearch, [ searcher,
			container ]);

}
function googleBlogs(m, container) {

	/*
	 * var searchControl = new google.search.SearchControl(false); // Add in a
	 * full set of searchers var options_blogs = new
	 * google.search.SearcherOptions();
	 * options_blogs.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	 * searchControl.addSearcher(new google.search.BlogSearch(),options_blogs);
	 * var options_news = new google.search.SearcherOptions();
	 * options_news.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
	 * searchControl.addSearcher(new google.search.NewsSearch(),options_news); //
	 * tell the searcher to draw itself and tell it where to attach
	 * searchControl.draw(document.getElementById("googlenews")); // execute an
	 * inital search searchControl.execute("Graffiti");
	 */
	var searcher = new google.search.BlogSearch();
	searcher.setNoHtmlGeneration();
	searcher.execute(m);
	searcher.setSearchCompleteCallback(this, renderSearch, [ searcher,
			container ]);

}
function renderSearch(searcher, container) {
	$(container).html('');
	var results = $(container);
	if (searcher.results && searcher.results.length > 0) {
		var div = createDiv("", "header");
		results.append(div);
		for ( var i = 0; i < searcher.results.length; i++) {
			var result = searcher.results[i];
			searcher.createResultHtml(result);
			if (result.html) {
				div = result.html.cloneNode(true);
			} else {
				div = createDiv("** failure to create html **");
			}
			results.append(div);
		}

	}
}

function createDiv(opt_text, opt_className) {
	var el = document.createElement("div");
	if (opt_text) {
		el.innerHTML = opt_text;
	}
	if (opt_className) {
		el.className = opt_className;
	}
	return el;
}

function inspect(obj, maxLevels, level) {
	var str = '', type, msg;

	// Start Input Validations
	// Don't touch, we start iterating at level zero
	if (level == null)
		level = 0;

	// At least you want to show the first level
	if (maxLevels == null)
		maxLevels = 1;
	if (maxLevels < 1)
		return '<font color="red">Error: Levels number must be > 0</font>';

	// We start with a non null object
	if (obj == null)
		return '<font color="red">Error: Object <b>NULL</b></font>';
	// End Input Validations

	// Each Iteration must be indented
	str += '<ul>';

	// Start iterations for all objects in obj
	for (property in obj) {
		try {
			// Show "property" and "type property"
			type = typeof (obj[property]);
			str += '<li>(' + type + ') ' + property
					+ ((obj[property] == null) ? (': <b>null</b>') : (''))
					+ '</li>';

			// We keep iterating if this property is an Object, non null
			// and we are inside the required number of levels
			if ((type == 'object') && (obj[property] != null)
					&& (level + 1 < maxLevels))
				str += inspect(obj[property], maxLevels, level + 1);
		} catch (err) {
			// Is there some properties in obj we can't access? Print it red.
			if (typeof (err) == 'string')
				msg = err;
			else if (err.message)
				msg = err.message;
			else if (err.description)
				msg = err.description;
			else
				msg = 'Unknown';

			str += '<li><font color="red">(Error) ' + property + ': ' + msg
					+ '</font></li>';
		}
	}

	// Close indent
	str += '</ul>';

	return str;
}
function bindAfterAjax(id) {
	//TODO if  $(this).find('div:first') = nich da
	//dann hide
	var ct = $("#"+id).children().size(); 
	if(ct <= 0){
		$("#"+id).height(20);
	}
	else{
		$("#"+id+" .divBar").hover(
				  function() {
					  $(this).find('div:first').removeClass().addClass('legendeshow');
				  },
				  function() {
					  $(this).find('div:first').removeClass().addClass('legendehidden');
					}	
		);
	}
}	