var setNone = new Array("#kaartwereld", ".popupform", "#onlineboeken")
var closeImg = new Image(); closeImg.src = serverRoot+"images/pages/close.png"; closeImg.id = "CloseButton";
var dialogact;
var dialogOwner = "";
var mapWidth = 680;
var mapHeight = 630;
var ajxParams;
var ajxVars;
var posX;
var posY;
var boekNLBE = "NLBE";
var boekpagina;
var tochtInfoID = 0;
var showMenuTab = false;
var openMenuTab = "";
var fotoCacheNumber = 10;
var fotoCacheStart = 0;
var fotoCacheMax = 0;
var activeBoekTab = 'boekingDeelnemers';
var activeTabID = 'boektab1';
var goNextBoekTab = false;
var checkCount = 0;
var nrDeelnemers = 0;
var prevDir
var prevmt = 0;
var vok = false;
var rotatieTime = 3000
var promoItem = 0
var nostop = true

$(document).ready(function(){
  $("#pageHost").html(serverRoot);
  $(document).mousemove(function(e){posX = e.pageX; posY = e.pageY;});
  $("div.klikcont").click(function(){raiseDialog($(this).attr("dialog"))});
  $("span.klikcont").click(function(){raiseDialog($(this).attr("dialog"))});
  $("div.klikurl").click(function(){jumpPage($(this).attr("dialog"))});
  $("#kaartwereld").css({display: "none"});
  $("#zoektabwereld").css({"border-bottom-color":"#5b5b5b","color":"#5b5b5b"});
  $('area').click(function(){showCountryMap($(this).attr('alt'),$(this).attr('lid'));});
  $('.menuitem').mouseover(function(){displayMenu(this.id, $(this).attr('mitem'), $(this).attr('mpos'))});
  $('.menuitem').mouseout(function(){if (!showMenuTab){ setOrigMenu(); $(".menusel").removeClass("menusel").addClass("menuunsel")}});
  $('.menuitem').click(function(){setMenuTab(this.id ,$(this).attr('mitem'), $(this).attr('mpos'));});
  $('.mainmenuitems').mouseleave(function(){$(this).css("display","none");setOrigMenu();});
  $.menuHeight = $(".menuitem").height();
  $("*[id*=snelzoek]").change(function(){getCountQuickSearch()});
  $(".infoTab").click(function(){setInfoTab($(this))});
  $("*[id*=onlineboeken]").click(function(){dialogact = $(this).attr('act'); raiseDialog('onlineboeken')});
  $('[chk="Klaar"]').click(function(){setBoekTab($(this).attr("id"), 'zelf')});
  $(".bDtxt").focus(function(){if ($(this).val()==$(this).attr('deftxt')) $(this).val('');$(this).removeClass('grey1');}).blur(function(){checkInput($(this));});
  $(".bDslct").focus(function(){if ($(this).val()==$(this).attr('deftxt')) $(this).val('');$(this).removeClass('grey1');}).blur(function(){checkInput($(this));});
  $(".bTtxt").focus(function(){if ($(this).val()==$(this).attr('deftxt')) $(this).val('');$(this).removeClass('grey1');}).blur(function(){checkInput($(this));});
  $(".bTslct").focus(function(){if ($(this).val()==$(this).attr('deftxt')) $(this).val('');$(this).removeClass('grey1');}).blur(function(){checkInput($(this));});
  $(".inpfcs").focus(function(){focuscheck($(this));});
  $(".inpblr").blur(function(){inputcheck($(this));});
  $(".inpchg").change(function(){inputcheck($(this));});
  $(".infotabnavitem").click(function(){setInfoItemTab($(this));});

  $(".mapshift").mouseover(function(){ $("#mapeuropa").attr("src", serverRoot+"images/pages/kaart_europa_"+$(this).attr("alt").toLowerCase()+".png")    });
  $(".mapshift").mouseout(function(){ $("#mapeuropa").attr("src", serverRoot+"images/pages/kaart_europa_leeg.png")    });

  $("#tochtfototumbcontainer").mouseenter(function(){ pushFotoSlider($(this), 0)});
  $("#tochtfototumbcontainer").mouseleave(function(){ pushFotoSlider($(this), 55)});

  $(".boekNextTabCover").css("display","none");
  $("#boekingDeelnemers").css("background-image", "(0 0)");
  var tm = setTimeout("promoRotatie()", rotatieTime)
  if (RSB == true) {
    $(".RSB").css("display", "none");
	$(".yRSB").css("display", "inline-block");
    //$(".mainmenuitems").css("top", "+=13");
  }
});


