/* 
 * @author Bram Van Damme <bramus@netlash.com>
 */
 
/* 
 * Dynamically replaces the topnav with flash versions of the buttons and injects the header
 * ----------------------------------------------------
 */

	jQuery(document).ready(function($) {
									
		/*
		 * Topnav
		 * ----------------------------------------------------
		 */
							
			// colors and sounds to be used
			var ewColors	= Array('0x26354c', '0x3e5474', '0x4d6075', '0x7398a5', '0x50afb8');
			var ewSounds	= Array('onderdestars.mp3', 'fantastisch.mp3', 'komendansmetmij.mp3', 'waauw.mp3', 'geweldig.mp3');
			
			// get all li's
			$('#navigationtop ul li').each(function(i) {
				// create new SWFObject and write it to the li
				var swfObj = new SWFObject("/modules/core/layout/swf/button.swf?fvColor=" + ewColors[i] + "&fvText=" + $(this).find('a').html() + "&fvSound=/modules/core/layout/swf/sounds/" + ewSounds[i] + "&fvUrl=" + $(this).find('a').attr('href'), $(this).attr('id'), "217", "36", "9", "#000000");
				swfObj.addParam("wmode", "transparent");
				swfObj.write($(this).attr('id'));
			});
									
		/*
		 * Header
		 * ----------------------------------------------------
		 */
		
			// possible headers
			var ewHeaders	= Array('header.swf', 'header2.swf', 'header3.swf', 'header4.swf', 'header5.swf');
			var ewSounds	= Array('onderdestars.mp3', 'fantastisch.mp3', 'komendansmetmij.mp3', 'waauw.mp3', 'geweldig.mp3');
			var ewText		= Array('Onder de stars!', 'Fantastisch!', 'Kom en dans met mij!', 'Waauw!', 'Geweldig!');
						
			// define random header and random sounds/text
			var randHead	= Math.round(Math.random() * (ewHeaders.length - 1));
			var randSound	= Math.round(Math.random() * (ewSounds.length - 1));
						
			// inject it
			var swfHeader = new SWFObject("/modules/core/layout/swf/" + ewHeaders[randHead] +"?fvText=" + ewText[randSound] + "&fvSound=/modules/core/layout/swf/sounds/" + ewSounds[randSound] + "&fvUrl=http://" + window.location.host, "header", "727", "335", "9", "#000000");
			swfHeader.addParam("wmode", "transparent");
			swfHeader.write('header_flash');
		
	});