$(window).load(function(){

	var myID = '#'+$('.shown').attr('id');
	var myHeight = $(myID).css('height');
	            
	$('#is_mainSection').css({ height: myHeight }, 500);
	
	$('.ghost').hoverIntent(Glow, DeGlow);
	$('li a.sub').hoverIntent(menuGlow, menuDeGlow);
	$('li a.sub').click(function(){
		return false;
	});
	
});

function Glow() { 
            var show = $(this).attr('class').split(' '),
            showMe = $("#"+show[1]).removeClass('shown'),
            newHeight = showMe.css('height');
            
            $('#is_mainSection').animate({ height: newHeight }, 500);
            
            $(".shown").fadeOut(1000);
            showMe.fadeIn(1000);
            $('li a.sub, .ghost').removeClass('current');
            $('.'+show[1]).addClass('current');
            showMe.removeClass('hidden');
            showMe.addClass('shown');
}
	
function DeGlow() { 
    var show = $(this).attr('class').split(' ');
	$(this).stop().animate({ opacity: 0.35 }, 500);
}

function menuGlow() {
            var show = $(this).attr('class').split(' '),
            showMe = $("#"+show[1]).removeClass('shown'),
            newHeight = showMe.css('height');
            
            $('#is_mainSection').animate({ height: newHeight }, 500);
            
            $(".shown").fadeOut(1000);
            showMe.fadeIn(1000);
            $('li a.sub, .ghost').removeClass('current');
            $('.'+show[1]).addClass('current');
            showMe.removeClass('hidden');
            showMe.addClass('shown');
}

function menuDeGlow() { 

}

