function showSelectBox(inputid, selectid)
{
  var vis = $(selectid).is(":visible");
  $('.bookoptions,.bookoptionswide').hide();
  if (!vis)
  {
    $(selectid).show();
    var offset = $(inputid).offset();
    offset.top = offset.top - 111; 
    $(selectid).offset(offset);
  }
}

function checkBookFields(blang)
{
  var bday = $('#bday').val();
  var bmonth = $('#bmonth').val();
  var byear = $('#byear').val();
  var bnights = $('#bnights').val();
  var bpersons = $('#bpersons').val();

  // RESERVEREN (lang=FR|EN|DE|NL|ES) (fday=aankomstdag) (nbnights=aantal nachten) (nbadt=aantal personen)
  //http://hotel.reservit.com/reservit/reserhotel.php?hotelid=12755&lang=NL&fday=14&fmonth=08&fyear=2011&nbnights=2&nbadt=2
  $('#bookhotel').attr('href','http://hotel.reservit.com/reservit/reserhotel.php?hotelid=12755&lang='+blang+'&fday='+bday+'&fmonth='+bmonth+'&fyear='+byear+'&nbnights='+bnights+'&nbadt='+bpersons);
}

function bookRestaurant(blang)
{
  // Frans http://www.lafourchette.com/aff.php?i=58&uid=3891
  // Engels http://www.thefork.com/aff.php?i=58&uid=3891
  // Spaans http://www.eltenedor.es/aff.php?i=58&uid=3891
  if (blang == 'FR')
    $('#bookrestaurant').attr('href','http://www.lafourchette.com/aff.php?i=58&uid=3891');
  else if (blang == "ES")
    $('#bookrestaurant').attr('href','http://www.eltenedor.es/aff.php?i=58&uid=3891');
  else
    $('#bookrestaurant').attr('href','http://www.thefork.com/aff.php?i=58&uid=3891');
}

function toggleTopContent()
{
  if ($('#topblockopen').height()==0)
  {
    // topblock is closed, open it
    $('#topblockopen').animate({height:'322px'}, 400);
    $('#topblocktogglearrow').removeClass('down').addClass('up');
  }
  else
  {
    // topblock is open, close it
    $('#topblockopen').animate({height:'0px'}, 400);
    $('#topblocktogglearrow').removeClass('up').addClass('down');
  }
}

function toggleLeftContent()
{  
  if ($('#leftmenu').width()==49)
  {    
    // leftblock is closed, open it
    $('.leftmenuclosed').removeClass('leftmenuclosed').addClass('leftmenuopen');
    $('#leftmenu').animate({width:'360px'}, 400, function()
    {      
      $('#leftblockcontent').show();
      $('#leftblocktogglearrow').removeClass('right').addClass('left');
    });
    $('#leftblocktoggle').animate({left:'360px'}, 400);
  }
  else
  {
    // leftblock is open, close it
    $('#leftmenu').animate({width:'49px'}, 400, function()
    {
      $('.leftmenuopen').removeClass('leftmenuopen').addClass('leftmenuclosed');
      $('#leftblockcontent').hide();
      $('#leftblocktogglearrow').removeClass('left').addClass('right');
    });
    $('#leftblocktoggle').animate({left:'49px'}, 400);
  }
}

function showtab(menuid)
{
  var tabcontentwidth = $('#topmenu'+menuid).outerWidth()-14-4;
  var besidetabwidth = 540-tabcontentwidth-14+4;
  var topmenuhighlightoffset = $('#topmenu'+menuid).offset().left+2;
    
  $('#topmenuhighlighttop').html('<div class=\'tableftborder\'>&nbsp;</div>');
  $('#topmenuhighlighttop').append('<div class=\'tabcontent\' style=\'width:'+tabcontentwidth+'px;\'>&nbsp;</div>');
  $('#topmenuhighlighttop').append('<div class=\'tabrightborder\'>&nbsp;</div>');
  $('#topmenuhighlighttop').append('<div class=\'besidetab\' style=\'width:'+besidetabwidth+'px;\'>&nbsp;</div>');
  
  $('#topmenuhighlight').show();
  $('#topmenuhighlight').offset({ top: 12, left: topmenuhighlightoffset });
}


