
function ShowMenu(el,duration,dir){
	var $el = $j(el);
	xx = $el.attr('id');
	yy = xx.split('_');
	height = yy[1];
	if(dir){
		$el.show().stop().animate({height: height}, {duration: duration,complete:function(){
				$el.css({'visibility':'visible','width':'auto'});
			}
		});
	}else{
		$el.stop().animate({height: 0}, {duration: duration, complete:function (){
	        $el.hide();
	      }
	    });
	}
}

function slideToggle(el, bShow){
	var $jel = $j(el), height = $jel.data("originalHeight"), visible = $jel.is(":visible");

	// if the bShow isn't present, get the current visibility and reverse it
	if( arguments.length == 1 ) bShow = !visible;

	// if the current visiblilty is the same as the requested state, cancel
	if( bShow == visible ) return false;

	//alert(height);
	//height = $jel.innerHeight();
	// get the original height
	if( !height ){
		// get original height
		height = $jel.show().height();
		// update the height
		$jel.data("originalHeight", height);
		// if the element was hidden, hide it again
		if( !visible ) $jel.hide().css({height: 0});
	  }

	  // expand the knowledge (instead of slideDown/Up, use custom animation which applies fix)
	  if( bShow ){
	    $jel.show().animate({height: height}, {duration: 400});
	  } else {
	    $jel.animate({height: 0}, {duration: 400, complete:function (){
	        $jel.hide();
	      }
	    });
	  }
	}
        
