/*  Web 2.0 Name Generator
    Written by Jacqueline "Kira" Hamilton (http://lightsphere.com/)

    Copyright 2006, 2007. All rights reserved.
*/

// retired: 23, 42, U
//
partA = new Array( "Babble", "Buzz", "Blog", "Blue", "Brain", "Bright", "Browse", "Bubble", "Chat", "Chatter", "Dab", "Dazzle", "Dev", "Digi", "Edge", "Feed", "Five", "Flash", "Flip", "Gab", "Giga",  "Inno", "Jabber", "Jax", "Jet", "Jump", "Link", "Live", "My", "N", "Photo", "Pod", "Real", "Riff", "Shuffle", "Snap", "Skip", "Tag", "Tek", "Thought", "Top", "Topic", "Twitter", "Word", "You", "Zoom");

partB = new Array( "bean", "beat", "bird", "blab", "box", "bridge", "bug", "buzz", "cast", "cat", "chat", "club", "cube", "dog", "drive", "feed", "fire", "fish", "fly", "ify", "jam", "links", "list", "lounge", "mix", "nation", "opia", "pad", "path", "pedia", "point", "pulse", "set", "space", "span", "share", "shots", "sphere", "spot", "storm",  "ster", "tag", "tags", "tube", "tune", "type", "verse", "vine", "ware", "wire", "works", "XS", "Z", "zone", "zoom" );

// these are not complete words:

partC = new Array( "Ai", "Aba", "Agi", "Ava", "Cami", "Centi", "Cogi", "Demi", "Diva", "Dyna", "Ea", "Ei", "Fa", "Ge", "Ja", "I", "Ka", "Kay", "Ki", "Kwi", "La", "Lee", "Mee", "Mi", "Mu", "My", "Oo", "O", "Oyo", "Pixo", "Pla", "Qua", "Qui", "Roo", "Rhy", "Ska", "Sky", "Ski", "Ta", "Tri", "Twi", "Tru", "Vi", "Voo", "Wiki", "Ya", "Yaki", "Yo", "Za", "Zoo" );

partD = new Array( "ba", "ble", "boo", "box", "cero", "deo", "del", "do", "doo", "gen", "jo", "lane", "lia", "lith", "loo", "lium", "mba", "mbee", "mbo", "mbu", "mia", "mm", "nder", "ndo", "ndu", "noodle", "nix", "nte", "nti", "nu", "nyx", "pe", "re", "ta", "tri", "tz", "va", "vee", "veo", "vu", "xo", "yo", "zz", "zzy", "zio", "zu");

// funny names that deserve a comment

funny = new Array;
funny["Fatz"]    = "Domino!";
funny["Feeddog"] = "Woof.";
funny["Geta"]    = "...life!";
funny["Jaba"]    = "Tell Jabba I have his money...";
funny["Java"]    = "Sun might have a problem with that one...";
funny["Lava"]    = "This one's hot.";
funny["Lando"]   = "I won it from you fair and square!";
funny["Leeloo"]  = "Perfect.";
funny["Mumm"]    = "Mum's the word.";
funny["Mutz"]    = "Who let the dogs out?";
funny["Roomba"]  = "Cute, but it sucks.";
funny["Skype"]   = "Well, that one's taken. Try again!";
funny["Tape"]    = "You've got this on tape, right?";
funny["Viva"]    = "Viva las V-gas!";
funny["Video"]   = "No, probably not.";
funny["Voodoo"]  = "When you really want to get back at someone.";
funny["Youfire"] = "Me boss. You fired.";
funny["Youtube"] = "Well, that one's taken. Try again!";
funny["Zoomzoom"] = "zoomzoom!";

lastName = new String();

function genName() {
    var f = document.getElementById('funny');
    f.innerHTML = '';
    
    var rand = roll(2);
    var A = new String();
    var B = new String();
    
    if (rand == 0) {
        A = partA[ roll(partA.length) ];
        B = partB[ roll(partB.length) ];
    } else {
        A = partC[ roll(partC.length) ];
        B = partD[ roll(partD.length) ];    
    }
    var name = A + B;
    
    setName(name);
    
    var side = document.getElementById("sidebox");
    side.innerHTML += '<a href="javascript:setName(\'' + name + '\');">' + name + "</a><br>\n";
    side.scrollTop = side.scrollHeight;
}

function setName(name) {
    var nameElt = document.getElementById("name");
    nameElt.innerHTML = name;
    
    var form1 = document.getElementById("form1");
    form1.style.display = "inline";
    form1.DomainName.value = name;
    
    if (funny[name]) {
        var f = document.getElementById('funny');
        f.innerHTML = funny[name];        
    }
}

function roll(num) {
    return Math.floor(Math.random() * num );
}
