// JavaScript Document
function CufonReplace() {
	Cufon.replace('.subnav-container a', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.subnav-container .kop', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('#leftcol a', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('#leftcol .kop', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('#hoofdnav a', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('h1', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('h2', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('h3', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.copytext', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('#footerlinks a', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.subsubnav a', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.reserveren', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.meerinfo', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.quote', { fontFamily: 'Caliban Std', hover: true } );
	Cufon.replace('.formulier-kop', { fontFamily: 'Caliban Std', hover: true } );
	
}



function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}


function StopFlashMovie()
{
	var flashMovie=getFlashMovieObject("FlashID");
	flashMovie.StopPlay();
}

function PlayFlashMovie()
{
	var flashMovie=getFlashMovieObject("FlashID");
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}


function setOut() { 

}

$(document).ready(function(){ 
	
	if ($.browser.msie && $.browser.version.substr(0,1)<8) {
		
		$(".jquery-selectbox").css("position", "relative");
		$(".jquery-selectbox").css("z-index", "1");
		
		$(".veld-wrapper").mouseenter(function(){
	  		$(".jquery-selectbox-list").css("display", "none");
			$(".veld-wrapper").css("position", "relative");
			$(".veld-wrapper").css("z-index", "1");
			$(this).css("z-index", "1000");
			$(this).children().children(".jquery-selectbox-list").css("z-index", "1000");
    	});	
		$(".jquery-selectbox-item").mouseleave(function(){
			$(".veld-wrapper").css("position", "relative");
			$(".veld-wrapper").css("z-index", "1");
			$(this).children().children(".jquery-selectbox-list").css("z-index", "1");
			$(".jquery-selectbox-list").css("display", "none");
    	});
	}
	
	$(".datepicker").datepicker({
			showOn: "button",
			buttonImage: "../afbeeldingen/kalender_icon.gif",
			buttonImageOnly: true,
			dateFormat: 'dd/mm/yy' 
		});

//	$("#home-sfeer1").rotate(16);
//	$("#home-sfeer-wrap1").css("visibility","visible");

//	$("#home-sfeer2").rotate(-6);
//	$("#home-sfeer-wrap2").css("visibility","visible");

	$(".replace-select").selectbox();
	
	$('#fotowrapper-cycle').cycle('fade');	
	
	$("#bestemming").change(function() { 
		var str = "";
		$("#bestemming option:selected").each(function () {
			str += $(this).val();
		});
		$("#hotel-box").load("http://www.dkts.nl/ajax/hotel-box.php?bestemming="+str, function() {
			  $(".replace-select").selectbox();
		});		
	 });
	

	$('.tab').live('click', function() {
		var url = $(this).attr("href");
//		$("#description").empty().load("http://www.dkts.nl/ajax/detail.php?url="+url);
//		return false;
	});
	
	$(".send-contact").click(function() { 
		$("#frm_contact").submit();	
	});
	$(".send-offerte").click(function() { 
		$("#frm_offerte").submit();	
	});

	
	$('.wegwijzer-box').live('click', function() {
		var filter = $(this).val();
		if ($(this).attr('checked')) {
			var onoff = "on";
		} else {
			var onoff = "off";
		}
		var url = window.location.pathname; 
		$(".overzicht").load("http://www.dkts.nl/ajax/reisoverzicht.php?filter="+filter+"&onoff="+onoff+"&url="+url);		
	});
	
	$("#bestemming li").live('click', function() { 
		$("#hotel").empty().load("http://www.intershow.nl/ajax/hotel.php");
	});

	$("#Aantal_personen").change(function() { 
		var aantal	= parseInt($(this).val());
		if (aantal>0) { 
			$("#pers-info").show();
			$(".pers-info-blok").hide();
			for (i=1; i<=aantal; i++) { 
				$("#persblok-"+i).show();
			} 
		} else { 
			$("#pers-info").hide();
		} 
		
		$(".replace-select").selectbox();
		
		/* AJAX bestand wordt niet meer gebruikt
		
		$.post('http://www.dkts.nl/ajax/reserveren-form.php',{aantal:aantal},
			   function(data){
				   $('#persoonlijke-informatie').empty();
				   $('#persoonlijke-informatie').html(data);
				   $(".replace-select").selectbox();
		});
		*/	
  	});

	/* 
	
	geheugensteuntje
	
	$("#id").click(function(){
	  $("#id2").animate({ 
        left: "-67"
      }, 500, "swing" );
	  $("#id").val("");
    });
	
	$("#id").click(function(event){
	  $("#id2").animate({ 
        left: "-657px"
      }, 1000, "swing" );
	  event.preventDefault();
    });
	
	
	$("#id").click(function(){
	  $("#id2").css("display", "none");
    });	
	
	$(".class").live('click',function(){
	  $(this).parent().parent(".colors").children(".selected").css("display", "none");							
	  $(this).children(".selected").css("display", "block");
		  $(".class2").animate({ 
        	top: "30"
      		}, 500, "swing",function(){ $("#alert-mask").css("display", "none");} );
    });
	*/
	
});
