
$(document).ready(function()
{
	sIFR.replaceElement(named({ sSelector:"body h2", sFlashSrc:submap+"/fla/titel.swf", sColor:"#333333", sBgColor:"#FFFFFF", sWmode:"transparent" }));
	sIFR.replaceElement(named({ sSelector:"body h3", sFlashSrc:submap+"/fla/titel2.swf", sColor:"#FFFFFF", sBgColor:"#FFFFFF", sWmode:"transparent" }));
	sIFR.replaceElement(named({ sSelector:"body h4", sFlashSrc:submap+"/fla/titel2.swf", sColor:"#FFFFFF", sBgColor:"#FFFFFF", sWmode:"transparent" }));

	$("#formulier-jubileum._particulieren .dag_selectie").change(function(){
			
		/*dag_naam_class = this.className.split(" ")[1];

		if ($('input', this).is(':checked'))
		{
			$('.aantal_personen input').not('.aantal_personen_' + dag_naam_class + ' input').val('');
			$('.aantal_personen').hide();
			$('.aantal_personen_' + dag_naam_class).show();
		}
		else
		{
			$('.aantal_personen input').not('.aantal_personen_' + dag_naam_class + ' input').val('');
			$('.aantal_personen').hide();
		}*/
		
		dag_naam_class = this.className.split(" ")[1];

		if ($('input', this).is(':checked'))
		{
				
			$('.aantal_personen_' + dag_naam_class).show();
		}
		else
		{
			dag_naam_class = this.className.split(" ")[1];
			//$('.aantal_personen input').not('.aantal_personen_' + dag_naam_class + ' input').val('');
			$("#formulier-jubileum._particulieren .dag_selectie input[type='checkbox']").each(function()
			{

				if( $('input', this).not(':checked') )
				{					
					$('.aantal_personen_' + dag_naam_class).hide();	
					//$('.aantal_personen_ '+ dag_naam_class + ' input.input').val('');
					$('.aantal_personen_' + dag_naam_class + ' input').not(':checked').val('');
				}
			});
		}		
	});
	
	
	
	$("#formulier-jubileum._bedrijven .dag_selectie").change(function(){
			
		dag_naam_class = this.className.split(" ")[1];

		if ($('input', this).is(':checked'))
		{
				
			$('.aantal_personen_' + dag_naam_class).show();
		}
		else
		{
			dag_naam_class = this.className.split(" ")[1];
			//$('.aantal_personen input').not('.aantal_personen_' + dag_naam_class + ' input').val('');
			$("#formulier-jubileum._bedrijven .dag_selectie input[type='checkbox']").each(function()
			{

				if( $('input', this).not(':checked') )
				{					
					$('.aantal_personen_' + dag_naam_class).hide();					
				}
			});
		}

	});
	
	$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
			.animate({
				width: '477px', 
				height: '486px'
			}, 500); 
		} , function() {
		$("#pageflip img").stop() 
			.animate({
				width: '145px', 
				height: '152px'
			}, 220);
		$(".msg_block").stop() 
			.animate({
				width: '145px', 
				height: '145px'
			}, 200);
	});
	
		
	/* Hover op menu 
	$("#menu>ul>li").hover(
	function()
	{
		$(this).addClass("hover");
		$(">ul", this).hide().slideDown(300);
	},
	function()
	{
		$(">ul", this).show().slideUp(300);
		$(this).removeClass("hover");
	});*/
	
   /* --------------------------------	*/
	/* menu						 		*/
	/* --------------------------------	*/
	var menu = {};
	
	menu.laatstGeopend = null;
	menu.timeoutTime = 2000;
	menu.timeout = null;
	
	menu.init = function()
	{
		/* hover op li */
		$("#menu>ul>li").hover(
			function() 
			{ 		
				// als laatstegeopend dezelfde is als de huidige, dan de timeout verwijderen
				if($(this).hasClass("hover"))
				{
					clearTimeout(menu.timeout);
				}
				// nieuwe uitschuiven
				else
				{
					$("#menu>ul>li>ul").hide();
					$("#menu>ul>li").not(this).removeClass("hover");
					
					$(this).addClass("hover");	
					$(">ul", this).hide().slideDown(300);
					
					// selectbox in <ie7 verwijderen
					if($.browser.msie && $.browser.version < 7)	{
						$("select").css({ visibility: 'hidden' });	
					}
				}
			},
			function() 
			{ 
				// timeout zetten om na x aantal sec te sluiten
				menu.laatstGeopend = this;
				menu.timeout = setTimeout(function()
				{
					$(menu.laatstGeopend).removeClass("hover"); 
					$(">ul", this).hide().slideUp(300);
					
					// selectbox in <ie7 tonen
					if($.browser.msie && $.browser.version < 7)	{
						$("select").css({ visibility: 'visible' });	
					}
				}, menu.timeoutTime);
			}
		);
	}

	menu.init();
	
	/* hover op submenu */
	$("#menu>ul>li>ul>li").hover(
		function() 
		{ 
			$(this).addClass("hover");
		},
		function() 
		{ 
			$(this).removeClass("hover");
		}
	);
			
	/* hover op occasion */
	$("ul#occasionoverzicht>li").hover(
		function() 
		{ 
			$(this).addClass("hover");
			$("p", this).addClass("hover");
			$("a", this).addClass("hover");
		},
		function() 
		{ 
			$(this).removeClass("hover");
			$("p", this).removeClass("hover");
			$("a", this).removeClass("hover");
		}
	);
	
	/* link op occasion */
	$("ul#occasionoverzicht>li").click(function()
	{
		window.location = $("a", this).attr("href");
	});
	
	$("ul#occasionoverzicht>li.geen_occasions").unbind( "click" );
			
	var bezig = false;
	/* occasion detail foto's */
	$(".miniaturen a").click( function()
	{	
		if (bezig == true) return false;
		
		bezig = true;
		
		$("#middel img").fadeOut(500, function()
		{
			$(this).attr("src", $(this).parent().attr("href") ).fadeIn(500, function()
			{
				bezig = false;
			});
			
		}); // middel afbeelding tonen
		
		$("#middel").attr("href", $(this).attr("rel") );
		
		return false;
	});
	
	
	
	// als flash geladen is dan pas tonen				
	$(document).ready( function()
	{								
	$("#flashimg").css({ visibility:"visible" });
	});

});


	function openFancybox( _rurl )
	{
		$.fancybox(/*'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="700">  <param name="movie" value="' + submap + '/fla/bladerboek/demo_xml.swf?extXML=' + submap + '/fla/bladerboek/config.xml"><param name="quality" value="high"><embed src="' + submap + '/fla/bladerboek/demo_xml.swf?extXML=' + submap + '/fla/bladerboek/config.xml" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="982" height="788"></embed></object>',*/
{
			'href'				: _rurl,
			'width'				: 980,
			'height'			: 730,
			'autoScale'			: true,
			'type'				: 'iframe',
			'scrolling'			: false,
			'titleShow'			: false,
			/*'centerOnScroll'	: true,*/
			'opacity'			: true,
			'margin'			: 5,
			'padding'			: 2,
			'onStart'			: function(){/*$("#container").hide();*/$("#bigDiv").hide();$("#smallDiv").hide();},
			'onClosed'			: function(){/*$("#container").show();*/$("#bigDiv").show();$("#smallDiv").show();}
		});

	}



