// Ein paar JavaScript Funktionen

// Es nervt, wenn Fenster immer an irgendeiner Ecke auf dem Bildschirm
// aufspringen, deshalb zentrieren wir sie
function centerWindow(theURL,winName,theWidth,theHeight) {
  var winL = Math.round((screen.width - theWidth) / 2);
  var winT = Math.round((screen.height - theHeight) / 2);
  var features='scrollbars=yes,resizable=yes';
  features=features+',width='+theWidth;
  features=features+',height='+theHeight;
  features=features+',left='+winL;
  features=features+',top='+winT;
  win = window.open(theURL, winName, features);
}

function formViewMail(mindex) {
  var mradio;
  var dispmode = 'none';
	mradio = document.getElementsByName("mailbehaviour")[mindex].value;
	if (mradio == 2) {
		dispmode = '';
	}
	document.getElementById("formMailAddr1").style.display = dispmode;
	document.getElementById("formMailAddr2").style.display = dispmode;
	document.getElementById("formMailAddr3").style.display = dispmode;
	document.getElementById("formMailAddr4").style.display = dispmode;
	document.getElementById("formMailAddr5").style.display = dispmode;
}

function getFormDomain(currentdomain) {
	if (currentdomain == '') {	
		currentdomain = opener.document.orderform.domainname.value;
		if (currentdomain != '') {
			document.checkform.checkdomain.value=currentdomain;
		}
	}
}

function setFormDomain() {
	var currentdomain = document.checkform.checkdomain.value;
	if (currentdomain != '') {
		opener.document.orderform.domainname.value = currentdomain;
	}
	window.close();
}


