function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

$(document).ready(function(){
    cycleFeatured();
});

function cycleFeatured() {
	var fac = $('.featured');
	if(fac.length > 0) {
		fac.each(function() {$(this).hide();});
		num  = Math.floor(Math.random()*(fac.length));
		fac[num].style.display = 'block';
}

function headerSwitch() {
	var rand = Math.floor(Math.random()*3)
	document.getElementById('header').style.backgroundImage = "url(assets/css/images/header_repeat_"+rand+".png)";
}

//addLoadEvent(headerSwitch);

}