CursorOver_1 = new Image();
CursorOver_1.src = "images/home_mo.gif";
CursorOff_1 = new Image();
CursorOff_1.src = "images/home_mu.gif";
CursorOver_2 = new Image();
CursorOver_2.src = "images/sales_mo.gif";
CursorOff_2 = new Image();
CursorOff_2.src = "images/sales_mu.gif";
CursorOver_3 = new Image();
CursorOver_3.src = "images/contact_mo.gif";
CursorOff_3 = new Image();
CursorOff_3.src = "images/contact_mu.gif";

$(document).ready(function() {
    var d = new Date();
    get_rss_feed();
    $("#footer").html("<strong>© Copyright 2007-" + d.getFullYear() + ", Construction Drilling Equipment</strong>&nbsp;");
});

function swap() {
    if (document.images) {
        for (var x = 0; x < swap.arguments.length; x += 2) {
            document[swap.arguments[x]].src = eval(swap.arguments[x + 1] + ".src");
        }
    }
}

function get_rss_feed() {
    var today = new Date();
    //clear the content in the div for the next feed.
    $('#boxContentRight').empty();
    //use the JQuery get to grab the URL from the selected item, put the results in to an argument for parsing in the inline function called when the feed retrieval is complete
    $.get("rss.xml", function(d) {

        //find each 'item' in the file and parse it
        $(d).find("item").each(function() {

            //name the current found item this for this particular loop run
            var $item = $(this);
            var itmDate = new Date($item.find('pubDate').text());
            
            if (itmDate > today) {
                // grab the post title
                var title = $item.find('title').text();
                // grab the post's URL
                var link = $item.find('link').text();
                // next, the description
                var description = $item.find('description').text();

                // now create a var 'html' to store the markup we're using to output the feed to the browser window
                //s &= "<strong><a href=""" & dt.Rows(i).Item("link") & """>" & dt.Rows(i).Item("title") & "</a></strong><br />"
                //s &= dt.Rows(i).Item("description")
                //s &= "<br /><br />"
                //If i < dt.Rows.Count - 1 And i <> dt.Rows.Count - 1 Then
                //s &= "<img src=""images/white_dot.gif"" width=""220"" height=""1"" /><br /><br />"

                var html = "<strong><a href=\"" + link + "\">" + title + "</a></strong><br />";
                html += description;
                html += "<br /><br /><img src=\"images/gray_line.gif\" width=\"220\" height=\"1\" /><br /><br />";

                //put that feed content on the screen!
                $('#boxContentRight').append(html);
            }
        });
        if ($('#boxContentRight').html() == "") {
            $('#boxContentRight').append("<strong>No scheduled events</strong>");
        }
    });

};
