// JavaScript Document

$(document).ready(function() {
	hoverOpacity.init('.linkFader')
});

hoverOpacity = {
	init : function(obj){

		$(obj).each(function(i){
			
			if($(this).css('position') != 'absolute')$(this).css({position:"relative"});
			
			spanFader = document.createElement('span');
			myBG = $(this).css("background-image")
			
			$(this).append(spanFader);
			$(this).find('span').addClass('hover');
		
			myBG = $(this).css("background-image")
			myBGpos = $(this).find('.hover').css("background-position");
			if(myBGpos == '0% 0%')myBGpos = 'bottom right';
			spanWidth =  $(this).css("width")
			spanHeight =  $(this).css("height")
				
			$(this).find("span").css({
				backgroundImage:myBG,
				backgroundPosition:myBGpos,
				position:"absolute",
				display:"none",
				cursor:"pointer",
				top:"0px",
				left:"0px",
				width:spanWidth,
				height:spanHeight,
				visibility:"visible"
			});
			if(!$.browser.msie){
				$(this).find("span").css({opacity:0, display: 'block'});	
			}
		})
		$(".linkFader").hover(function () {
			if($.browser.msie){
				$(this).find("span").show();
			}else{
				$(this).find("span").stop().animate({opacity: 1}, 600);
			}
		},
		function () {
			if($.browser.msie){
				$(this).find("span").hide();
			}else{
				$(this).find("span").stop().animate({opacity: 0},600);
			}
		});
	}
}
