/* --------------------------------	*/
/* flash object	plaatsen			*/
/* --------------------------------	*/
$.fn.flash = function(options)
{
	// opties
	defaults = {
		quality		: "best",
		wmode		: "opaque",
		flashVars	: {}
	};
	
	o = $.extend(defaults, options);
	o.flashVars = $.param(o.flashVars);
	
	$(this).jmedia({ 
		version		: "7,0",
		elemType	: this.tagName,
		elemClass	: $(this).attr("class")
	}, o);	
	
	return this;
};


$(function()
{
	
	/* --------------------------------	*/
	/* hover met klikerachter			*/
	/* --------------------------------	*/
	$("#zijbalk > div, #frontpage .info > div, #assortiment li")
		.hover(
			function() { $(this).addClass("hover");		}, 
			function() { $(this).removeClass("hover");	}
		)
		.click(function() { 
			window.location = $("a:first", this).attr("href");
		})
	;
	
});


	
/* --------------------------------	*/
/* menu flash						*/
/* --------------------------------	*/
function zetMenu()
{
	// is er de flash plugin geinstaleerd?
	if(_jm.detectPluginVersion("flash"))
	{
		// actieve index ophalen
		var actieve_index = 0;
		$("#menu li").each(function(index) {
			if(this.className == 'actief')
			{
				actieve_index = index;
				return false;
			}
		});
		
		var flash_vars = {
			naam_home		: $("#menu a.home").attr("title"),
			link_home		: $("#menu a.home").attr("href"),
			
			naam_assortiment: $("#menu a.assortiment").attr("title"),
			link_assortiment: $("#menu a.assortiment").attr("href"),
			
			naam_dealers	: $("#menu a.dealers").attr("title"),
			link_dealers	: $("#menu a.dealers").attr("href"),
			
			naam_wie_is_wanders: $("#menu a.wie").attr("title"),
			link_wie_is_wanders: $("#menu a.wie").attr("href"),
			
			naam_contact	: $("#menu a.contact").attr("title"),
			link_contact	: $("#menu a.contact").attr("href"),
			
			taal			: $("html").attr("lang"),
			actief_index	: actieve_index			
		};
		
		$("#menu ul").replaceWith("<div class=\"flash\"><\/div>");
		$("#menu .flash").flash({
			src					: config.submap + "/fla/menu.swf",
			width				: 800,
			height				: 55,
			wmode				: 'transparent',
			menu				: false,
			flashVars			: flash_vars
		});
	}	
}