function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }
  return elements;
}

function addAction(menu)
{
	if (menu.nodeType!=3)
	{
	var temp=menu.firstChild;
		while(temp!=null)
		{
			if(temp.nodeName=="TD")
			{
				with(temp)
				{

  onmouseover=function(){
    if(this.firstChild&&this.firstChild.nodeName=='SPAN') {
    this.childNodes[1].firstChild.style.position='absolute';
    this.childNodes[1].firstChild.style.display='';
    this.childNodes[1].firstChild.style.overflowY='hidden';
    this.childNodes[1].firstChild.style.overflowX='hidden';
    if(!changeHeight[this.childNodes[1].firstChild.id]) this.childNodes[1].firstChild.style.height=20;
    this.className='Hover';
    changeHeight[this.childNodes[1].firstChild.id]={'sHeight':this.childNodes[1].firstChild.firstChild.clientHeight,'d':1};
    }
  };
  onmouseout=function(){
    if(this.firstChild&&this.firstChild.nodeName=='SPAN') {
    changeHeight[this.childNodes[1].firstChild.id]={'sHeight':this.childNodes[1].firstChild.firstChild.clientHeight,'d':-1};
    }
  };
				}
			}

			if(temp.nodeName!="A"&&temp.nodeName!="TABLE") addAction(temp);
		temp=temp.nextSibling;
		}
	}
}

var changeHeight={};

function eachInterval(){
	for(id in changeHeight){
		if($(id).clientHeight<changeHeight[id]['sHeight']&&changeHeight[id]['d']>0){
		$(id).style.height=($(id).clientHeight+7)+"px";
			if($(id).clientHeight>=changeHeight[id]['sHeight']) changeHeight[id]['d']=0;
		}
		if(changeHeight[id]['d']<0){
		$(id).style.height=$(id).clientHeight>7?($(id).clientHeight-7):0+"px";
			if($(id).clientHeight<=0){
			delete(changeHeight[id]);
			$(id).parentNode.parentNode.className='';
			}
		}
	}
}
window.setInterval(eachInterval,10);

