jQuery.noConflict();
(function($) {
    $(function() {
        
        if(typeof(baseUrl)=='undefined'){
            baseUrl = '';
        }
        
        $( 'ul.products-list li img' ).parent().css('cursor','wait');
        
        ajaxGetImgZoom    = baseUrl + "catalog/product/ajaxgetimgzoom";
        
        $('ul.products-list li img').mouseover(function(){
            
            var currentProductId  = $( this ).attr('data-productId');
            var isEmpty = $(this).attr('imgzoom');
            var currentImage      = $( this );
            
            if( isEmpty == '' ) {
                $.ajax({
                    type: "POST",
                    async:false,
                    url: ajaxGetImgZoom,
                    data: {
                        productId:currentProductId
                    },
                    beforeSend:function() {
                    },
                    success:function( data ) {
                        $( currentImage ).attr('imgzoom', data);
                        $( currentImage + '.next()' ).attr( 'src' , data );
                    
                    },
                    error:function() {
                    }
                });
                $( currentImage ).parent().css('cursor','pointer');
            }
            

        });
    });
})(jQuery);
