// JS function for uncrypting spam-protected emails:
// characters are converted to ASCII numbers, 3 are substracted and this new
// number is then converted back to a character again

function UnCryptMailto(s) {
	var code   = 0;
	var result = "";
	for(var i=0; i<s.length; i++) {
		code=s.charCodeAt(i);
		if (code>=8364) {
			code = 128;
		}
		result += String.fromCharCode(code-3);
	}
	//alert(result);
	return result;
}

// JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s) {
	var result = UnCryptMailto(s);
	//alert(result);
	location.href = result;
}


function popup(PicHeight, PicWidth, ID) {
	var screen_height = screen.availHeight-100;
	var screen_width  = screen.availWidth;
	var balken        = "no";

	if (PicHeight > screen_height && PicWidth > screen_width) {
		//alert("1");
		PicHeight = screen_height-25;
		PicWidth  = screen_width-10;
		balken    = "yes";
	} else {
		if (PicHeight > screen_height) {
			//alert("2");
			PicHeight = screen_height-25;
			if (PicWidth < screen_width-16) PicWidth += 16;
			else PicWidth -= 10;
			balken    = "yes";
		} else if (PicWidth > screen_width) {
			//alert("3");
			PicWidth  = screen_width-10;
			if (PicHeight < screen_height-41) PicHeight += 16;
			else PicHeight -= 25
			balken = "yes";
		}
	}
	var temp = window.open("popup.php?data="+ID, "", "top=0, left=0, dependent=1, status=0, menubar=0, toolbar=0, height="+PicHeight+", width="+PicWidth+", resizable=1, scrollbars="+balken);
}


function hoehe() {
	var winHeight = document.body.clientHeight - 343;
	ContentMain.style.height = winHeight;
}
