var marqueespeed=1          //The speed the marque goes normally
var origspeed=marqueespeed; //Holds the original speed for mouseout
var pausespeed=0;   //The speed the marque goes when mouseover
var actualwidth='';          //Holds the width for the spill over
var marquee; //Holds the Dom element
function retrieveFeed() {

    jQuery.getFeed({
        url: 'RSSFeed/feed.xml',
        success: function(feed) {
            var html = '';
            html += (''
                + '<a style="color:white" href="'
                + feed.link
                + '">'
                + feed.title
                + '</a> -- ');

            

            for(var i = 0; i < feed.items.length && i < 5; i++) {

                var item = feed.items[i];

                html += ''
                + '<a target="_blank" style="color:white" href="'
                + item.link
                + '">'
                + item.title
                + '</a> -- ';

            }
            $('#feedInfo').html(html);
            actualwidth = html.length * 2;
        }
    });
}



var width;

function ticker(idOfElement) {
    marquee=document.getElementById(idOfElement);        //Holds the Dom element
    marquee.style.left=document.getElementById("feedtop").offsetWidth + 8 + "px";
    width = marquee.style.left;
    //actualwidth= $('#' + idOfElement).width();
    //alert($('#feedInfo').html());
    lefttime=setInterval("scrollmarquee()",1);
}
//Actually moves the text
function scrollmarquee(){
    if (parseInt(marquee.style.left)>(actualwidth*(-1)+8)) {
        marquee.style.left=parseInt(marquee.style.left)-marqueespeed+"px"
    }
    else {
        marquee.style.left=width;
    //marquee.style.left=document.getElementById('feedTop').offsetWidth + 8 + "px"
    }
}
function mouseOver(){
    marqueespeed = pausespeed;
}
function mouseOut(){
    marqueespeed = origspeed;
}


