var BACKGROUNDS = [
  { 'bg' : 'bg-1.jpg'}
];

function set_background(){
  //var top_div = document.getElementById('logo-div');
  
  //var bset = BACKGROUNDS[ Math.floor(Math.random()*BACKGROUNDS.length) ];
  
  //document.body.background = "images/backgrounds/"+bset.bg;
  //top_div.background = "images/backgrounds/"+bset.top;
}

function saf(el){ // saf stands for submit_ancestor_form but I am about to write it too damn many times
  var ancestors = $(el).ancestors();
  for(var i=0; i<ancestors.length; i++){
    if(ancestors[i].onsubmit){ // only forms will have submit method. Is that true?
      if( ancestors[i].onsubmit() ){
        ancestors[i].submit();
      }
      break;
    } else if(ancestors[i].submit){
      ancestors[i].submit();
      break;
    }
  }
}

