//<![CDATA[
jQuery(function() {
    jQuery('#Table52 tr:first').append(jQuery('#ShopLayOut_Search_TD'));
    jQuery('#ShopLayOut_Basket_TD').children(':first').insertAfter(jQuery('#ProductmenuContainer_DIV')).attr('id', 'basket');
    jQuery('#ShopLayOut_Basket_TD').append('<div><h3><a href="/shop/specialoffer-ALL-1.html">Tilbudsvarer</a></h3></div>').children(':first').attr('id', 'rssNews');
});

// load the AJAX Feed API
google.load("feeds", "1");

function OnLoad() {

    // create a feed control
    var feed = new google.feeds.Feed("http://1670339.shop13.dandomain.dk/shop/specialoffer-ALL-1.rss");
	feed.setNumEntries(10);
	
    feed.load(function(result) {
        if (!result.error) {
            jQuery(function() {
                var container = document.getElementById("rssNews");
                var html = '';
                for (var i = 0; i < result.feed.entries.length; i++) {
                    var item = result.feed.entries[i];
                    html += '<span>' + '<a href="' + item.link + '">' + item.title + '</a>' + '</span>';
                    html += '<div>' + item.content.replace("Pris: ", "Tilbudspris: ") + '</div><div style="border-bottom: 1px solid #999"></div>';
                }
                jQuery('#rssNews').append(html);
            });
        }
    });
}

google.setOnLoadCallback(OnLoad);
//]]>
