/* <![CDATA[ */
$(document).ready(function(){
	$("input, textarea").focus(function(){if(this.value == this.defaultValue){this.value = '';}});
	$("input, textarea").focus(function(){$(this).css('color','#666')});
	$("input, textarea").blur(function(){if(this.value == ''){this.value = this.defaultValue;}});
	$("input, textarea").blur(function(){$(this).css('color','#999')});
	
	$("#inlogLink").click(function(){	
		if ($("#loginBoxContainer").is(":hidden")) {
			$("#loginBoxContainer").slideDown("slow");
		} else {
			$("#loginBoxContainer").slideUp();
		}
		return false;
	});
	
	$('form##loginForm input').keypress(function(e){
		if(e.which == 13){
			$('form#loginForm').submit();
		}
	});
	
	$("#blogSingleContent img").lazyload({ 
	    placeholder : "img/grey.gif",
    	effect : "fadeIn",
    	threshold : 300
	});
	
	$("#menu a").live('click',function(){
	
		$("#menu a").removeClass("huidigePagina");
		$(this).addClass("huidigePagina");
	
	});
	
	$("#submitContact").click(function() {
	
		$('#contactLoader').show();
		
		
		var naam = $("input[name=naam]").val();
		var email = $("input[name=email]").val();
		var bedrijf = $("input[name=bedrijf]").val();
		var website = $("input[name=website]").val();
		var bericht = $("textarea[name=bericht]").val();
		var bericht2 = escape(bericht);
		var dataString = 'naam='+ naam + '&email='+ email + '&website='+ website + '&bedrijf='+ bedrijf + '&bericht='+ bericht2;

		if(naam=='' || naam=='Naam') {
			$('#statusContact').html('Je hebt je naam niet ingevuld...');
			$('#statusContact').fadeIn(500).show();
		} else if(email=='' || email=='E-mail') {
		$('#statusContact').html('Je hebt je e-mail niet ingevuld...');
			$('#statusContact').fadeIn(500).show();
		} else if(bericht=='' || bericht=='Jouw bericht...') {
		$('#statusContact').html('Je hebt geen bericht ingevuld...');
			$('#statusContact').fadeIn(500).show();
			
		} else {
			$.ajax({
			  type: "POST",
			  url: "http://www.yummygum.nl/wp-content/themes/yummygum2/ajax/contactForm.php",
			  data: dataString,
			  success: function() {
				$('#statusContact').fadeOut(200).hide();
				$('#contactFormContainer').slideUp('slow');
				$('#contactFormResult').fadeIn('slow');
			  }
			}); 
		
		}
		$('#contactLoader').hide();
		return false;
	});

});
/* ]]> */