/* REGISTRATION FORM */
function register_form(form)
{
	//check username
	if (form.username.value == ""){alert( "Please enter a valid username." );return false;}
	
	//check username Length
	if (form.username.value.length < 3){alert( "The account name is too short!" );return false;}
	
	//check email
	if (form.email.value == ""){alert( "Please enter a valid email" );return false;}
	
	//check username
	if (form.confirm_email.value == ""){alert( "Please confirm your email." );return false;}
	
	//check username Length
	if (form.confirm_email.value != form.email.value ){alert( "Your email does not match your confirmation." );return false;}
	
	return true ;
}

/* Expand/Collapse System */
function colExp(id,content,exists)
{
    if(exists == null){
		exists = true;
	}
		var seg  = document.getElementById(id);
		var top = document.getElementById(content);
    if(seg.style.display != "none"){
        seg.style.display = "none";
        if(exists == true){
            top.className = "header";
        }
    }else{
        seg.style.display = "";
        if(exists == true){
            top.className = "header active";
        }
    }
}



/* REGISTRATION FORM */
function change_exp(form)
{
	//check username
	if (form.login.value == ""){alert( "Please enter a valid username." );return false;}
	
	//check username Length
	if (form.login.value.length < 3){alert( "The account name is too short!" );return false;}
	
	//check email
	if (form.email.value == ""){alert( "Please enter a valid email" );return false;}
	
	//check password
	if (form.password.value == ""){alert( "Please enter a valid password." );return false;}
	
	return true ;
}



/* REGISTRATION FORM */
function change_pass(form)
{
	//check username
	if (form.login1.value == ""){alert( "Please enter a valid username." );return false; }
	
	//check username Length
	if (form.login1.value.length < 3) {alert( "The account name is too short!" );return false;}
	
	//check email
	if (form.email1.value == ""){alert( "Please enter a valid email" );return false;}
	
	//check password
	if (form.password1.value == ""){alert( "Please enter your old password." );return false;}
	
	//check password
	if (form.newpassword.value == ""){alert( "Please enter a new password." );return false;}
	
	//check password
	if (form.confirmnewpassword.value == ""){alert( "Please confirm your new password." );return false;}
	
	//check password
	if (form.newpassword.value != form.confirmnewpassword.value){alert( "Your password did not match." );return false;}
	
	//check password
	if (form.newpassword.value == form.password1.value){alert( "You can not use the same password." );return false;}
	
	return true ;
}



/* REGISTRATION FORM */
function recover_username(form)
{
	//check email
	if (form.email.value == ""){alert( "Please enter your account email" );return false;}
	
	return true ;
}



/* REGISTRATION FORM */
function recover_email(form)
{
	//check username
	if (form.login.value == ""){alert( "Please enter your username." );return false;}
	
	//check email
	if (form.email.value == ""){alert( "Please enter a valid email" );return false;}
	
	return true ;
}



/* REGISTRATION FORM */
function recover_password(form)
{
	//check email
	if (form.login.value == ""){alert( "Please enter your username." );return false;}
	
	//check email
	if (form.email.value == ""){alert( "Please enter your account email" );return false;}
	
	return true ;
}



/* SERVER TRANSFER FORM */
function server_transfer_form(form)
{
	if (form.charselect.value == ""){alert( "Please add your link to your Character selection screenshot" );return false;} //check character selection screanshot
	if (form.charselect.value == "http://"){alert( "Please add your link to your Character selection screenshot" );return false;} //check character selection screanshot
	
	if (form.charmove.value == ""){alert( "Please add your link to your in game 'I want to move to deathknell' screenshot" );return false;}
	if (form.charmove.value == "http://"){alert( "Please add your link to your in game 'I want to move to deathknell' screenshot" );return false;}
	
	if (form.charplayed.value == ""){alert( "Please add your link to your /played screenshot" );return false;}
	if (form.charplayed.value == "http://"){alert( "Please add your link to your /played screenshot" );return false;}
	
	if (form.charserver.value == ""){alert( "Please name the private server/official server" );return false;}
	
	if (form.charserverurl.value == ""){alert( "Please add the private server link" );return false;}
	
	if (form.charname.value == ""){alert( "Please give the name of the character on your old server" );return false;}
	
	if (form.account.value == ""){alert( "Please add your account name" );return false;}
	
	if (form.dkcharname.value == ""){alert( "Please tell us the name of your created character on Deathknell" );return false;}
	
	return true ;
}
