jQuery(document).ready(function(){
	jQuery("#nav > li > ul").stop().animate({"opacity":0},0);
	jQuery("#header").css("z-index","5");
	jQuery("#nav > li").hover(
	
		function()
		{
			jQuery("#header").css("z-index","10");
			jQuery(this).children("ul").stop().animate({"opacity":1},"slow");
		},
		function()
		{
			jQuery("#header").css("z-index","5");
			jQuery(this).children("ul").stop().animate({"opacity":0},"slow");
		}
	);
	
	function hideContent(headline,targetDiv)
	{
		jQuery(headline + " .cross").click(
			
			function()
				{	
					if(jQuery(targetDiv).css("display") != "none")
					{
						jQuery(targetDiv).stop().animate({"opacity":0},"slow", function(){jQuery(targetDiv).css("display","none");});
					
					}
					else
					{
						jQuery(targetDiv).stop().css("display","block")
						jQuery(targetDiv).stop().animate({"opacity":1},"slow");
					}
				}
			
			);
	}
	
	hideContent(".redHeadline","#breakingNews");
	hideContent("#moreNewsHeading ","#moreNews");
	hideContent("#moreRead","#alsoNews");
	hideContent(".grayHeadline","#archiveNews");
	hideContent("#newsArea1Heading","#newsArea1");
	hideContent("#newArea2Heading","#newArea2");
	hideContent("#newsArea3Heading","#newsArea3");
});
