/**
 * @author efimochkin
 */
$.extend({
    preloadImages:  function(){
      for(var i = 0; i<arguments.length; i++)
      {
        $("<img>").attr("src", arguments[i]);
      }
    }
    });
$(
    function(){
        $.preloadImages(
            "/images/004.gif",
            "/images/005.gif",
            "/images/006.gif",
            "/images/007.gif",
            "/images/008.gif",
            "/images/009.gif",
            "/images/010.gif",
            "/images/011.gif",
            "/images/012.gif",
            "/images/013.gif",
            // картинки на mouseover
            "/images/004-.gif",
            "/images/005-.gif",
            "/images/006-.gif",
            "/images/007-.gif",
            "/images/008-.gif",
            "/images/009-.gif",
            "/images/010-.gif",
            "/images/011-.gif",
            "/images/012-.gif",
            "/images/013-.gif"
        );
           
        $(".brands img").wrap("<span></span>").css("display", "inline-block");       
        $(".brands img").mouseover(
            function(){
                $(this)
                    .attr("src",$(this).attr("src").toString().replace(".gif","-.gif"))
                    .css("cursor","pointer");
            }
        );
        
        $(".brands img").mouseout(
            function(){
                $(this).attr("src",$(this).attr("src").toString().replace("-.gif",".gif"));
            }
        );
    }
)