function promoRotatie(){
	promoItem++;
	if (promoItem > 5) promoItem = 0
	nostop = true
	$("#foto"+promoItem).click();
	nostop = false
	tm = setTimeout("promoRotatie()", rotatieTime)
	return
}


function setFotoreis(src, a_id, alt, fid){
 		ajxParams = {a_id: a_id, func: 'getFotoreisData'};
		ajxVars = {act: 'html', trget: '#fotoreisInfotext'};
		genAjxHandler();
		$(".fotoreisThumbSel").removeClass("fotoreisThumbSel")
		$("#foto"+fid).addClass("fotoreisThumbSel")
		$("#fotoreisFoto").attr("src", src).attr("alt", alt).attr("title", alt);
		$("#fotoreisInfotext").attr("tid", a_id);
		if (!nostop) clearTimeout(tm)

}


function popupAanbieding(id, type, lnk){
   if (!lnk) lnk = "link";
  ajxParams = { abnid:id,func: "showAanbieding",type:type, lnk:lnk}
  ajxVars = {act: "userdefined", trget: "showAanbieding"};
  genAjxHandler();
}

function setPageTab(tab){
  $(".infotabtab").css({"color":"#5b5b5b"}) ;
  $("#"+tab.attr("id")).css({"color":"#1c7d2e", "font-weight":"bold"}) ;
  $(".infotabs").css("display", "none")
  $("#"+tab.attr("tab")).css("display", "block");
  $("#"+tab.attr("subtab")).css("display", "block");
}

function setInfoItemTab(obj){
	$(".infotabitem").css("display","none");
	$("#"+$(obj).attr("tab")).css("display","inline-block");
}

function sendCadobon(){
  var mm = $("#nbrfmail_me:checked").val();
if (!mm) mm = "Ja";
ajxParams = {  naam:$("#cadonaam").val(),  straat:$("#cadoadres").val(),  huisnr:$("#huisnr").val(),  pcode:$("#cadopcode").val(),  woonplts:$("#cadowoonplts").val(), email:$("#cadoemail").val(), telef:$("#cadotel").val(),
   banknr:$("#cadobanknr").val(), banknrnaam:$("#cadoreknumnaam").val(), bedrag:$("#cadobedrag").val(), datum:$("#cadodatum").val(), ontvanger:$("#cadoontvanger").val(), gever:$("#cadogever").val(), text:$("#cadotext").val(), func: "sendCadobon"}
ajxVars = {act: "userdefined", trget: "sendCadobon"};
genAjxHandler();

}

function sendNbrfnvrg(){
var sendOK = true;
  $("#nbrfform > input[chkok]").each(function(){
     thisOK = ($(this).attr("chkok") == "true");
     sendOK = (sendOK && thisOK);
     if (!thisOK) $(this).removeClass("chknormal").addClass("chkfalse");
  });

  if (!sendOK){ alert("Alle velden moeten juist zijn ingevuld voor ze verstuurd kunnen worden")}
  else {
    var mm = $("#nbrfmail_me:checked").val();
    if (!mm) mm = "ja";
    ajxParams = { aanh:$("input[name='nbrfhrmw']:checked").val(),naam:$("#nbrfnaam").val(), email:$("#nbrfemail").val(), via:$("#nbrfvia").val(), nbrfmail_me:mm,func: "sendNbrfnvrg"}
    ajxVars = {act: "userdefined", trget: "sendNbrfnvrg"};
    genAjxHandler();
  }
}



function sendAnvrgnvrg(){
  var sendOK = true;
  $("#aanvraagform > input[chkok]").each(function(){
     thisOK = ($(this).attr("chkok") == "true");
     sendOK = (sendOK && thisOK);
     if (!thisOK) $(this).removeClass("chknormal").addClass("chkfalse");
  });

  if (!sendOK){ alert("Alle velden moeten juist zijn ingevuld voor ze verstuurd kunnen worden")}
  else {
    ajxParams = {aanvraag: $("#aanvraagItem").html(), aanh:$("input[name='aanvrgahrmw']:checked").val(), naam:$("#aanvrgnaam").val(), straat:$("#aanvrgadres").val(), huisnr:$("#aanvrghuisnr").val(), pcode:$("#aanvrgpcode").val(), woonplts:$("#aanvrgwoonplts").val(), tfoon:$("#aanvrgtel").val(), email:$("#aanvrgemail").val(), waarde:$("#aanvrgaantal").val(), func: "sendAnvrgnvrg"}
    ajxVars = {act: "userdefined", trget: "sendAnvrgnvrg"};
    genAjxHandler();
  }
}


