//= require <prototype>


// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function sizeMap() {
	if ($('map') && $('worldwide-destinations')) {
		var mapHeight = Element.getHeight('map');
		var hotHeight = Element.getHeight('worldwide-destinations');
		
		if (mapHeight > hotHeight) {
			$('worldwide-destinations').style.height = (mapHeight - 15) + "px";
		} else {
			$('map').style.height = (hotHeight - 15) + "px";
		}
	}
}

function init() {
	sizeMap();
  jQuery(function($) {
    $('a.region-expander').toggle(
      function() {
        $(this).find("img").attr("src", "/images/expander-down.gif");
        $(this).parent().parent().find("div.region-container").slideDown("fast");
      },
      function() {
        $(this).find("img").attr("src", "/images/expander-left.gif");
        $(this).parent().parent().find("div.region-container").slideUp("fast");
      },
      function() {
        return false;
      }
    )
  });	
}

Event.observe(window, 'load', init);