$.fn.tooltip=function(bericht,fade1,fade2,fad3){var main=$(this).parent();main.append('<div class="tooltip">'+bericht+'</div>');var tip=main.find('.tooltip');tip.fadeIn(fade1).animate({opacity:1.0},fade2).fadeOut(fad3,function(){tip.remove()});return this};$.fn.rollOver=function(){$(this).mouseover(function(e){var main=$(this).parent();if(main.find(".smallfotobox").length==0)main.append('<div class="smallfotobox"><img src="'+$(this).attr('href').replace(700,200)+'" alt="" /></div>');var element=main.find(".smallfotobox");element.fadeIn(50)});$(this).mousemove(function(e){var main=$(this).parent();var element=main.find(".smallfotobox");var height=element.find("img").height()+20;var top=$(window).height()-e.clientY;if(top>height)top=0;else top=height-top;element.css({top:e.pageY-top,left:e.pageX+20})});$(this).mouseout(function(e){var main=$(this).parent();if(main.find(".smallfotobox").length==1)main.find(".smallfotobox").fadeOut(50)});return this};$.fn.winkelSwitch=function(){$('#wijzigen').hide();var e=this;var velden=null;var runReload=false;$.getJSON("/account/?action=registerOptions",function(data){velden=data;if(runReload)$(e).trigger('change')});$(this).change(function(){if(velden!=null){runReload=false;$('.velden').hide();$('.velden .vereist').text('');var key=$(this).val();key=velden['ref'][key];for(var field in velden[key]){$('#'+field).show();if(velden[key][field]['verplicht']==true)$('#'+field+' .vereist').text('*');if(velden[key][field]['naam'])$('#'+field+' th label').text(velden[key][field]['naam'])}}else{runReload=true}})}