function img2bg() {
	var container = $("glider");
	// Images aus Glider holen
	var my_imgs = container.select(".csc-textpic-image img");
	// Image Pfade holen
	my_imgs.each(function(e){
		var my_imgsrc = e.src;
		var imgwrap = e.up(2);
		var section = e.up(4);
		
		var check = e.up();
		if (check.inspect() == "<a>") 
		{
			var link = e.up().href;
			section.setStyle({
				cursor: 'pointer'
			});
			section.onclick = function(){
				//window.open.location.href= link;
				window.open(link);
			}
			
			var imgwrap = e.up(3);
			var section = e.up(5);
		}

		// Section den Hintergrund zuweisen
		section.setStyle({
			background: 'url(' + my_imgsrc +') no-repeat 100% 0'
		});

		// Bildcontainer entfernen
		imgwrap.remove();
			
	});
}

function languageselect(){
	var trigger = $('language-navigation').up();
	trigger.onmouseover = function(){
		this.addClassName("over");
	}
	trigger.onmouseout = function(){
		this.removeClassName("over");
	}
}

function init() {
	var home = $("home");
	if ( home ) {
		img2bg();
	}
	languageselect();
}
document.observe("dom:loaded", function() {
	init();
});
