$(document).ready(function() {
  
  atractive = setInterval("changeAtractive()",7000);
  
  $('.mapSelect').find('area').hover(function(){
    $('#mapaImage').attr('src',$(this).attr('img'));
    $('#map').val($(this).attr('mapId'));
    $('#mapName').val($(this).attr('alter'));
    //alert($(this).attr('title'));
  });
  
  $('.mapSelect area').tooltip({     
    track: true,     
    delay: 0,     
    showURL: false,     
    showBody: " - ",     
    fade: 250 
  });

  
  $('.mapSelect').find('area').click(function(){
    if (($('#type').val() == 1)||(($('#type').val() == 3))){
      //$('#mapForm').attr('action','set.flt.php');
      $('#cnt').val('chs');
    }else{
      //$('#mapForm').attr('action','/?cnt=ofr&type='+$('#type').val());
      $('#cnt').val('ofr');
    }
    $('#mapForm').submit();
  })
  
})

function changeAtractive(){
  $('.atraBox').each(function(){
    //$(this).html('');
  });
  //alert('/jquery/atractive.php?id='+$('#atrID').val());
  $.get('/jquery/atractive.php?id='+$('#atrID').val(), function(data){
    if (data > ''){ 
      //alert(data);
      $('.atraBox').each(function(){
        $(this).html('');
        $(this).html(data);
      });
    }
  });
  
}

