// suckerFish - jQuery plugin for Drop Down Menus by Ranjan Datta - v 0.8
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

border={
	createBorder:function()
	{
		li = document.getElementById("sub_navigatie_list").getElementsByTagName('LI');
		for(i=0; i<li.length; i++)
		{
			if(li[i].parentNode.className != 'dropdown_sub_navigatie_list' &&  li[i].className != 'ndr')	
			{
				border = document.createElement('span');
				border.className = 'border';
				border.style.width = li[i].offsetWidth-1+'px';
				border.style.left = li[i].offsetLeft+1+'px';
				li[i].appendChild(border);

			}
		}
	}
}

iframe={
	
	setIframes:function(what)
	{
		
		li = document.getElementById(what).getElementsByTagName('LI');
		for(i=0; i<li.length; i++)
		{
			
			if(li[i].parentNode.className == 'dropdown_sub_navigatie_list' || li[i].parentNode.className == 'dropdown_navigatie_list')	
			{
		
				iframe = document.createElement('iframe');
				iframe.src = 'about:blank';
				iframe.scrolling = 'no';
				iframe.frameborder = 0;

				iframe.style.zIndex = -1;

				iframe.style.position = 'absolute';
				iframe.style.top = '-3px';
				iframe.style.left = '-3px';

				iframe.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';

				iframe.style.height = li[i].parentNode.offsetHeight;
				iframe.style.width = li[i].parentNode.offsetWidth;

				li[i].parentNode.appendChild(iframe);

			}

		}

	}

}


function initDropdown(){
	/* Init IE6 menu dropdowns */
	if(window.attachEvent){
		
		$("#sub_navigatie_list li").hoverClass("sfhover");
		$("#hoofd_navigatie_list li").hoverClass("sfhover");


		/* still need to implement it for main navigation */

		if($("#hoofd_content").find("select").cur != undefined && $("#hoofd_content").find("select").cur.length > 0)
		{
			
			//iframe.setIframes("hoofd_navigatie_list");

			iframe.setIframes("sub_navigatie_list");
		
		}
	}
	
	border.createBorder();
}

/* Init on load */
$(window).bind("load",initDropdown);

