﻿<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 14;

var mapZoom=0;
// -----------------------------------------------------------------------------
$(document).ready(function() {
  $(".thickbox").fancybox({
        'width': '90%',
        'height': '90%',
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe'
      });
//Test

  $("#divDestinationDrop").keypress(function(e){
    var code = (e.keyCode ? e.keyCode : e.which);
    var chr=String.fromCharCode(code);
    $("#destinationDrop"+chr.toUpperCase()).focus();
  });

});
function menuHandler(e){

  var target=e?e.target:event.srcElement;

  if (target.id=="divDestinationDrop")
  {
    if (document.getElementById("destinationDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("destinationDrop").style.left=position.left+3+"px";
      document.getElementById("destinationDrop").style.top=position.top+26+"px";
      document.getElementById("destinationDrop").style.display="block";
      
      if (document.getElementById("countryDrop")!=null)
      {
        document.getElementById("countryDrop").style.display="none";
      }
      if (document.getElementById("categoryDrop")!=null)
      {
        document.getElementById("categoryDrop").style.display="none";
      }
      if (document.getElementById("vinterDrop")!=null)
      {
        document.getElementById("vinterDrop").style.display="none";
      }
    }
    else
    {
      document.getElementById("destinationDrop").style.display="none";
    }
  }
  else if (target.id=="RV-Journey")
  {
    if (document.getElementById("vinterDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("vinterDrop").style.left=position.left+"px";
      document.getElementById("vinterDrop").style.top=position.top+22+"px";
      document.getElementById("vinterDrop").style.display="block";
      
      document.getElementById("destinationDrop").style.display="none";
    }
    else
    {
      document.getElementById("destinationDrop").style.display="none";
    }
  }
  else if (target.id=="ES-Journey")
  {
    if (document.getElementById("destinationDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("destinationDrop").style.left=position.left+"px";
      document.getElementById("destinationDrop").style.top=position.top+53+"px";
      document.getElementById("destinationDrop").style.display="block";
      
      document.getElementById("countryDrop").style.display="none";
      document.getElementById("categoryDrop").style.display="none";
    }
    else
    {
      document.getElementById("destinationDrop").style.display="none";
    }
  }  
  else if (target.id=="ES-Country")
  {
    if (document.getElementById("countryDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("countryDrop").style.left=position.left+"px";
      document.getElementById("countryDrop").style.top=position.top+59+"px";
      document.getElementById("countryDrop").style.display="block";
      
      document.getElementById("destinationDrop").style.display="none";
      document.getElementById("categoryDrop").style.display="none";
    }
    else
    {
      document.getElementById("countryDrop").style.display="none";
    }
  }
  else if (target.id=="ES-Journey")
  {
    if (document.getElementById("destinationDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("destinationDrop").style.left=position.left+"px";
      document.getElementById("destinationDrop").style.top=position.top+32+"px";
      document.getElementById("destinationDrop").style.display="block";
      
      document.getElementById("countryDrop").style.display="none";
    }
    else
    {
      document.getElementById("destinationDrop").style.display="none";
      document.getElementById("categoryDrop").style.display="none";
    }
  }  
  else if (target.id=="ES-Category")
  {
    if (document.getElementById("categoryDrop").style.display!="block")
    {
      var p = $("#"+target.id);
      var position = p.offset();
      //alert(position.left);
      document.getElementById("categoryDrop").style.left=position.left+"px";
      document.getElementById("categoryDrop").style.top=position.top+59+"px";
      document.getElementById("categoryDrop").style.display="block";
      
      document.getElementById("destinationDrop").style.display="none";
      document.getElementById("countryDrop").style.display="none";
    }
    else
    {
      document.getElementById("categoryDrop").style.display="none";
    }
  }  
  else
  {
    document.getElementById("destinationDrop").style.display="none";
    if (document.getElementById("countryDrop") != null)
    {
        document.getElementById("countryDrop").style.display="none";
    }
    if (document.getElementById("categoryDrop") != null)
    {
        document.getElementById("categoryDrop").style.display="none";
    }
    if (document.getElementById("vinterDrop") != null)
    {
        document.getElementById("vinterDrop").style.display="none";
    }
  }
}
document.onclick=menuHandler
// -->


