hs.graphicsDir = '/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.showCredits = false;
hs.cacheAjax = false;
hs.allowMultipleInstances = false;
hs.align = 'auto';
hs.extraHeight = 10;
$(function() {
  var $obj = $('<img src="/images/circles/0.gif" class="effectcircle">').appendTo('#global').load(function() {
  var circle = {obj: $obj, hw: $obj.width()/2, hh: $obj.height()/2 };
  $obj.hide();
  $('#hole_choice_bar a').hover(function() {
/*
    var idsplit = this.id.split('_');
    var $this_map = $('#map_' + idsplit[1]);
    if ($this_map.length) {
      var coordssplit = $this_map.attr('coords').split(',');
      var avgx = 0; var avgy = 0;
      for (var i=0; i+1<coordssplit.length; i+=2) {
        avgx += parseInt(coordssplit[i]); avgy += parseInt(coordssplit[i+1]);
      }
      avgx = Math.floor(avgx / (coordssplit.length/2));
      avgy = Math.floor(avgy / (coordssplit.length/2));
      var $cm_offset = $('#coursemap_obj').position();
      $obj.css({top: avgy + $cm_offset.top - circle.hh, left: avgx + $cm_offset.left - circle.hw}).show();
    }
*/
  }, function() {
    $obj.hide();
  }).filter('.hspopup').each(function() {
      this.onclick = function() {
	return hs.htmlExpand(this, { objectType: 'ajax', width: '<?= $width ?>', targetX: '<?= $targetX ?>', targetY: '<?= $targetY ?>', preserveContent: false});
      };
  });

  $('#coursemap area').each(function() {
    var idsplit = this.id.split('_');
    var $this_choice = $('#choice_' + idsplit[1]);
    $(this).click(function() { $this_choice.click(); return false; })
           .hover(function() { $this_choice.addClass('hover'); return false; },
	          function() { $this_choice.removeClass('hover'); return false;});
  })
  }); // end of $obj.load();
});


