// Homemade Catering op maat - script.js - Zen versie
function IEO(){if(this.style.removeAttribute) this.style.removeAttribute('filter')};
//$(window).hashchange(function(){var h=location.hash,p=$(h+'_'),x='.pages .open';if(p[0]){function done(){$(x+',.tabs .open').removeClass('open');$(h+'_,.tabs a[href$='+h+']').addClass('open');p.css('marginTop',-p.height()-40);p.animate({marginTop:0},'slow');$('.pic .pics').addClass('hidden');$('.pic .pics.ss_'+h.substr(1)).removeClass('hidden')};$(x)[0]?$(x).animate({marginTop: -$(x).height()-140},400,'swing',done):done()}});
$(window).hashchange(function(){var h=location.hash;if($(h+'_')[0]){$('.tabs .open').removeClass('open');$('.pages .open:not('+h+')').addClass('closing').fadeTo(1000,0,function(){$(this).removeClass('closing open')});$(h+'_').addClass('open').fadeTo(1000,1,IEO);$('.tabs a[href$='+h+']').addClass('open');$('.pic .pics').addClass('hidden');$('.pic .pics.ss_'+h.substr(1)).removeClass('hidden')}});
$('.content.hidden').fadeTo(0,0)[0]?$(window).scroll(function(){if(!$('.content.hidden')[0])return;var sy=$(window).scrollTop(),wh=$(window).height(),l=$('.content.hidden').prev();if(l.offset().top-sy-wh+l.height()<0)$('.content.hidden:first').removeClass('hidden').fadeTo(500,1)}):0;
//$(window).hashchange(function(){var h=location.hash;if($(h+'_')[0]){$('.pages .open,.tabs .open').removeClass('open');$(h+'_,.tabs a[href$='+h+']').addClass('open');$('.pic .pics').addClass('hidden');$('.pic .pics.ss_'+h.substr(1)).removeClass('hidden')}});
$('.blogpost').each(function(){var s=$('<div class="slideshow"></div>');$(this).find('img:first').before(s);$(this).find('img').each(function(){while($(this).next('br').remove()[0]);s.append($(this))})});
$('form').submit(function(){if(!$(this).find('.verpl').val().length){alert('Niet alle verplichte velden zijn ingevuld.');return false}});
$('form .verpl').keyup(function(){$(this)[($(this).val()?'remove':'add')+'Class']('verpl')}).keyup();
$('.home .blogpost .slideshow,.home .blogpost p:not(:first)').css('display','none');
$('.page').fadeTo(0,0).each(function(){$(this).attr('id',$(this).attr('id')+'_')});
setTimeout(function(){$('.home .blogpost').fadeTo(1000,1,IEO)},1000);
$('#blocks').fadeTo(0,0).css('display','block').fadeTo(2000,1,IEO);
$('.content a[href^=http]').attr('target','_blank');
$('.slideshow').cycle({fx:'fade'});
$('.home .blogpost').fadeTo(0,0);
$(window).hashchange();

