var cluetip_opts = {
  local:true,
  width: 90,
  leftOffset: -45,
  topOffset: -50,
  positionBy: 'mouse',
  sticky:true,
  cursor: 'hand',
  dropShadow: false,
  activation: ($.browser.msie) ? 'click' : 'hover', //in IE, map only can do 'click'
  closePosition:'title',
  closeText: '&times;',  onHide: function(){    
    //reset maphighlight visibility
    $('.jq_maphilight').show();
    
    //These functions don't work with IE7 click-only
    if (! $.browser.msie) {
      //reset cluetip class
      $('#cluetip').removeClass('cluetip-expanded');                //trigger mouseleave to restore to original state
      $(this).trigger('mouseleave.cluetip');            //destroy cluetips
      $('.load-local')
        .cluetip('destroy')
    
        //re-create cluetips
        .cluetip(cluetip_opts)      
    }
  }
};        

$(document).ready(function() {
 
   //load up cluetips on each state
	$('.load-local').cluetip(cluetip_opts);
  
  //set click functions for each state, and the same for cluetips
  $('.load-local, #cluetip' )
    .click(function(){
      $('#cluetip').addClass('cluetip-expanded');      
      //hide maphighlight
      $('.jq_maphilight').hide();
      
      //change for all other cluetips
      $('.load-local')
        //disable mouse actions that would interrupt
        .unbind('mousemove.cluetip')
        .unbind('mouseenter.cluetip')      
    });
    
  ///load map highlights plugin
  $.fn.maphilight.defaults = {
    fill: true,
    fillColor: '013B6B',
    fillOpacity: 1,
    stroke: true,
    strokeColor: 'ffffff',
    strokeOpacity: 0,
    strokeWidth: 4,
    fade: true,
    alwaysOn: false
  };  $('.jq_maphilight').maphilight();});