//====================================================================
//
//	Nico van Veenendaal webdesign & -development
//	www.nicovanveenendaal.nl | info@nicovanveenendaal.nl
//          
//	Project: Local
//	Datum: 12-12-2011
//
//====================================================================


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;
	

	
	// ====================================
	// ==== REFLECTION
	// ====================================
	
	if ($("#content").height() < 614)
	{
		$("#visual").height(614);
	}
	else
	{
		$("#visual").height($("#content").height());
	}
	
	$("img.reflect").reflect({height: 0.5, opacity: 0.5});
	

	
	// ====================================
	// ==== NAVIGATION
	// ====================================	
	
	$("#mainNav li").hover(function()
	{	
		//$(this).stop().animate({ opacity: 0.5}, tweenSpeed);

	},function()
	{
		//$(this).stop().animate({ opacity: 1}, tweenSpeed);
	});
	
	var activeMainNavWidth = $("#mainNav .active").width();
	var activeMainNavPos = $("#mainNav .active").position();
	var subNavWidth = $(".subNavContainer ul").width();
	
	var subNavPos = (activeMainNavPos.left + 10) + (activeMainNavWidth / 2) - (subNavWidth / 2);
	
	if (subNavPos > subNavWidth/2)
	{
		$(".subNavContainer ul").css('margin-left', subNavPos);
	}
	
	
	
	// ====================================
	// ==== OVERVIEW IMAGE
	// ====================================

	$(".overviewImage li").addClass('hand');
	
	$(".overviewImage li").hover(function()
	{	
		$(this).find("img").stop().animate({ opacity: 0.5}, tweenSpeed);
		$(this).find("h2 a").stop().animate({ color: "#e60e64"}, tweenSpeed);
	},function()
	{
		$(this).find("img").stop().animate({ opacity: 1}, tweenSpeed);
		$(this).find("h2 a").stop().animate({ color: "#818285"}, tweenSpeed);
	});
		
	$(".overviewImage li").click(function()
	{	
		if (!$(this).find("a").attr("href")) return;
		window.location=$(this).find("a").attr("href"); return false;
	});	
});




