jQuery.fn.accessNews = function( settings ) {
settings = jQuery.extend({
headline : "Top Stories",
speed : "normal",
slideBy : 2
}, settings);
return this.each(function() {
        jQuery.fn.accessNews.run( jQuery( this ), settings );
    });
};

jQuery.fn.accessNews.run = function( $this, settings ) {
jQuery( ".javascript_css", $this ).css( "display", "none" );
var ul = jQuery( "ul:eq(0)", $this );
var li = ul.children();
if ( li.length > settings.slideBy ) {

var liWidth = jQuery( li[0] ).width();
var animating = false;
ul.css( "width", ( li.length * liWidth +   li.length ) );


var firstimg = jQuery( "ul li:eq(0) img", $this );
var firstlink = jQuery( "ul li:eq(0) a", $this );

$("#selected_url").attr('href', firstlink.attr('href'));

img = jQuery('<img></img>')
img.attr('src', firstimg.attr('src'));
img.appendTo("#selected_url");

para = jQuery('<div id="paraTitle"></div>');
para.appendTo("#container");
var firstli = jQuery( "#newsslider ul li:eq(0)");
para.html("<h1>" +  jQuery('.title', firstli ).html() + "</h1>");


paraText = jQuery('<div id="paraText"></div>');
paraText.appendTo("#container");
paraText.html("<p>" + jQuery('span.time_holder', firstli).html() + '<br />' + jQuery('span.date_holder', firstli).html() + "</p>");

firstli.addClass('selected');
li.hover(
    function () {
        li.removeClass('selected')
        var current = jQuery(this);
        current.addClass('selected');

        $("#selected_url").attr('href',current.find('a').attr('href') );
        img.attr('src', current.find('img').attr('src'));

        para.html("<h1>" +  jQuery('.title', current).html() + "</h1>");
        paraText.html("<p>" + jQuery('.time_holder', current).html() + '<br />' + jQuery('.date_holder', current).html() + "</p>");
    },

    function () {
            current.parent().css('backgroundColor', 'transparent');
        }
    );
}
};

