// JS function for uncrypting spam-protected emails:
function unCryptMailto(s) {
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-1);
	}
	return r;
}

// JS function for uncrypting spam-protected emails:
function linkTo_unCryptMailto(s) {
	location.href=unCryptMailto(s);
}

// JavaScript Document
$(document).ready( function(){
	//Input-Felder: Bei :focus den default-Eintrag "suchen"/"search" automatisch löschen
	var defaultValue = $("input.input_text").attr("value");			
	$("input.input_text").bind("focus", function(){
		if($(this).attr("value") == defaultValue) {
			$(this).attr("value", "");
		}
	});
	
	//mehrspaltige Listen
	$(".list_cols").each(function(i) {
		$(this).addClass("border_bottom");
		var contentWidth = $($("h1").parent()).attr("class");
		var cols = parseInt (contentWidth.split("-")[1]);
		var ele = $(this).children().length - 1;
		$(this).children().each(function(j) {
			if(j%cols == cols-1) {
				$(this).addClass("right");					
			} else if(j%cols == cols-2 && cols > 2) {
				$(this).addClass("middle");	
			} else {
				$(this).addClass("left");	
				if(j ==  ele) {
					$(this).addClass("full");						
				}
			}
			if(j < cols) {
				$(this).addClass("first");
			}
		});
	});
	
	
});

