var first_width = document.getElementById('first_line').offsetWidth;
var second_width = document.getElementById('second_line').offsetWidth;
document.getElementById('first_line').style.marginLeft = -first_width+"px";
document.getElementById('second_line').style.marginLeft = document.getElementById('first_line').offsetWidth + second_width+"px";

$(document).ready(function() {
  
  var $container = $("#topdiv_container");
  var $first_line = $("#first_line");
  var $second_line = $("#second_line");
  
  $first_line.animate({
    marginLeft: ($container.outerWidth()-$first_line.outerWidth()) / 2
  }, 5000);
  
  $second_line.animate({
    marginLeft: ($container.outerWidth()-$second_line.outerWidth()) / 2
  }, 5000);

});


