var randomImages = (function(){
'use strict';
return{
init: function(){
this.events();// init events
},
events: function(){
/* random images snippet*/
var images = [
'images/white1.png',
'images/white2.png',
'images/white3.png',
'images/white4.png',
'images/white5.png',
'images/white6.png',
];
// create style tag in head
var s = document.createElement('style');
// add id
s.id = 'random-Img';
// type css
s.type = 'text/css';
// append in head
document.head.appendChild(s);
// math random
var r = images[Math.floor(Math.random() * images.length)];
// add into style
s.textContent = '#header{background:url('+r+') center no-repeat; height: 570px; margin: 0; margin-top: 50px; width: 100%;}';
}
};
})();
// Ready for the war
randomImages.init();