
<!--
function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}


function do_ShangeAvater()
{
	var _ImgValue		= findObj('avatar_select');
	var _ImgScr 		= findObj('avatar');

	_ImgScr.src='/_images/avaters/'+_ImgValue.options[_ImgValue.selectedIndex].value;
}

function remove_user()
{
	if(confirm('Weet je zeker dat je de account wilt verwijderen?'))
	{
		findObj('moda').value='2';
		findObj('moda').submit();
	}
}

function do_UserpicChange()
{
	var _ImgScr 		= findObj('avatar');
	var _ImgValue		= findObj('userpicpersonal');
	var _ImgValue2	= findObj('avatar_select');

	// Look if the box is cheked, en de value is not empty.
	if(findObj('userpicpersonalshec').checked == true && findObj('userpicpersonal').value.length > 0)
	{
		_ImgScr.src=_ImgValue.value;
	} else {
		_ImgScr.src='/_images/avaters/'+_ImgValue2.options[_ImgValue2.selectedIndex].value;
	}
}

function do_DisableLogintime()
{
	selObj = findObj('login_type');

	if(selObj.options[selObj.selectedIndex].value != 'cookie')
	{
		findObj('time_1').disabled = true;
		findObj('time_2').disabled = true;
		findObj('time_3').disabled = true;
		findObj('lock_ip').disabled = true;
	} else {
		findObj('time_1').disabled = false;
		findObj('time_2').disabled = false;
		findObj('time_3').disabled = false;
		findObj('lock_ip').disabled = false;
	}
}
function do_LoginForm()
{
		var errors = '';

	if(!findObj('username').value)
	{
		errors += 'Gebruikersnaam is niet ingevuld.\n';
	}
	if(!findObj('password').value)
	{
		errors +=  'Wachtwoord is niet ingelvuld.\n';
	}
	if(errors)
	{
		alert(errors);
		document.returnValue = (errors == '');
		
		return false;
	}
	
	return true;
}

function do_ShecPass()
{
	if(findObj('pass') != findObj('pass2'))
	{
		alert('De twee opgegeven wachtwoorden zijn niet gelijk aan elkaar.');
		return false;
	} else {
		return true;
	}
}

function do_ProfileModify_validate()
{
	var errors = '';
	var searchForNumbers = /\D+\_+\W+\s+\S+/;

	if(!findObj('username').value)
		errors += 'Gebruikersnaam is niet ingevuld.\n';

	if(!findObj('passwd').value)
		errors +=  'Wachtwoord is niet ingelvuld.\n';

	if(!findObj('email').value)
		errors +=  'Email adres is niet ingevuld.\n';

	if(!findObj('bday1').value || !findObj('bday2').value || !findObj('bday3').value)
		errors +=  'Geboortedatum is niet ingevuld.\n';

	//if(!findObj('sity').value)
	//	errors +=  'Woonplaats is niet ingevuld.\n';

	//if(!findObj('site_url').value && findObj('site_title').value)
	//	errors +=  'Woonplaats is niet ingevuld.\n';

	if(!findObj('bio').value)
		errors +=  'Persoonlijke beschrijving is niet ingevuld.\n';

  if(findObj('icq').value != '' && !searchForNumbers.test(findObj('icq').value))
		errors +=  'ICQ mag enkel een numer zijn.\n';

  if(findObj('passwd2').value != '' && !findObj('passwd3').value)
		errors +=  'Bij een nieuw wachtwoord, moeten zowel het oude als nieuw wachtwoord worden ingevuld.\n';

	// Pass the same ?
	if((findObj('passwd2').value != '' && findObj('passwd3').value != '') && findObj('passwd2').value != findObj('passwd3').value)
		errors +=  'De twee opgegeven wachtwoorden zijn niet gelijk aan elkaar.\n';


	if(errors)
	{
		alert(errors);
		return false;
	} else {
		return true;
	}
}
//-->