$(document).ready(function(){$('ul#socialmedia-networks li.more span').click(function(){$('ul#socialmedia-networks li.display-none').fadeIn('fast',function(){$(this).removeClass('display-none')});$(this).parent().addClass('display-none');resizeFancybox();return false});$('textarea.character-counter').keyup(function(){var counter=$(this).parent().find('p span.character-count');if(!counter)return;counter.text($(this).val().length+' karakters')});$('form').validate({errorClass:'form-error',validClass:'form-valid',highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);setTimeout('resizeFancybox()',10)},unhighlight:function(element,errorClass,validClass){$(element).addClass(validClass).removeClass(errorClass);setTimeout('resizeFancybox()',10)},errorPlacement:function(error,element){if($(element)[0].parentNode.tagName.toLowerCase()=='li'){var li=$('<li class="more"></li>').append(error);$(element).closest('ul').append(li)}else error.appendTo(element.parent())},rules:{'data[pwd1]':{required:true,minlength:5},'data[pwd2]':{required:true,equalTo:'#pwd1'}},messages:{'data[provider]':{required:'Please let us know where you want to share this message!'},'data[pwd1]':{minlength:jQuery.format('Gebruik een wachtwoord van minimaal {0} karakters lang')}}});var field=$('input.validate-nickname');if(field.length)field.rules('add',{remote:parent.board_script_url+'?action=validate_nickname',messages:{remote:'Deze gebruikersnaam is al in gebruik'}});var field=$('input.validate-email');if(field.length)field.rules('add',{remote:parent.board_script_url+'?action=validate_email',messages:{remote:'Dit emailadres is al in gebruik'}});$('ul#socialmedia-networks li a').click(function(){top.document.location=$(this).attr('href');return false});$('ul#socialmedia-networks li input[type="radio"]').change(function(){$(this).closest('ul').find('li').removeClass('selected');$(this).closest('li').addClass('selected');$(this).closest('form').find('fieldset.display-none').fadeIn('fast',function(){$(this).removeClass('display-none')});$(this).closest('form').find('div.submit.display-none').fadeIn('fast',function(){$(this).removeClass('display-none')});resizeFancybox()});if($('ul#socialmedia-networks li input[type="radio"][checked="checked"]').length){var selected=$('ul#socialmedia-networks li input[type="radio"][checked="checked"]');$(selected).closest('li').addClass('selected');$(selected).closest('form').find('fieldset.display-none').fadeIn('fast',function(){$(this).removeClass('display-none')});$(selected).closest('form').find('div.submit.display-none').fadeIn('fast',function(){$(this).removeClass('display-none')})};$('label.form-suggestion').each(function(){var label=this;$(this).parent().find('input').change(function(){$(label).fadeOut('fast')})});$('span.text-button.previous-page').click(function(){window.history.back()});$('span.text-button.close-lightbox').click(function(){parent.$.fancybox.close();if($(this).hasClass('auto-reload'))parent.document.location=parent.document.location.protocol+'//'+parent.document.location.host+parent.document.location.pathname});$('span.text-button.close-lightbox span.countdown').countdown({seconds:3,callback:'parent.$.fancybox.close()'});$('span.show-form').click(function(){$(this).closest('div').find('form').fadeIn('fast',function(){$(this).removeClass('display-none');resizeFancybox()})});resizeFancybox()})
function resizeFancybox(){var height=$(document.body).innerHeight();parent.$('div#fancybox-wrap').height(height+20);parent.$('div#fancybox-inner').height(height)};jQuery.fn.countdown=function(options){if(!options)options='()';if(jQuery(this).length==0)return false;var obj=this;if(options.seconds<0||options.seconds=='undefined'){if(options.callback)eval(options.callback);return null};window.setTimeout(function(){jQuery(obj).html(String(options.seconds));--options.seconds;jQuery(obj).countdown(options)},1000);return this}

