// JavaScript Document
function CryptMailto() {
	shift = parseInt(document.forms[0].shiftField.value);
	var n=0;
	var r="";
	var s="mailto:"+document.forms[0].emailField.value;
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n+shift); 
	}
	document.forms[0].cyptedEmailField.value = r;
	document.forms[0].HTMLCyptedEmailField.value = "<a href=\"javascript:linkTo_UnCryptMailto('"+r+"', "+shift+");\">eMail-Link</a>";
}

function UnCryptMailto(s, shift) {
	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-(shift)); 
	}
	return r;
}

function linkTo_UnCryptMailto(s, shift)	{
	location.href=UnCryptMailto(s, shift);
}

function open_awb (){
	awbbox = document.getElementById("awb");
	awbbox.style.display = "block";
	awblinkopen = document.getElementById("awb_open");
	awblinkopen.style.display = "none";
	awblinkclose = document.getElementById("awb_close");
	awblinkclose.style.display = "block";
}

function close_awb (){
	awbbox = document.getElementById("awb");
	awbbox.style.display = "none";
	awblinkopen = document.getElementById("awb_open");
	awblinkopen.style.display = "block";
	awblinkclose = document.getElementById("awb_close");
	awblinkclose.style.display = "none";
}

tt = null;
document.onmousemove = updateTT;

function updateTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (tt != null) {
		tt.style.left = (x) + "px";
		tt.style.top 	= (90) + "px";
	}
}

function showArrow() {
	tt = document.getElementById("pfeil");
	tt.style.display = "block";
}	

function hideArrow() {
	tt.style.display = "none";
}

function openWin(url, w, h) {
	var windowName = "popupDialog";
	var properties = "dependent=yes, status=no, menubar=yes, scrollbars=yes, height="+h+", width="+w+", left=0, top=0, location=no";
	popupWindow = window.open(url, windowName, properties);
	popupWindow.focus();
}

function showLogin (){
	loginbox = document.getElementById("loginScreen");
	loginbox.style.display = "block";
}

function hideLogin (){
	loginbox = document.getElementById("loginScreen");
	loginbox.style.display = "none";
}
