function getImageUrl(imgObj, tag){
	var img = imgObj.attr(tag);
	if(img != null){
		if($.browser.msie)
			imgOver = img();
		else
			img = img.replace(/return \'/, '').replace(/\'/, '').replace(/;/, ''); 
	}else{
		img = imgObj.attr("src");
	}
	return img;
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

jQuery.fn.rollover = function() {
  return this.each(function(){
	$(this).hover(function(){
		var img = getImageUrl($(this), 'onmouseover');
		$(this).attr('src', img);
	}, function(){ 
		var img = getImageUrl($(this), 'onmouseout');
		$(this).attr('src', img);
	});
  });
};

jQuery.fn.preloadImages = function(){
    return this.each(function(){
		var img = getImageUrl($(this), 'onmouseover');
		var over = newImage(img);
    });
};
