var ie = false;

jQuery(document).ready(function(){
	
	//ini hover div
	$('.infoImgHover').each(function(index) {
		//alert(index + ': ' + $(this).text());
		var imgHeight 		= $(this).prev('.infoImg').prev('img').height();
		var divHeight 		= (imgHeight - 20);
		var newHtml 		= '<div class="hoverTop"></div><div class="middle">' + $(this).html() + '</div><div class="bottom"></div>';
		
		//set height and html
		$(this).css('height', divHeight + 'px').css('margin-top', '-' + (imgHeight-10) + 'px').html(newHtml);
		$(this).children('.middle').css('height', (divHeight - 22) + 'px');
	});
	
	if ($.browser.msie) {
		ie = true;
	}
	
	$('.infoImg').mouseover(function(){
		var hoverImg = $(this).next('.infoImgHover');
		
		if (ie) $(this).css('display', 'none');
		else $(this).fadeOut();
		
		if (ie) hoverImg.css('display', 'block');
		else hoverImg.fadeIn();
		
		hoverImg.mouseleave(function(){
			var infoImg = $(this).prev('.infoImg');
			
			if (ie) $(this).css('display', 'none');
			else $(this).fadeOut();
			
			if (ie) infoImg.css('display', 'block');
			else infoImg.fadeIn();
		});
		
		
		//$(this).css('filter', 'alpha(opacity=40)');
		//hoverImg.css('filter', 'alpha(opacity=0)');
		
		/*hoverImg.fadeIn('normal', function(){
			$(this).css('filter', 'alpha(opacity=40)');
		//	alert($(this).children('.ieTextDiv').attr('id'));
			$(this).children('.ieTextDiv').css('filter', 'alpha(opacity=100)');
		});*/
		
	});
	
});