function sendGidsnvrg(){
  var sendOK = true;
  $("#gidsform > input[chkok]").each(function(){
     thisOK = ($(this).attr("chkok") == "true");
     sendOK = (sendOK && thisOK);
     if (!thisOK) $(this).removeClass("chknormal").addClass("chkfalse");
  });

  if ($("#gidscp:checked").val() == "ja"){
    $("#gacpinfo > input[chkok]").each(function(){
      thisOK = ($(this).attr("chkok") == "true");
      sendOK = (sendOK && thisOK)
       if (!thisOK) $(this).removeClass("chknormal").addClass("chkfalse");
    });
  }
var mm = $("#gamail_me:checked").val();
if (!mm) mm = "ja";

  if (!sendOK){ alert("Alle velden moeten juist zijn ingevuld voor ze verstuurd kunnen worden")}
  else {
  ajxParams = {aanh:$("input[name='gidsahrmw']:checked").val(), naam:$("#gidsnaam").val(), straat:$("#gidsadres").val(), huisnr:$("#gidshuisnr").val(), pcode:$("#gidspcode").val(), woonplts:$("#gidswoonplts").val(), tfoon:$("#gidstel").val(), email:$("#gidsemail").val(), via:$("#gidsvia").val(), gamail_me:mm,  info:$("#gidsinfo").val(), cp:$("#gidscp:checked").val(), caanh:$("input[name='gidscahrmw']:checked").val(), cnaam:$("#gidscnaam").val(), cstraat:$("#gidscadres").val(), chuisnr:$("#gidschuisnr").val(), cpcode:$("#gidscpcode").val(), cwplaats:$("#gidscwoonplts").val(), cemail:$("#gidscemail").val(), gabe_nl:$("#gabe_nl").val(), func: "sendGidsnvrg"}
  ajxVars = {act: "userdefined", trget: "sendGidsnvrg"};
  genAjxHandler();
  }
}


function inputcheck(obj){ //alert("hoi");
  var chkid = $(obj).attr("id");
  var checkme = $(obj).attr("chk");
  var valueOK = true;
  var val = $(obj).val();
  if (checkme == "rdb") val = $("#"+chkid+":checked").val();
  var defval = $(obj).attr("defval");
  if (val == "") val = defval
  var saveobj = $(obj).attr("saveobj");
  var fouttxt = false;
  var saveobjval = val
  $(".foutmelding").html("");

   if (checkme == "slt"){
      valueOK = (val != defval);
      if (!valueOK) {fouttxt = "Er is geen geldige optie gekozen";}
     }
    else if ((checkme && defval) || checkme == "chk") {
    valueOK = false;
    if (checkme == "chk"){
      if (!$("#"+chkid+":checked").val()) saveobjval = $(obj).attr("falseval");
      valueOK = true;
    }
   else if (checkme == "txt" || checkme == "slc"){
      valueOK = (val != defval && val != "");
      if (!valueOK) {fouttxt = "Dit is een verplicht veld";}
    }
   else if (checkme == "pcd"){
      fouttxt = "Het veld postcode is niet juist in gevuld"
      val = val.toUpperCase().split(" ").join("");
      rExp = /^[1-9]\d{3}[A-Z]{2}$/; // postcode NL
      valueOK = rExp.exec(val);
      if (valueOK){
      boekNLBE = "BNL"
      $("#BoekLand").val(boekNLBE);
      $(".BNL").css("display", "block")
      $(".BBE").css("display", "none")
      }
      if (!valueOK){
	rExp = /^[1-9]\d{3}$/; // postcode BE
	valueOK = rExp.exec(val);
	if (valueOK){
	boekNLBE = "BBE"
        $(".BNL").css("display", "none")
        $(".BBE").css("display", "block")
	$("#BoekLand").val(boekNLBE);
	}
      }

      defval=val
      if (valueOK){ $(obj).val(val); fouttxt = false}
    }
    else if (checkme == "eml"){
     fouttxt = "Het veld email is niet juist in gevuld"
      rExp = /^[a-z0-9\._%-]{2,}@[a-z0-9\._%-]{2,}\.[a-z]{2,4}$/;
      valueOK = rExp.exec(val);
      defval=val
      if (valueOK){ $(obj).val(val); fouttxt = false}
    }
  }
   if (defval == "" || val == "") defval = $(obj).attr("defval");
   if (saveobj) $("#"+saveobj).html(saveobjval);
   $(obj).val(val);

   if (!valueOK){
     if (!fouttxt || fouttxt == "") fouttxt = "Dit is een verplicht veld";
	$(".foutmelding").css({display: "inline", "background-color": "#FFF",  opacity: 1  });
	$(".foutmelding").dequeue().html(fouttxt).effect("highlight", {mode: "hide", color: "#F33"},4000);
     showTrueFalse(obj, false)
   }
   else{
      showTrueFalse(obj, true)
   }
}

