$(document).ready(function() {
	
	//from: http://siderite.blogspot.com/2009/08/jquery-slideup-flickers-in-internet.html
	slideUpIE = function(target, speed) {
		var h = target.height();
		var cssHeight=target.css('height');
		target.animate( 
		{ height: '1px' }, speed, function() { 
		  target.hide();
		  target.height(h);
		  target.css('height',cssHeight);
		});
	}

	//slides the element with class "menu_body" when mouse is over the paragraph
	$("#menupane p.menu_head").click(function() {
		if ($(this).children("img.arrow").attr("src") == "img/minus.png") {
			$(this).children("img.arrow").attr("src","img/plus.png");
			//$(this).next("div.menu_body").slideUp(500);
			slideUpIE($(this).next("div.menu_body"), 500);
		} else {
			$(this).children("img.arrow").attr("src","img/minus.png");
			$(this).next("div.menu_body").slideDown(500);//.siblings("div.menu_body").slideUp("slow");
			//$(this).siblings().children("img.arrow").attr("src","img/plus.png");

			//$(this).children("img.arrow").attr("src","img/minus.png");
			//$(this).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
			//$(this).siblings().children("img.arrow").attr("src","img/plus.png");
		}
	});
	
	$(".bigTopMenu").corner("round 8px").parent().css('padding', '2px').corner("round 10px");
	/*$(".topButton").corner().mouseover(function() {
		$(this).css("background-color", "#cfcfcf");
		$(this).children("a").css("color", "#336699");
	});
	$(".topButton").corner().mouseout(function() {
		$(this).css("background-color", "#6f9bc9");
		$(this).children("a").css("color", "#000000");
	});
	*/
	
	$(".box").mouseover(function() {
		$(this).css("background", "#cfcfcf").children("a").css("color", "#336699");
		$(this).children(".boxtop").css("background-image", "url(img/round/ne-hover.gif)")
				.children(".boxtop div").css("background-image", "url(img/round/nw-hover.gif)")
		$(this).children(".boxbottom").css("background-image", "url(img/round/se-hover.gif)")
				.children(".boxbottom div").css("background-image", "url(img/round/sw-hover.gif)");
	});
	$(".box").mouseout(function() {
		$(this).css("background", "#6f9bc9").children("a").css("color", "#000000");
		$(this).children(".boxtop").css("background-image", "url(img/round/ne.gif)")
				.children(".boxtop div").css("background-image", "url(img/round/nw.gif)")
		$(this).children(".boxbottom").css("background-image", "url(img/round/se.gif)")
				.children(".boxbottom div").css("background-image", "url(img/round/sw.gif)");
	});
	
});