$(document).ready(function()
{
	// BOX COUNT ITEMS
	var items_1 = $("#box_1 #count1").attr('value');
	var items_2 = $("#box_2 #count2").attr('value');
	var items_3 = $("#box_3 #count3").attr('value');
	
	$("#box_1 #pagina_1").text('1/'+items_1);
	$("#box_2 #pagina_2").text('1/'+items_2);
	$("#box_3 #pagina_3").text('1/'+items_3);
	
	
	// TABBED MENU MOUSE ENTER EVENTS
	$("#photoplayer .tab_menu div.tab").bind('click', function()
	{
		$("#photoplayer .tab_menu div.tab.selected").removeClass("selected");
		$(this).addClass("selected");
		var id = $(this).attr('id');
		var box = "box_" + id;
		var page = "pagina_" + id;
		$("#photoplayer #photobox div#box_1, #photoplayer #photobox div#box_2, #photoplayer #photobox div#box_3").css('margin-left','-2000px');
		$("#photoplayer #photobox #"+box).css('margin-left','0px');
		var items = $("#photoplayer #photobox #"+box+" ul").attr('title');
	});
	
	// NEWSLETTER FORM
	
	$(".newsletter input#postcode_veld").bind('focus', function()
	{
		if( ( $(this).val() == "Postcode" ) )
		{
			$(this).val('');
		}
	});
	$(".newsletter input#email_veld").bind('focus', function()
	{
		if( ( $(this).val() == "E-mailadres" ) )
		{
			$(this).val('');
		}
	});
	$(".newsletter input#postcode_veld").bind('blur', function()
	{
		if( $(this).val() == '' )
		{
			$(this).attr('value', "Postcode");
		}
	});
	$(".newsletter input#email_veld").bind('blur', function()
	{
		if( $(this).val() == '' )
		{
			$(this).attr('value', "E-mailadres");
		}
	});
	
	$(".contact_block input#prov").bind('focus', function()
	{
		if( ( $(this).val() == "Welke provincie interesseert u?" ) )
		{
			$(this).val('');
		}
	});
	$(".contact_block input#prov").bind('blur', function()
	{
		if( $(this).val() == '' )
		{
			$(this).attr('value', "Welke provincie interesseert u?");
		}
	});
	$(".contact_block input#regio").bind('focus', function()
	{
		if( ( $(this).val() == "Welke regio interesseert u?" ) )
		{
			$(this).val('');
		}
	});
	$(".contact_block input#regio").bind('blur', function()
	{
		if( $(this).val() == '' )
		{
			$(this).attr('value', "Welke regio interesseert u?");
		}
	});
	$(".contact_block input#proj").bind('focus', function()
	{
		if( ( $(this).val() == "Welk project interesseert u?" ) )
		{
			$(this).val('');
		}
	});
	$(".contact_block input#proj").bind('blur', function()
	{
		if( $(this).val() == '' )
		{
			$(this).attr('value', "Welk project interesseert u?");
		}
	});
	
	
});







	
		/*	
			// mouseleave
			$("#middle_right .overview_image").bind('mouseleave', function()
			{
				// $(this).removeClass("selected");
				// $(this).animate({"width":"100px"}, {duration:100, queue:false});
				$(this).find(".overview_white").animate({"opacity":"0.5"}, {duration:300, queue:false});
				// $("#middle_right .overview_image").animate({"width":"90px"}, {duration:200, queue:true});
				
				// $("#middle_right .overview_image").animate({"width":"100px"}, {duration:200, queue:false});
				
				/* $(this).find(":first-child").animate({"margin-left":"0px"}, {duration:500, queue:false}); */
				/* $(this).find(":nth-child(2)").animate({"opacity":"0.5"}, {duration:500, queue:false}); */
				/* $("#project_name").html("");
			});
	
	
	
	
	*/
		
		
	
	


