
var _current_index = 0;
var header_qty = 24;

function rand(n) {
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}

function Switcher() {
	//var next_id = _current_index+1;
	var next_id = rand(21)-1;
	if (_current_index == next_id) next_id = rand(16)-1;
	SwitchId(next_id);
	setTimeout(Switcher, 5000);
}

function SwitchId(index){
	$("#header" + _current_index).fadeOut(900);
	$("#header" + index).fadeIn(700);
	_current_index = index;
}

$(document).ready(function(){	
	setTimeout(Switcher, 5000);
});
