$(document).ready(function()
{
	var height = $(document).height();
	var browser_height = $(window).height();
	var browser_width = $(window).width();
	if($.browser.msie != true)
	{
		height += 10;
	}
	
	$("div#page").css("height", height + "px");
	
	$("input#newsletteroptin").focus(function()		{ if(this.value == "e-mailadres") { this.value = ""; } });
	$("input#newsletteroptin").blur(function()		{ if(this.value == "") { this.value = "e-mailadres"; } });
	$("input#contactnaam").focus(function()			{ if(this.value == "naam") { this.value = ""; } });
	$("input#contactnaam").blur(function()			{ if(this.value == "") { this.value = "naam"; } });
	$("input#contactemail").focus(function()		{ if(this.value == "email") { this.value = ""; } });
	$("input#contactemail").blur(function()			{ if(this.value == "") { this.value = "email"; } });
	$("textarea#contactbericht").focus(function()	{ if(this.value == "bericht") { this.value = ""; } });
	$("textarea#contactbericht").blur(function()	{ if(this.value == "") { this.value = "bericht"; } });
	
	if(!($.browser.msie == true && $.browser.version == "6.0"))
	{
		$("div#grass").css("display", "block");
		$("div#dropshadow_top").css("display", "block");
		$("div#dropshadow_bottom").css("display", "block");
		
		// Create random clouds
		var numclouds = Math.ceil(Math.random() * 2)+6;
		for(var i = 0; i < numclouds; i++)
		{
			var cloudnum = Math.ceil(Math.random() * 3);
			$("body").append("<div class=\"cloud\"><img src=\"images/mains/cloud.png\" /></div>");
			$("div.cloud").eq(i).css("top", Math.ceil(Math.random() * (browser_height-250)) + "px");
			$("div.cloud").eq(i).css("left", Math.ceil(Math.random() * browser_width) + "px");
		}
		
		// Move them each 250ms
		//var cloudtimer = new Timer(250, moveClouds);
		//cloudtimer.startTimer();
	}
	
	function moveClouds()
	{
		/*var clouds = $("div.cloud");
		for(var i = 0; i < numclouds; i++)
		{
			var cloud = clouds.eq(i);
			var top = parseInt(cloud.css("top").replace("px", ""));
			var left = parseInt(cloud.css("left").replace("px", ""));
			
			if(left > (browser_width + cloud.width()))
			{
				cloud.css("left", 0 - cloud.width() + "px");
				cloud.css("top", Math.ceil(Math.random() * (browser_height-250)) + "px");
			}
			else
			{
				cloud.css("left", left + 2);
			}
		}*/
	}
});