$.fn.extend({
    fixPNG: function(sizingMethod, forceBG) {
            if (!($.browser.msie)) return this;
            var emptyimg = "empty.gif"; //Path to empty 1x1px GIF goes here
            sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
            this.each(function() {
                    var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
                            imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
                            src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
                    this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
                    if (isImg) this.src = emptyimg;
                    else this.style.backgroundImage = "url(" + emptyimg + ")";
            });
            return this;
    }
});


var ArrowEffect = {
	
	arrowWidth: 70,
	arrowHeight: 70,
			
	makeEffect: function(id, img) {
		var time = (Math.floor(Math.random()*3001));
		setTimeout("ArrowEffect.animate('" + id + "', '" + img + "')", time);
	},
	
	animate: function(id, img) {
		var arrow = document.createElement("IMG");
		$(arrow).attr("src", img);
		$(arrow).attr("alt", "");
		$(arrow).attr("class", "arrow");
		var tempId = "arrow" + Math.floor(Math.random()*1001);
		$(arrow).attr("id", tempId);
		
		$(document.body).append($(arrow));
		
		var objPos = $('#' + id).offset();
		
		$(arrow).css({
			top: (objPos['top']) + "px",
			left: (objPos['left']) + "px",
			width: 40 + "px",
			height: 40 + "px",
			zIndex: 25,
			opacity: 0.8
		});
		$(arrow).animate({
			width: ArrowEffect.arrowWidth + "px",
			height: ArrowEffect.arrowHeight + "px",
			marginLeft: "-" + (ArrowEffect.arrowWidth / 2 - 19) + "px",
			marginTop: "-" + (ArrowEffect.arrowHeight / 2 - 19) + "px",
			opacity: 0
		},{
			duration: 2000
		});

		var time = 5500 + (Math.floor(Math.random()*4501));
		setTimeout("ArrowEffect.animate('" + id + "', '" + img + "')", time);		
		setTimeout("$('#" + tempId + "').remove()", 4200);
		
	}
}
