function winopen(url, width, height) {
	if(!width) {
		width=450;
	}
	if(!height) {
		height=550;
	}
	newwindow = window.open(url, "_blank","toolbar=no,location=no,menubar=no,scrollbars=yes,width="+width+",height="+height+",resizeable=yes,status=no");
	if (window.focus) {newwindow.focus()}
}

function areSure() {
  return confirm("Deze link verwijst naar informatie die als schokkend ervaren kan worden.\nWil je doorgaan?");
}

function breakFriend() {
  return confirm("Weet je zeker dat je de geselecteerde vriendschappen wilt verbreken?");
}

function deleteMail(id) {
	if (id == 1)
	{
		return confirm("Weet je zeker dat je deze mail wilt verwijderen?");
	}
	else
	{
		return confirm("Weet je zeker dat je de geselecteerde mailtjes wilt verwijderen?");
	}
}

function getColor(id)
{
	var retval = window.showModalDialog("selectcolor_dialog.php","","dialogHeight: 215px; dialogWidth: 430px; scroll: 0; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
	document.getElementById(id).value = retval;
	document.getElementById(id + "box").style.backgroundColor = retval;
	document.getElementById(id + "box").style.color = retval;
}

function checkColor(id,color)
{
	re = /^(#[A-F0-9]{6})$/i
	if (re.test(color))
	{
		document.getElementById(id).style.backgroundColor = color;
		document.getElementById(id).style.color = color;
	}
	else
	{
		document.getElementById(id).style.backgroundColor = '#ffffff';
		document.getElementById(id).style.color = '#000000';
	}
}
