
try {
    window.addEvent('domready', function () {
    try {

      selected_diving_id = (Cookie.get("selected_diving") === false)?-1:Cookie.get("selected_diving");

      var accordion = new Accordion('li.toggler span', 'ul.diving_areas', {
        opacity: false,
        onActive: function(toggler, element){
            toggler.addClass('selected');
            Cookie.set("selected_diving", toggler.getParent().id, {duration: 7, path: '/'});
        },
        onBackground: function(toggler, element){
            toggler.removeClass('selected');
        },
         alwaysHide:true,
         display: selected_diving_id
      }, $('diving_menu'));




      var list = $$('#diving_menu li span');
      list.each(function(element) {
          var fx = new Fx.Styles(element, {duration:200, wait:false});

          element.addEvent('mouseenter', function(){
              fx.start({
                  'margin-left': 5
              });
          });

          element.addEvent('mouseleave', function(){
              fx.start({
                  'margin-left': 0
              });
          });

      });

      //~ var dlinks = $$('.diving_areas li a');
      //~ dlinks.each(function(element) {
          //~ element.setProperty('rel', 'moodalbox');
      //~ });



    } catch(e) {  }
  } );
} catch(e) {  }

function go_country() {
    return true;
    country = $('country_auto').value;
    if(country) {
       cur_href = $('cur_href').value;
       country  = country.replace(/\s/ig,'-').replace(/,/,'');
       link     = cur_href.replace(/\.html/,'/'+country+'.html');
       alert(link);
       //~ window.location = link;
    }
    return false;
}
