$(document).ready(function(){
	$('#mainMenu li div div li').each(function() {
		if ($(this).find('li').size() == 0) {
			$(this).hover(
				function() {
					$(this).find('a').css({ 'background-image': 'url(../images/bg/mnhna.png)', 'background-repeat': 'no-repeat' });
				},
				function() {
					$(this).find('a').css('background-image', 'none');
				}
			);
		}
	});

	Cufon.replace('h1:not("#logo"), h2:not("#slogan"), h3, .rightMenu dt, a.button, .cuf');
	$.ifixpng('theme/gf/bg/pixel.gif');
	$('#investGallery ol li a, .more, .seeDetails, .goToGallery').ifixpng();
	
	$("#content dl dt.on").each(function(){
		$(this).removeClass('on').css('cursor', 'pointer').next().hide();
		$(this).click(function(){
			$(this).toggleClass('on').next().toggle();
		});
	});	
	
	$(".sideMenu li a").hover(function(){
		if($(this).parent().parent()[0].nodeName.toLowerCase() == 'ul')
		{
			$(this).parent().parents().filter('li').removeClass('hover');
		}
		$(this).parent().addClass('hover');
	}, function(){
		if($(this).parent().parent()[0].nodeName.toLowerCase() == 'ul')
		{
			$(this).parent().parents().filter('li').removeClass('hover');
		}
		$(this).parent().removeClass('hover');
	});
	
	$("#investGallery ul li img").hide();
	$("#investGallery ul li img:first").show();
	
	$("#investGallery ol li:first").addClass('on');
	
	$("#investGallery ol li a").click(function(){
		$("#investGallery ol li").removeClass('on');
		$(this).parent().addClass('on');

		$("#investGallery ul li img").hide();		
		$("#"+$(this).attr('rel')).show();		
	});

});