//jQuery Start
jQuery(function($) {
	
	$("div#frame").each(function(){
		var check = $(this).attr("column");
		if (typeof check !== 'undefined' && check !== false) {
			check = Math.round(check);
			$("#content", this).css("width", ((check*16)+check-1)+"em");
		}
	});
	
	$("div#screen").each(function(){
		$("div#frame").css("overflow-x","hidden");
	});
	
	$("div.text.error").each(function(){
		$("form#kontakt").parents("div.columnContainer:first").each(function(){
			$("span.title", this).css({"border-bottom":"1px #333 solid"});
			if ($("span.hideText", this).length > 0) {
				$("span.hideText", this).css({"display":"block"});
			}
		});
	});
	
	$("div.text.success").each(function(){
		$(this).parents("div.columnContainer:first").each(function(){
			$("span.title", this).css({"border-bottom":"1px #333 solid"});
			if ($("span.hideText", this).length > 0) {
				$("span.hideText", this).css({"display":"block"});
			}
		});
	});
	
	
	$("div.columnContainer ul").mouseenter(function(){
		$("li.icon img.iconHoverImage", this).css({"display":"block", "margin-top": "-9999em"});
		var heightIconHover = $("li.icon img.iconHoverImage", this).height();
		var widthIconHover = $("li.icon img.iconHoverImage", this).width();
		var heightIcon = $("li.icon img.iconImage", this).height();
		var widthIcon = $("li.icon img.iconImage", this).width();
		var marginTop = (heightIcon-heightIconHover)/2+"px";
		var marginLeft = (widthIcon-widthIconHover)/2+"px";
		$("li.icon img.iconHoverImage", this).css({"margin-top": marginTop, "margin-left": marginLeft});
	}).mouseleave(function(){
		$("li.icon img.iconHoverImage", this).css({"display":"none"});
	}).click(function(){
		var href= $("li.link a", this).attr("href");
		if ((typeof href != "undefined") && href != "" ) {
			window.location.href = href;
		 }
	});
	
	$(".public div.row:first-child span.column").mouseenter(function(){
		$("span.title", this).css({"border-bottom":"1px #333 solid"});
		if ($("span.hideText", this).length > 0) {
			$("span.hideText", this).css({"display":"block"});
		}
	}).mouseleave(function(){
		$("span.title", this).css({"border-bottom":"0px #333 solid"});
		if ($("span.hideText", this).length > 0) {
			$("span.hideText", this).css({"display":"none"});
		}
	});
	

	
});




