// set timeout to run scroll after 2 seconds
function timeoutFunction(){
  var t = setTimeout(scrollMarquee, 2000);
  // clearTimeout(t);
  // reset to center after 20 seconds
  var r = setTimeout(resetScroll, 17000);	
}
// reset div to right of page to scroll again
function resetScroll(){
	$('#marquee').css({'marginLeft': '0px'});
	// loop the marquee each 15 seconds
	timeoutFunction();
}

// function scrolls the marquee off the page
function scrollMarquee(){  
	$('#marquee').animate({"marginLeft" : "-=1025px"}, { duration: 12000});
	$('#marquee').hover(function(){
	  $('#marquee').stop();			
	}, function(){
	  timeoutFunction();	
	});		
}

// scroll text like a marquee
$(document).ready(function(){
    if (navigator.appName!="Microsoft Internet Explorer") {
		timeoutFunction();
	}
});
