var $ = jQuery.noConflict();

$(function(){
	/* BIG BUTTON ANIMATION */
	$('a.bigbutton').mouseenter(function(){
		$(this).stop(true, false).animate({ backgroundColor: "#98b73c", marginLeft: "7px", marginRight: "0px" }, 200)
	})
	$('a.bigbutton').mouseleave(function(){
			$(this).stop(true, true).animate({ backgroundColor: "#8aa43c", marginLeft: "0px", marginRight: "7px" }, 100, fix);
			function fix() {
				if ($('a.bigbutton').mouseleave) {
					$(this).animate({ backgroundColor: "#8aa43c" }, "fast")
				}
			}
	})
	/* MENU ROUNDED CORNERS for default WP3 menu*/
	$('div.menu ul ul li:first-child').addClass('li-first');
	$('div.menu ul ul li:last-child').addClass('li-last');
	$('div.menu ul ul ul li:first-child').addClass('li-first');
	$('div.menu ul ul ul li:last-child').addClass('li-last');
	$('div.menu ul ul').prev().addClass('a-level');
	$('div.menu ul ul ul').prev().removeClass('a-level');
	/* MENU ROUNDED CORNERS for custom WP3 menu*/
	$('ul.menu ul li:first-child').addClass('li-first');
	$('ul.menu ul li:last-child').addClass('li-last');
	$('ul.menu ul ul li:first-child').addClass('li-first');
	$('ul.menu ul ul li:last-child').addClass('li-last');
	$('ul.menu ul').prev().addClass('a-level');
	$('ul.menu ul ul').prev().removeClass('a-level');
	$('#sforum a:has(br)').find('br').remove();
/* TOGGLE */
	$('div.toggle').click(function () {
	$(this).next('div.toggle_content').toggle(250);
	});
	
	$('div.toggle').toggle(
	function () { $(this).css('background-position', 'left -68px'); },
	function () { $(this).css('background-position', 'left 12px'); }
	);

	// FIX THE HEIGHT OF THE POSTS SHORTCODE
	$('.grid-auto').each(function(){

		var maxH = 0;

			$('.posts-post',this).each(function(){

				var h = $(this).height();

					if (h > maxH) { maxH = h }

			})

		$('.posts-post > div',this).css('height',maxH);

	})

});
