var image1;
var background;
var backgrounds = new Array();
backgrounds[0] = "url('images/mainBack.png')";
backgrounds[1] = "url('images/mainBack2.png')";
backgrounds[2] = "url('images/mainBack3.png')";
function init(){
  background = (Math.round(Math.random() * 2));
  document.getElementById('content').style.backgroundImage = backgrounds[background];
  image1 = document.getElementById('mainImage');
  setMargin();
  }
  
function setMargin(){
  if(image1 != null){
  image1.style.marginLeft = (610 - image1.width) / 2 + 'px';
  image1.style.marginTop = (330 - image1.height) / 2 + 'px';
  }}
