var id = '#top';

$(document).ready(function(){
	$('.calendarListDiv a:first-child').after(' &nbsp; ');
});

function slideshow(j) {
	$(id).html('').css('position', 'absolute');
	slideshow_getImages();
	slideshow_shiftImages(j);
}
function slideshow_getImages() {
	$.ajax({
		type: "GET",
		url: 'templates/simple_01/header.xml',
		dataType: "xml",
		success: function(xml) {
			var content = '';
			$(xml).find('image').each(function(i){
				var width = $(this).width();
				var height = $(this).height();
				content += '<img src="templates/simple_01/header_slideshow/' +$(this).text()+ '" />';
			});
			$(id).prepend(content);
			$(id).find('img').css({
				'display' : 'block',
				'position' : 'absolute',
				'top' : '0',
				'left' : '0',
				'overflow' : 'hidden'
			});
		},
		error: function(){
			$(id).html('<img src="templates/simple_01/images/header_01.jpg" alt="" />');
		}
	});
}
function slideshow_shiftImages(k) {
	var element = $(id).find('img:last-child');
	
	$(id).find('img:last-child').clone().prependTo(id);
	opacity = $(id).find('img:last-child').css('display');
	$(id).find('img:last-child').append(opacity);
	$(id).find('img:last-child').fadeOut('slow',function(){
		element.remove();
	});
	setTimeout("slideshow_shiftImages("+k+")", k*1000);
}

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','width=280,height=228');
	if (window.focus) {newwindow.focus()}
}
