Calculate you Star Wars Name, the way George Lucas did!
function getStarWarsName(firstname, lastname, mothers_maiden_name, birth_town){
var condition = (firstname.length >= 2) && (lastname.length >= 2) && (mothers_maiden_name.length >= 2) && (birth_town.length >=3);
if( condition ){
firstname = (lastname.substr(0,3) + firstname.substr(0,2)).toLowerCase();
lastname = (mothers_maiden_name.substr(0,2) + (birth_town.replace(' ', '')).substr(0,3)).toLowerCase();
}
return firstname[0].toUpperCase() + firstname.substr(1) + ' ' + lastname[0].toUpperCase() + lastname.substr(1);
}