$(document).ready(function() {
	
	$(".neverEmpty").neverEmpty();
	$("#sprache_waehlen").change(function() {
		$(this).parents("form").submit();
	});
	$(".lightbox").colorbox({
		opacity: 0.60
	});
	
	$(".referenz").each(function() {
		var rel = $(this).find("a.gallery").attr("rel")
		$(this).find(".expand").click(function(e) {
			$(this).prev().trigger("click");
			e.preventDefault();
		})
		$("a[rel='"+rel+"']").colorbox({
			opacity: 0.60,
			slideshowStart: "",
			slideshowStop: "",
			current: ""
		});
	});
	
	$(".produkt_details .c240pxl a:eq(1)").click(function(e) {
		$(".produkt_details .c240pxl a:first").trigger("click");
		e.preventDefault();
	});
	
	$(".ebene1").children("li").each(function(i){
		if($(this).hasClass("active") == false || $(this).children().length > 1) { 
			$(this).mouseenter(function(e) {
				$(this).data("sc",$(this).attr("class"));
				$(this).removeAttr("class");
				$(this).addClass("sfhover");
				if ($.browser.version < 7.0 )  {
					$("select[name=Farbe]").css("visibility","hidden");
				}
			});
			$(this).mouseleave(function(e) {
				$(this).removeAttr("class");
				$(this).attr("class"," ");
				$(this).removeClass("sfhover");
				if ($.browser.version < 7.0 )  {
					$("select[name=Farbe]").css("visibility","visible");
				}
			});
		}
	});
	
    if ($.browser.msie && $.browser.version < 8.0 && $.browser.version > 6.0 )  {
		$().bind('cbox_closed',function(){
			$('#cboxOverlay, #colorbox').remove();
			setTimeout(function(){
				$.fn.colorbox.init();
			}, 1000); 
		});
	} 

	
});7
