function thebackground() {
$('div.headerimg img').css({opacity: 0.0});
$('div.headerimg img:first').css({opacity: 1.0});
setInterval('change()',5000);
}
function change() {
var current = ($('div.background img.show')? $('div.headerimg img.show') : $('div.headerimg img:first'));
if ( current.length == 0 ) current = $('div.headerimg img:first');
var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.headerimg img:first') :current.next()) : $('div.headerimg img:first'));
next.css({opacity: 0.0})
.addClass('show')
.animate({opacity: 1.0}, 1000);
current.animate({opacity: 0.0}, 1000)
.removeClass('show');
};



