function createUsername(firstname, lastname)
{
	var username = '';
	var specialChars = new Array(
		'/ß/',
		'/ä/', '/Ä/', '/á/', '/à/', '/ã/', '/â/', '/Á/', '/À/', '/Ã/', '/Â/',
		'/ö/', '/Ö/', '/ó/', '/ò/', '/õ/', '/ô/', '/Ó/', '/Ò/', '/Õ/', '/Ô/',
		'/ü/', '/Ü/', '/ú/', '/ù/',        '/û/', '/Ú/', '/Ù/',        '/Û/',
		'/ï/', '/Ï/', '/í/', '/ì/',        '/î/', '/Í/', '/Ì/',        '/Î/',
		'/ë/', '/Ë/', '/é/', '/è/',        '/â/', '/É/', '/È/',        '/Ê/',
		'/[^a-zA-Z0-9]+/'
	);
	var replaceChars = new Array(
		'ss',
		'a', 'A', 'a', 'a', 'a', 'a', 'A', 'A', 'A', 'A',
		'o', 'O', 'o', 'o', 'o', 'o', 'O', 'O', 'O', 'O',
		'u', 'U', 'u', 'u',      'u', 'U', 'U',      'U',
		'i', 'I', 'i', 'i',      'i', 'I', 'I',      'I',
		'e', 'E', 'e', 'e',      'e', 'E', 'E',      'E',
		''
	);
	
	username	= (firstname.length > 0) ? firstname.substring(0,1).toLowerCase() : '';
	username   += lastname.toLowerCase();
	
	for (var i = 0; i < specialChars.length; i++)
	{
		eval("username = username.replace(" + specialChars[i] + "gi, replaceChars[i]);");
	}
	
	username	= username.substring(0,20);
			
	return username;
}

function formfocusnext(form, elemName, evt)
{
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3)
	{
		form.elements[elemName].focus();
        return false;
    }
    return true;
}
function submitform(form, evt)
{
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3)
	{
		form.submit();
        return false;
    }
    return true;
}
function togglecheckbox(checkbox)
{
	checkbox.checked = !checkbox.checked;
}
function confirmation(type) {
	switch (type) {
		case "pass":
			var zeker=confirm("Are you sure you want to change your password?");
			break;
		case "fullmember":
			var zeker=confirm("Are you sure you want to make this pending member a full member?");
			break;
		case "delete_photo":
			var zeker=confirm("Are you sure you want to delete this member photo?");
			break;
		case "sendconfirmation":
			var zeker=confirm("Are you sure you want to send a new confirmation e-mail?");
			break;
		case "sendconfirmation_all":
			var zeker=confirm("Are you sure you want to send new confirmation e-mails to all selected members?");
			break;
		case "publish":
			var zeker=confirm("Are you sure you want to publish this article?");
			break;
		case "archive":
			var zeker=confirm("Are you sure you want to archive this thread (posting will not be possible anymore) ?");
			break;
		case "unarchive":
			var zeker=confirm("Are you sure you want to unarchive this thread?");
			break;
		case "user_delete":
			var zeker=confirm("Are you sure you want to delete this user?");
			break;
		case "user_undelete":
			var zeker=confirm("Are you sure you want to restore this deleted user?");
			break;
		case "file":
			var zeker=confirm("Are you sure you want to delete this file?");
			break;
		case "acceptphoto":
			var zeker=confirm("Are you sure you want to approve this member photo?");
			break;
		case "acceptphoto_all":
			var zeker=confirm("Are you sure you want to approve all selected member photos?");
			break;
		case "accepteu":
			var zeker=confirm("Are you sure you want to approve this member for EU access?");
			break;
		case "suggesteu":
			var zeker=confirm("Are you sure you want to suggest this member for EU access?");
			break;
		case "rejecteu":
			var zeker=confirm("Are you sure you want to reject this suggestion for EU access?");
			break;
		case "accepteu_all":
			var zeker=confirm("Are you sure you want to approve all selected members for EU access?");
			break;
		case "confirm":
			var zeker=confirm("Are you sure you want to manually confirm this new END member?");
			break;
		case "sendmail":
			var zeker=confirm("Are you sure you want to send this email?");
			break;
		default:
			var zeker=confirm("Are you sure you want to delete this item?");
	}
	return zeker;
}
wmtt=null;
document.onmousemove=updateWMTT;

function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}		
function showWMTT(id) {
	wmtt=document.getElementById(id);
	wmtt.style.display="block"
}
function hideWMTT() {
	wmtt.style.display="none";
}
