function showPopup(popupname,additional) {
	
	var width = 469;
	switch(popupname) {
		case "siedler":
			popupname="download_siedler";
			var height = 570;
			break;
		case "siedler7":
			popupname="download_siedler";
			var height = 570;
			break;
		case "code":
			var height = 450;
			break;
		case "umfrage":
			var height = 510;
			break;
		case "unilever":
			var height = 400;
			width = 460;
			break;
		case "impressum":
			var height = 695;
			break;
		case "datenschutz":
			var height = 610;
			break;
		case "nutzungsbedingungen":
			var height = 610;
			break;
		case "suche":
			var height = 600;
			break;
		case "klarmobil_teilnahmebedingungen":
			var height = 480;
			break;
		case "datenschutzmail":
			var height = 380;
			break;
		case "mitpfannizumammi_teilnahmebedingungen":
		    var height = 600;
			break;
		case "tefal_teilnahmebedingungen":
			var height = 420;
			break;

        case "newsletter":
            var height = 610;
            width = 520;
            break;	
		
		// Standardgr&ouml;&szlig;e
		default:
			var height = 500;
		    break;
    }
    if (popupname == "newsletter") {
        if (additional != "") {
            popup = window.open("/de/" + popupname + ".asp?"+additional, popupname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizeable=yes");
        } else {
            popup = window.open("/de/" + popupname + ".asp", popupname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizeable=yes");
        }
    } else {
        popup = window.open('/de/' + popupname + '.asp', popupname, 'width=' + width + ',height=' + height + ',scrollbars=no,resizeable=yes');
    }
	
	popup.focus();
}

function executeShowPopup(popupname, url, width, height) {
	popup = window.open("/de/" + url, popupname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizeable=yes");
	popup.focus();
}
function openInParent(url) {
	window.opener.location.href = url;
	window.close();
}

function setblurtoallas() {
    if(document.getElementsByTagName) {
        as = document.getElementsByTagName("a");
        l = as.length;
        for(i=0; i < l; i++) {
            as[i].onfocus = _blur;
        }
    }
}

function _blur() {
    this.blur();
}

function followLink(url, openNewWindow) {
	if(navigator.appName.indexOf("Explorer") == -1) {
		return;
	}
	if(openNewWindow) {
		window.open(url);
	} else {
		location.href = url;

    }
}

function decryptCharcode(n, start, end, offset) {
	n = n + offset;
	if (offset > 0 && n > end)	{
		n = start + (n - end - 1);
	} else if (offset < 0 && n < start)	{
		n = end - (start - n - 1);
	}
	return String.fromCharCode(n);
}
	
function decryptString(enc, offset) {
	var dec = "";
	var len = enc.length;
	for(var i=0; i < len; i++)	{
		var n = enc.charCodeAt(i);
		if (n >= 0x2B && n <= 0x39)	{
			dec += decryptCharcode(n, 0x2B, 0x3A, offset);	// 0-9 . , - + / :
		} else if (n >= 0x40 && n <= 0x5A)	{
			dec += decryptCharcode(n, 0x40, 0x5A, offset);	// A-Z @
		} else if (n >= 0x61 && n <= 0x7A)	{
			dec += decryptCharcode(n, 0x61, 0x7A, offset);	// a-z
		} else {
			dec += enc.charAt(i);
		}
	}
	return dec;
}

function writeDecryptedLink(s) {
	document.write('<a href="mailto:' + decryptString(s, -2) + '" class="hyperlink">' + decryptString(s, -2) + '</a>');
}
function writeDecryptedEmail(s) {
	document.write(decryptString(s, -2));
}
function setGwInformationOption(target){
	if(target=="nurgw"){
		document.getElementById("peremail").checked = false;
		document.getElementById("perpost").checked = false;
		document.getElementById("nurgw").checked = true;
	} else {
		document.getElementById("nurgw").checked = false;
	}
}