function setPopupInfo(obj){
 var X = posX + 0;
 var Y = posY - 120;
  $("#popupInfo"+obj).topZIndex({increment: 1}).css({"display":"block", "max-width":"300px"}).css({"left": (X/11) + "em", "top": (Y/11) + "em"});
}

function focuscheck(obj){
    if ($(obj).val() == $(obj).attr("defval")) $(obj).val("");
}

function initActions(){
 // pushFotoSlider($("#tochtfototumbcontainer"), 40)
}

function pushFotoSlider(obj, move){// move is de waarde die de margin-top (MT) moet worden
   $(obj).dequeue();
   d = 500;
   mt = parseInt($(obj).css("margin-top")) // lezen van de huidige MT
   if (mt > move) shift = move - mt
   else shift = move - mt
   if (shift + mt < 0) shift = 0 - mt
   if (move > 0 && shift + mt > move) shift = move - shift + mt
   $(obj).delay(d).animate({"marginTop" : "+="+shift+"px"});
   $(obj).dequeue();
}

function genAjxHandler(){
	var params = JSON.stringify(ajxParams);
	$.ajax({
		type: "POST",
		url: serverRoot+"func12/ajx.php",
		async: false,
		data: "params="+ params,
	datetype: 'json',
		success: function(res){
			var result = JSON.parse(res);
			if (ajxVars.act == 'html')$(ajxVars.trget).html(result.data);
			else if (ajxVars.act == 'append')$(ajxVars.trget).append(result.data);
			else if (ajxVars.act == 'prepend')$(ajxVars.trget).prepend(result.data);
			else if (ajxVars.act == 'setBoekingInfo'){
			 $.ajxResult = result.data;
			 $("#boekingTochtTitel").html( $.ajxResult.tocht.titel);
			 $("#boekingTochtTitelT").html( $.ajxResult.tocht.titel);
			 $("#boekingTochtTitelHF").html( $.ajxResult.tocht.titel);
			 $("#boekingTochtTitelV").html( $.ajxResult.tocht.titel);
			  $("#boekingTochtTitelVZ").html( $.ajxResult.tocht.titel);
			  $("#boekingPaginaT").html( $.ajxResult.tocht.paginanummer);
			  $("#TochtTitel").val( $.ajxResult.tocht.titel);
			  $("#pagNum").val( $.ajxResult.tocht.paginanummer);
			  $("#hddnttl").html( $.ajxResult.tocht.titel);
			}
			else if (ajxVars.act == 'userdefined'){
				if (ajxVars.trget == 'renewFotoCache'){
					$.ajxResult = result.data;
					doRenewFotoCache();
				}
				else if (ajxVars.trget == 'quicksearchcount'){
					$.ajxResult = result.data;
					$("#quicksearchcount").html($.ajxResult);
					$("#showquicksearchnr").html($.ajxResult);
				 }
				else if (ajxVars.trget == 'populateFotoView'){
					$.ajxResult = result.data;
					$("#fotoviewTitel").html( $.ajxResult.titel);
					$("#fotoviewFotoBig").attr("src", $.ajxResult.foto);
					if (ajxParams.a_id == 0) $("#fotoviewAanraders").html( $.ajxResult.aanraders);
					$("#fotoViewList").html($.ajxResult.fotolist);
					$("#alterViewList").html($.ajxResult.alterlist);
					$("#fotoViewTochtHref").attr("href", $.ajxResult.href);
					$("#fotoViewSubject").html($.ajxResult.subject);
					$("#fotoViewAuthor").html($.ajxResult.author);
				 }
				else if (ajxVars.trget == 'sendGidsnvrg'){
					alert(result.data);
					setOverlay('none');
				 }
				else if (ajxVars.trget == 'sendAnvrgnvrg'){
					alert(result.data);
					setOverlay('none');
				 }
				else if (ajxVars.trget == 'sendCadobon'){
					alert(result.data);
					setOverlay('none');
				 }
				else if (ajxVars.trget == 'sendNbrfnvrg'){
					alert(result.data);
					setOverlay('none');
				 }
				else if (ajxVars.trget == 'sendBoeking'){
					alert(result.data);
				 }
				else if (ajxVars.trget == 'showAanbieding'){
					$("#aanbieding").empty();
					$("#aanbieding").html(result.data);
					  raiseDialog("aanbieding");
				 }




			}
			return false;
		}
	});
}

