$(document).ready(function() {
    //this function sets the selected state for the navigation. 508 compliant :-)
    var selectNavItem = function() {
        var nav = document.getElementById("navigation");
        var links = nav.getElementsByTagName("a");
        for (var i=0; i < links.length; i++) {
            var linkurl = links[i].getAttribute("href");
            var currenturl = window.location.href;
            if (currenturl.indexOf(linkurl) != -1) {
                links[i].className = "selected";
                var finalLinks = links[i];
                $(finalLinks).parents('li').addClass("selected");
            }
        }
    };selectNavItem();
    $('img').hide().fadeIn(1000);
    //this function is for the careers page. I will need to eventually compare it against
    $.getFeed({
        url: 'proxy.php?url=http://www.informationweek.com/rss/all.xml',
        success: function(feed) {
            var html = '';
            for(var i = 0; i < feed.items.length && i < 20; i++) {
                var item = feed.items[i];
                html += '<h3>' + '<a href="' + item.link + '" target="_blank">' + item.title + '</a>'  + '</h3>';
                html += '<span>' + item.updated + '</span>';
                html +=  item.description + '';
                }
            $('#newsResults').css('background-image','none').hide().fadeIn(1000).append(html);
        }
    });
    $('body #content_container').hide().fadeIn(300);
    $("#commentForm").validate('slow');




});
