function openContactList()
{	
	var wp = PATH_HTTP+"contacts.php";
	var wn = "Kontakte";
	var ww = 400;
	var wh = 250;
	var pt = 150;
	var pl = 150;
		
	var wa = "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no";
	var wo = window.open(wp,wn,"width="+ww+",height="+wh+",top="+pt+",left="+pl+","+wa);
	
	if (wo) wo.focus();
}

function addContact(name,mail)
{
	var name_set = false;
	var mail_set = false;
	var _this = window.opener.document.getElementById('postkarte');
	var arr_input = _this.getElementsByTagName("input");
	
	for (i=0; i<arr_input.length; i++)
	{
		if (arr_input[i].type == "text" && arr_input[i].name.indexOf("_to") != -1)
		{
			if (arr_input[i].value == "" && (name_set == false || mail_set == false))
			{
				if (arr_input[i].name.indexOf("name") != -1)
				{
					arr_input[i].value = name;
					name_set = true;
				}
				if (arr_input[i].name.indexOf("mail") != -1)
				{
					arr_input[i].value = mail;
					mail_set = true;
				}
			}
		}
	}
	
	if (name_set == false && mail_set == false)
	{
		window.opener.addRecipient('','',false,true);
		addContact(name,mail);
	}
}

function winNavigate(href,closeWin)
{
	window.opener.document.location.href = href;
	if (closeWin) self.close();
}