function getBoekingInfo(tid, func){
  ajxParams = {tid: tid, func: func};
  ajxVars = {act: "setBoekingInfo", trget: "setBoekingInfo"};
  genAjxHandler();
}


function setFotoThumbList(dir, move, obj){
  move = $("#tochtfotoSlider").width();
  max = $("#"+obj).width();
  pos = parseInt($("#"+obj).css("marginLeft"));
  p = Math.abs(pos);
  if (dir == "left" && pos < 0)  $("#"+obj).animate({"marginLeft" : "+="+move+"px"});
  if (dir == "right" && p + move  < max)   $("#"+obj).animate({"marginLeft" : "-="+move+"px"});
}

function setThumbList(dir, move, obj){
  move = $(".fotoSlider").width();
  max = $("#"+obj).width();
  pos = parseInt($("#"+obj).css("marginLeft"));
  p = Math.abs(pos);
  if (dir == "left" && pos < 0)  $("#"+obj).animate({"marginLeft" : "+="+move+"px"});
  if (dir == "right" && p + move  < max)   $("#"+obj).animate({"marginLeft" : "-="+move+"px"});
}

function populateFotoView(id){
  ajxParams = {a_id: id, func: "getFotoViewData"};
  ajxVars = {act: "userdefined", trget: "populateFotoView"};
  genAjxHandler();
}

function setFotoView(ft){
$("#fotoviewFotoBig").attr("src", serverRoot+"/images/fotoos/"+$(ft).attr("foto"));
$("#fotoViewSubject").html($(ft).attr("subject"));
$("#fotoViewAuthor").html($(ft).attr("author"));
if ($(ft).attr("title")) $("#fotoviewTitel").html($(ft).attr("title"));
if ($(ft).attr("hrf")) $("#fotoViewTochtHref").attr("href", $(ft).attr("hrf"));
}


function setInfoTab(obj){
	$(".infoTab").removeClass("infoTabselected");
	$("#"+$(obj).attr("id")).addClass("infoTabselected");
	$(".tabdiv").removeClass("tabdivselected");
	$("#"+$(obj).attr("settab")).addClass("tabdivselected");
}

function jumpPage(page){
  //document.location.href = serverRoot + "index.php/content01/"+page+"?page="+page;
}

function jumpIDPage(id){
//  document.location.href = serverRoot + id;
}

function getCountQuickSearch(){
	setQuickSearchParams('getQuickSearchCount');
	ajxVars = {act: 'userdefined', trget: 'quicksearchcount'};
	genAjxHandler();
}

function getQuickSearchResult(sP){
	if (!sP){
	  $("#resultpage").val('0 ');

	}
	setQuickSearchParams('none');
	$("#snelzoekparams").val(JSON.stringify(ajxParams));
	document.formsnelzoeken.submit();
}

function setSearchResultPage(move){
  var m = move;
  if (move == "0") m = 0;
  else if (move == "m1") var m = parseInt($("#resultpage").val()) - 1 ;
  else if (move == "p1") var m = parseInt($("#resultpage").val()) + 1 ;
  m = (m>=0)?m:0;
  $("#resultpage").val(m);
  getQuickSearchResult('savePage');
}


function setQuickSearchParams(func){
  ajxParams = {
    soort:$("#snelzoeksoort").val(),
    type:$("#snelzoektype").val(),
    eia:$("#snelzoekeia:checked").val(),
    herfst:$("#snelzoekherfst:checked").val(),
    winter:$("#snelzoekwinter:checked").val(),
    vegetarisch:$("#snelzoekvegetarisch:checked").val(),
    gps:$("#snelzoekgps:checked").val(),
    culinair:$("#snelzoekculinair:checked").val(),
    landen:$("#snelzoeklanden").val(),
    dagen:$("#snelzoekdagen").val(),
    zwaarte:$("#snelzoekzwaarte").val(),
    prijs:$("#snelzoekprijs").val(),
    resultsppage:$("#resultsppage").val(),
    resultpage:$("#resultpage").val(),
    func: func
  };
}

