function stripVowelAccent(str)
{
 var rExps=[
 {re:/[\xC0-\xC6]/g, ch:'A'},
 {re:/[\xE0-\xE6]/g, ch:'a'},
 {re:/[\xC8-\xCB]/g, ch:'E'},
 {re:/[\xE8-\xEB]/g, ch:'e'},
 {re:/[\xCC-\xCF]/g, ch:'I'},
 {re:/[\xEC-\xEF]/g, ch:'i'},
 {re:/[\xD2-\xD6]/g, ch:'O'},
 {re:/[\xF2-\xF6]/g, ch:'o'},
 {re:/[\xD9-\xDC]/g, ch:'U'},
 {re:/[\xF9-\xFC]/g, ch:'u'},
 {re:/[\xD1]/g, ch:'N'},
 {re:/[\xF1]/g, ch:'n'} ];

 for(var i=0, len=rExps.length; i<len; i++)
  str=str.replace(rExps[i].re, rExps[i].ch);

 return str;
}

function checkOnId_profile(column,checkload,types,typetje) {
	eval(defaults(arguments, '','','',false));
	var empty = false;
	//pattern = /^([a-zA-Z0-9\' -]+)$/
	pattern = /^([a-zA-Z0-9\'\-\.\, ]+)$/
	if (trim(document.getElementById(column).value) == '') {
		empty = true;
	} else {
		
		if (types == 'email') {
			pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		} else if (types == 'password') {
			pattern = /(.+)/
		}
		
	}
	subject = trim(document.getElementById(column).value);
	subject = stripVowelAccent(subject);
	matches = false;
	matches = subject.match(pattern);
	if (matches) {
		checkVar = true;
		
		//document.getElementById(column).style.border = '1px solid #00d405';
		if (checkload == true) {
			if (document.getElementById('fout2_' + column)) {
				document.getElementById('fout2_' + column).style.display = 'none';
			}
			try {
				document.getElementById('fout_' + column).style.display = 'none';
			} catch (error) {
				// alert column
			}
		}
		
	} else {
		checkVar = false;
		//document.getElementById(column).style.border = '1px solid #ff0000';
		if (checkload == true) {
			if (empty == true) {
				if (document.getElementById('fout2_' + column)) {
					document.getElementById('fout2_' + column).style.display = 'none';
				}
				try {
					document.getElementById('fout_' + column).style.display = 'block';
				} catch (error) {
					//alert(column);
				}
			} else {
				if (document.getElementById('fout2_' + column)) {
					document.getElementById('fout_' + column).style.display = 'none';
				}
				try {
					document.getElementById('fout2_' + column).style.display = 'block';
				} catch (error) {
					//alert(column);
				}
			}
		}
		
	}
	if (checkload == true) {
		check_profile(typetje);
	}
	return checkVar;
}


function check_profile(typetje) {
	eval(defaults(arguments, false));
	// form
	surname = checkOnId_profile('surname',false,'');
	name_ = checkOnId_profile('name',false,'');
	address = checkOnId_profile('address',false,'');
	postal_code = checkOnId_profile('postal_code',false,'');
	town = checkOnId_profile('town',false,'');
	telephone = checkOnId_profile('telephone',false,'');
	email = checkOnId_profile('email',false,'email');	
	
	surname2 = checkOnId_profile('surname_2',false,'');
	name2 = checkOnId_profile('name_2',false,'');
	address2 = checkOnId_profile('address_2',false,'');
	postal_code2 = checkOnId_profile('postal_code_2',false,'');
	town2 = checkOnId_profile('town_2',false,'');

	if (name_ == false || surname == false || address == false || postal_code == false || town == false || telephone == false || email == false) {
		document.getElementById('bewerkdisabled').disabled = 'true';
		document.getElementById('bewerkdisabled').disabled = true;
		document.getElementById('bewerkknop').style.display = 'none';
		document.getElementById('bewerkknop2').style.display = 'block';
	} else {
		document.getElementById('bewerkdisabled').disabled = 'false';
		document.getElementById('bewerkdisabled').disabled = false;
		document.getElementById('bewerkknop').style.display = 'block';
		document.getElementById('bewerkknop2').style.display = 'none';
	}
}
function check_profile2(typetje) {
	eval(defaults(arguments, false));
	// form
	surname = checkOnId_profile('2_surname',false,'');
	name_ = checkOnId_profile('2_name',false,'');
	address = checkOnId_profile('2_address',false,'');
	postal_code = checkOnId_profile('2_postal_code',false,'');
	town = checkOnId_profile('2_town',false,'');
	telephone = checkOnId_profile('2_telephone',false,'');
	email = checkOnId_profile('2_email',false,'2_email');	
	


	if (name_ == false || surname == false || address == false || postal_code == false || town == false || telephone == false || email == false) {
		document.getElementById('disable_button').style.display = 'none';
		document.getElementById('enable_button').style.display = 'block';
	} else {
		document.getElementById('disable_button').style.display = 'block';
		document.getElementById('enable_button').style.display = 'none';
	}
}