(function($){

$.fn.ImageMap = function(opt){
      
    var defaults = {
        fileType: "jpg"
    };
    
    var options = $.extend(defaults, opt);
    
    var currentArea = $('area');
    var fileType = options.fileType;
    //var prefix = options.prefix;
    
    $(currentArea).mouseover(
        function() {
          var imageToFind = $(this).attr('class');
          $().find("img").each(
            function(){
              if ($(this).attr('id')==imageToFind) {
                //$(this).attr('src',prefix+imageToFind+"_over."+fileType);
                this.src = this.src.replace("."+fileType,"_over."+fileType)
              }
            }
          );
        }
      );
      
      $(currentArea).mouseout(
        function() {
          var imageToFind = $(this).attr('class');
          $('#maps').find("img").each(
            function(){
              if ($(this).attr('id')==imageToFind) {
                //$(this).attr('src',prefix+imageToFind+"."+fileType);
                this.src = this.src.replace("_over."+fileType,"."+fileType);
              }
            }
          );
        }
      );
    
};

})(jQuery);
