function namlimit() {
    var LIMIT = 15;
    if ($('name').value.length <= LIMIT) {
        var newspan = parseInt(LIMIT) - parseInt($('name').value.length);
        $('namcharleft').innerHTML = newspan;
    } else {
        $('name').value = $('name').value.substring(0, LIMIT);
    }
}

function msglimit() {
    var LIMIT = 90;
    if ($('message').value.length <= LIMIT) {
        var newspan = parseInt(LIMIT) - parseInt($('message').value.length);
        $('msgcharleft').innerHTML = newspan;
    } else {
        $('message').value = $('message').value.substring(0, LIMIT);
    }
}

function sendForm() {
  	var clone = new Element('span').injectAfter('invisible');
	$('tagboard').send({update: clone});
    $('name').value = "";
    $('message').value = "";
};

function rssfeeds() {
    var sampleData = {
      amy: ['http://www.the-group.ws/ajax_loop.php?feed=http://amy.the-group.ws/rss.php?view=headline'],
      cam: ['http://www.the-group.ws/ajax_loop.php?feed=http://cam.the-group.ws/rss.php?view=headline'],
      dani: ['http://www.the-group.ws/ajax_loop.php?feed=http://dani.the-group.ws/rss.php?view=headline'],
      danman: ['http://www.the-group.ws/ajax_loop.php?feed=http://danman.the-group.ws/rss.php?view=headline'],
      jess: ['http://www.the-group.ws/ajax_loop.php?feed=http://jess.the-group.ws/rss.php?view=headline'],
      yank: ['http://www.the-group.ws/ajax_loop.php?feed=http://yank.the-group.ws/rss.php?view=headline'],
      brendo: ['http://www.the-group.ws/ajax_loop.php?feed=http://www.bloodbone.ws/rss.php?view=headline'],
      kyle: ['http://www.the-group.ws/ajax_loop.php?feed=http://kyle.the-group.ws/rss.php?view=headline'],
      benji: ['http://www.the-group.ws/ajax_loop.php?feed=http://benji.ws/rss.php?view=headline'],
      mel : ['http://www.the-group.ws/ajax_loop.php?feed=http://blog.myspace.com/blog/rss.cfm?friendID=7144972']
    };
    //Make a new Hash from an object
    var dataHash = new Hash(sampleData); //$H(D) would've done the same
    var hashKeys = dataHash.keys();

    for(var key in hashKeys) {
        key = hashKeys[key];
        //mootools extends the Array Class so there
        //are functions added that need to be skipped
        if($type(key) == 'function') break;

        link = dataHash.get(key);
        doAjax(key, link);
        dataHash.remove(key);
    }

    function doAjax(key, link)
    {
        var blah = new Ajax(link,
                        {
                            method: 'get',
                            timeout: 59000,
                            onComplete: function(txt, xml)
                            {
                                var node = xml;
                                var channel = node.getElementsByTagName('channel').item(0);

                                // Browse items
                                var items = channel.getElementsByTagName('item');

                                var itemTitle = items[0].getElementsByTagName('title').item(0).firstChild.data;
                                var itemLink = items[0].getElementsByTagName('link').item(0).firstChild.data;

                                content = 'Latest: <a href="'+itemLink+'">'+itemTitle+'</a>';

                                // Display the result
                                document.getElementById(key+"-latest").innerHTML = content;
                            },
                        }).request();
    }
}