$(document).ready(function(){Cufon.set('fontFamily','PtSans').replace('#content h1')('h2')('dt')('.fReplace')('#gegevens address')('#meerinfo')('#the-url')('#home-projecten span');Cufon('#content h1, #column-right dt, #meerinfo',{textShadow:'1px 2px #FFF'});$('#home-projecten a').hover(function(){$(this).children('span').animate({'height':35,'text-indent':0},200,'easeInCirc');},function(){$(this).children('span').animate({'height':0,'text-indent':-9999},300,'easeOutBack');});$("#the-url").hover(function(){$(this).append(' <a id="link-go">&raquo;</a>');},function(){$('#link-go').remove();});$('#meerinfo a').click(function(){$('input#naam').focus();});$('#menu-item-173').click(function(){var scrollDistance=$('body').height()-screen.height+160;$('html').animate({scrollTop:scrollDistance},650,setFocus);return false;});function setFocus(){$('#naam').focus();}
$('footer input, footer textarea').bind('click focus',function(){$(this).prev('label').addClass('selectedLabel');});$('footer input, footer textarea').bind('keyup change',function(){if($(this).val().length>0){$(this).prev('label').fadeOut();}else{$(this).prev('label').fadeIn();}});$('footer input, footer textarea').bind('load blur',function(){if($(this).val().length<1){$(this).prev('label').removeClass('selectedLabel').fadeIn();}else{$(this).prev('label').hide();}});$('.form-element').click(function(){$(this).find('.formerror').remove();$(this).children('input,textarea').focus().prev('label').addClass('selectedLabel');});var currentImg=null;var currentActive=null;var speed=700;$('#thumbnails a').click(function(){var imageID=this.id.split('-');if(currentImg!==null){currentImg.fadeOut(speed);}
currentImg=$('#portfoliobig-'+imageID[1]).fadeIn(speed);if(currentActive!==null){currentActive.removeClass('active');}
currentActive=$(this).addClass('active');});$('#contact-form').submit(function(){var formData=$(this).serialize();$.ajax({url:this.action,type:'POST',dataType:'json',data:'action=send_mail&'+formData,success:function(results){if(results.error){if(results.error.naam){$('#naam-wrap').addClass('error').append('<div id="naam-formerror" class="formerror">'+results.error.naam+'</div>');}else{$('#naam-wrap').removeClass('error');$('#naam-formerror').remove();}
if(results.error.email){$('#mail-formerror').remove();$('#mail-wrap').addClass('error').append('<div id="mail-formerror" class="formerror">'+results.error.email+'</div>');}else{$('#mail-wrap').removeClass('error');$('#mail-formerror').remove();}
if(results.error.bericht){$('#bericht-wrap').addClass('error').append('<div id="bericht-formerror" class="formerror">'+results.error.bericht+'</div>');}else{$('#bericht-wrap').removeClass('error');$('#bericht-formerror').remove();}}else if(results.success){$('.formerror').remove();$('.form-element').removeClass('error');$('#verzenden').replaceWith('<div id="succes">Je bericht is verzonden!</div>');}}});return false;});$.getJSON('http://api.twitter.com/1/statuses/user_timeline/metatalk.json?callback=?',function(tweet){$('#tweets').html('<li>'+tweet[0].text+'</li><li>'+tweet[1].text+'</li><li style="border:none;">'+tweet[2].text+'</li>');});});
