function changeBanner(delay,rotatorid,blist) {
   var position = 0;
   var start;
   return function() {
	  if (position == blist.length) { position = 0; }
	  document.getElementById(rotatorid).style.background = "url("+blist[position]+")";
	  start = setTimeout(cb,delay);
      return ++position;
   };
}

var cb = changeBanner(
	10000,
	'brotator',
	[
		"/template/img/head/pic1.jpg",
		"/template/img/head/pic2.jpg",
		"/template/img/head/pic3.jpg",
		"/template/img/head/pic4.jpg",
		"/template/img/head/pic5.jpg",
		"/template/img/head/pic6.jpg",
		"/template/img/head/pic7.jpg",
		"/template/img/head/pic8.jpg"
	]
	);

cb();