function setMenuTab(id, mid, pos){
  showMenuTab = (showMenuTab == false);
  if (!showMenuTab){
	$(".mainmenuitems").css("display", "none");
	setOrigMenu();
  }
  else positionMenuTab(id, mid, pos);
}

function setOrigMenu(){
  $(".menuitem").height($.menuHeight).css({"border-bottom-color" : "#2b2b2b", "margin-bottom" : 0});
}

function positionMenuTab(id, mid, pos){
  setOrigMenu();
  if (showMenuTab){
	var elpos = parseInt(($(document).width() - 968)/2) + parseInt(pos);
	$("#"+mid).css({"left" : elpos, "display": "block"});
	$("#"+id).height($.menuHeight + 2).css({"border-bottom-color" : "#FFF", "margin-bottom" : -2});
	openMenuTab = mid;
  }
}

function displayMenu(id, mid, act){
  if(showMenuTab){
	if (openMenuTab != mid && openMenuTab != "") $("#"+openMenuTab).css("display", "none");
	positionMenuTab(id,mid, act);
  }
  if (id){
	$(".menusel").removeClass("menusel").addClass("menuunsel");
	$("#"+id).removeClass("menuunsel").addClass("menusel");
  }
}

function showCountryMap(land, fland){
  	$("#landkaart").empty().css({"background-image": "url(\'"+serverRoot+"images/pages/" + land + ".png\')"});
	ajxParams = {tland: fland, func: 'getTochtPosition'};
	ajxVars = {act: 'html', trget: '#landkaart'};
	genAjxHandler();
	$('.ui-tochtIcon').mouseover(function(){showTochtInfo($(this).attr('tid'))});
	raiseDialog("landkaart");
}

function showTochtInfo(tid){
	var X = posX + 0;
	var Y = posY - 120;
	if (tid != tochtInfoID){
		$("#tochtToolTip").html('<div class="waiter"><img src="'+ serverRoot + 'images/pages/wait.png\" height="2em" /></div>');
			ajxParams = {aid: tid, RSB:RSB,func: 'getTochtInfo'};
			ajxVars = {act: 'html', trget: '#tochtToolTip'};
			genAjxHandler();
	}
	$("#tochtToolTip").topZIndex({increment: 1}).css({"display":"block"}).css({"left": (X/11) + "em", "top": (Y/11) + "em"});
	tochtInfoID = tid;
}

function setzoekkaart(id){
	$(".zoekenkaart").css({display: "none"});
	$("#kaart"+id).css({display: "block"});
	$(".kaartzoekentab").css({"border-bottom-color": "#5b5b5b", "color":"#5b5b5b"});
	$("#zoektab"+id).css({"border-bottom-color":"#FFF", "color": "#1c7d2e"});
}

function raiseDialog(elem, w, h){
	dialogOwner = "#"+elem;
	h = (h)?h:$(dialogOwner).height();
	w = (w)?w:$(dialogOwner).width();
	$(function(){$(dialogOwner).dialog({
		open: function(){setOverlay('block')}, close: function(){dialogOwner = ""; setOverlay('none')},
		autoOpen: false, modal: false, height: h, width: w, resizable: false, "closeText": ""});});
	$(dialogOwner).prepend(closeImg).dialog('open').width(w).height(h);
	$("#CloseButton").css({"position": "relative", "float": "right", "top": "-1.9em", "left": "1.7em", "cursor": "pointer"}).click(function(){setOverlay('none');});
	if (dialogact == "getFotoCache") getFotoCache(dialogact);
	if (dialogact == "getBoekingInfo") getBoekingInfo($(dialogOwner).attr("tid"), dialogact);
	dialogact = false;
}

function setOverlay(act){
	if (!act) act = ($("#genericOverlay").css("display") == 'none')?'block':'none';
	if (act == 'none') {$("#genericOverlay").css("display", act); $("#tochtToolTip").css({"display":"none"});}
	else $("#genericOverlay").width($(document).width()).height($(document).height()).css("display", act);
	if (act == 'none' && dialogOwner){
	  if ($(dialogOwner).hasClass("empty") == true) $(dialogOwner).empty();
	  $(dialogOwner).dialog('close').dialog('destroy');
	  dialogOwner = "";
	}
}
