var carouselItems = new Array;
var currentScreen;
var items;
var tweenSpeed;
var showTime;


jQuery(document).ready(function() 
{
	currentScreen = 0;
	tweenSpeed = 400;
	opacityMinimal = 0.0;
	opacityMiddle = 0.4;
	opacityMaximal = 1.0;
	showTime = 5000;
	

	// ====================================
	// ==== BACKGROUND
	// ====================================

	alignBase();
	resizeBackground();

	bg_flash = $.flash.create(
	{
		swf: $('#bg_flash span.bgFlash').html(),
		width: $('#bg_flash span.bgWidth').html(),
		height: $('#bg_flash span.bgHeight').html(),
		wmode: 'transparent',
		flashvars: {
			video: $('#bg_flash span.bgFile').html()
		}
	});


	$(document).ready(
		function ()
		{
			$('#bg_flash').html(bg_flash);
			$('#bg_flash').fadeIn(2000);
		}
	);



			
	$(window).resize(function()
	{
		alignBase();
		resizeBackground();
	});


	// ====================================
	// ==== TAGCLOUD
	// ====================================

	$("#tagcloud li").addClass('hand');

	$("#tagcloud li.cloud").hover(function()
	{	
		$(this).find("div").fadeIn();
	},
	function ()
	{
		$(this).find("div").fadeOut();		
	});
	
	$("#tagcloud div").corner("20px");
	
	



	// ====================================
	// ==== OVERVIEW
	// ====================================
	
	$("#overview li").addClass('hand');
	
	$("#overview li").hover(function()
	{	
		$(this).find("img").stop().animate({ opacity: 0}, tweenSpeed);
	},function()
	{
		$(this).find("img").stop().animate({ opacity: 1}, tweenSpeed);
	});
		
	$("#overview li").click(function()
	{	
		if (!$(this).find("a").attr("href")) return;
		window.location=$(this).find("a").attr("href"); return false;
	});


		
	
	
});

function alignBase()
{
	var wh = $(window).height();
	var bh = $("#base").height();
	var mt = Math.ceil((wh-bh) / 2);
	
	if (mt < 0) { mt = 0;  }
	
	$("#wrapper").css('padding-top', mt);
}

function resizeBackground()
{
	var ww = $(window).width();
	var wh = $(window).height();

	$("#bg_image").width(ww);
	$("#bg_image").height(wh);
}




