$(document).ready(function () {
	$('div.banner').hover(function() {
		var imgFade = $('> img:first', this);
		if (imgFade.is(':animated')) {
			imgFade.stop().animate({ opacity: 0 }, 250);
		} else {
			imgFade.animate({ opacity: 1 }, 250);;
		}
	}, function () {
		var imgFade = $('> img:first', this);
		if (imgFade.is(':animated')) {
			imgFade.stop().animate({ opacity: 1 }, 250);
		} else {
			imgFade.animate({ opacity: 0 }, 250);;
		}
	});


	// HP Buttons rollover
	$('img.fade').each(function() {
		var $$ = $(this);
		
		var target = $$.css('background-image').replace(/^url|[\(\)\"]/g, '');
		// console.log($$);
		// console.log(target);

		$$.wrap('<span style="position:relative;"></span>').parent().prepend('<img>').find('img:first').attr('src', target);

		if ($.browser.mozilla) {
			$$.css({
				'position' : 'absolute',
				'left' : 0,
				'background' : '',
				'top' : this.offsetTop
			});
		} else if ($.browser.opera && $.browser.version < 9.5 || $.browser.msie && $.browser.version < 7.999) {
			$$.css({
				'position' : 'absolute',
				'left' : 0,
				'background' : '',
				'top' : "0"
			});
		} else {
			$$.css({
				'position' : 'absolute',
				'left' : 0,
				'background' : ''
			});
		}
		
		$$.hover(function() {
			$$.stop().animate({ opacity: 0 }, 250);
		}, function () {
			$$.stop().animate({ opacity: 1 }, 250);
		});
	});
	
	$('div.special').hover(function() {
		$('span img:last', this).stop().animate({ opacity: 0 }, 250);
	}, function () {
		$('span img:last', this).stop().animate({ opacity: 1 }, 250);
	});
	
});