/*
	$('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	*/
	
	
		/*
		if(selected_id = 1 )
		{
			// nummer 2 komt tevoorschijn
			// $('#homepage_rotate_image #1').hide();
			// $('#homepage_rotate_image #1').removeClass("selected");
			$('#homepage_rotate_image #2').show();
			// $('#homepage_rotate_image #2').addClass("selected");
			
		}
		if(selected_id = "2")
		{
			// nummer 3 komt tevoorschijn
			$('#homepage_rotate_image #2').hide();
			$('#homepage_rotate_image #2').removeClass("selected");
			$('#homepage_rotate_image #3').show();
			$('#homepage_rotate_image #3').addClass("selected");
		}
		if(selected_id = "3")
		{
			// nummer 1 komt tevoorschijn
			$('#homepage_rotate_image #3').hide();
			$('#homepage_rotate_image #3').removeClass("selected");
			$('#homepage_rotate_image #1').show();
			$('#homepage_rotate_image #1').addClass("selected");
			
		}
		*/
		
		/*
		$('#foo').bind('click', function() {
			  alert('User clicked on "foo."');
			});
		// $(location).attr('href', 'index.php?page=projecten');
		// top.location="index.php?page=projecten&proj_id=4").delay(300);
		$("#middle_right").delay(1000).bind(function() 
		{
			*/
			// $('#middle_right').fadeOut('slow').delay(1000).bind(redirect()).delay(1000);
				// $(this).parent(".main-window").hide();
			/*
		});
		/*
		});
			$("#cancel-button").click(function() {
			  $("#close-button").stopTime();
			});
			
		/* INIT PROJECT PREVIEW SELECTED IMAGE
	if( $('#project_top img:visible').attr('id') == $(this).attr('name') )
	{
		var big_id = $(this).attr('name');
		$('#selected_'+big_id).show();
	}
	
	// mouseover
	$("#middle_right .overview_image").bind('mouseenter', function()
	{
		// $(this).addClass("selected");
		// $("#middle_right .overview_image:not('.selected')").animate({"width":"90px"}, {duration:100, queue:false});
		// $('#foto_box .homepage_foto').animate({"width":"108px"}, {duration:400, queue:false});
		// $(this).animate({"width":"150px"}, {duration:400, queue:false});
		// $(this).find(":nth-child(2)").animate({"opacity":"0.5"}, {duration:500, queue:false});
		// $(this).find(":first-child").animate({"margin-left":"-8px"}, {duration:500, queue:true});
		$(this).find(".overview_white").animate({"opacity":"0.0"}, {duration:300, queue:false});
		// var name = $(this).find("img").attr('name');
		/* $("#project_name").html(name);
		
	});
	
	// mouseleave
	$("#middle_right .overview_image").bind('mouseleave', function()
	{
		// $(this).removeClass("selected");
		// $(this).animate({"width":"100px"}, {duration:100, queue:false});
		$(this).find(".overview_white").animate({"opacity":"0.5"}, {duration:300, queue:false});
		// $("#middle_right .overview_image").animate({"width":"90px"}, {duration:200, queue:true});
		
		// $("#middle_right .overview_image").animate({"width":"100px"}, {duration:200, queue:false});
		
		/* $(this).find(":first-child").animate({"margin-left":"0px"}, {duration:500, queue:false}); */
		/* $(this).find(":nth-child(2)").animate({"opacity":"0.5"}, {duration:500, queue:false}); */
		/* $("#project_name").html("");
	});
	$("#middle_right").bind('mouseleave', function()
	{
		// $(this).removeClass("selected");
		//$("#middle_right .overview_image").animate({"width":"100px"}, {duration:200, queue:true});
		
		
		
		// $("#middle_right .overview_image").animate({"width":"100px"}, {duration:200, queue:false});
		
		/* $(this).find(":first-child").animate({"margin-left":"0px"}, {duration:500, queue:false}); */
		/* $(this).find(":nth-child(2)").animate({"opacity":"0.5"}, {duration:500, queue:false}); */
		/* $("#project_name").html("");
	});
		
	$('#middle_right .overview_image').click(function () 
	{
		/* $('#middle_right').fadeOut(400);
		var s = $(this).find("img").attr('id');
		setTimeout(function(){ document.location = 'index.php?page=projecten&proj_id='+s;}, 400 ); 
		// $(window.location).delay(5000).attr('href', 'http://www.google.com').delay(5000);
 
    });
	$("#menu_bar_box li").click(function () 
	{
		// $('#middle_right').fadeOut(400);
		var s = $(this).find("a").attr('name');
		setTimeout(function(){ document.location = ''+s;} ) 
		// $(window.location).delay(5000).attr('href', 'http://www.google.com').delay(5000);
    });
	
	$(".project_preview img").mouseenter(function()
	{
		var big_id = $(this).attr('name');
		$('#selected_'+big_id).show();
		
		
	});
	
	$(".project_preview img").mouseleave(function()
	{	
		if( $('#project_top img:visible').attr('id') == $(this).attr('name') )
		{
			var big_id = $(this).attr('name');
			$('#selected_'+big_id).show();
		}
		else
		{
			var big_id = $(this).attr('name');
			$('#selected_'+big_id).hide();
		}
		//alert( $(this).attr('name'));
		
		
		// var project_big_img = $('img.project_large_image').attr('id');
		// alert(big_id)
		// $('#selected_'+project_big_img).show();
		
		
		
	});
	
		
	$(".project_preview img").click(function()
	{
		$("#project_bottom div>div").hide();
		var big_id = $(this).attr('name');
		$('#selected_'+big_id).show();
		var big_id = $(this).attr('name');
		var proj_t = $("#project_top img:visible").attr('id');
		
		$("#"+proj_t).fadeOut('fast', function()
		{
		 	$("#"+big_id).fadeIn('fast');
		 });
		
	});

	
	
	
	
	
	
	
		
			
			
			
			
		
		*/
		
		


/*
filter:alpha(opacity=80);
	-moz-opacity:0.8;
	-khtml-opacity: 0.8;
	opacity: 0.8;
*/
