PopupMenuEnable=0 ;
if( navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion>="4.0" ) {
	PopupMenuEnable=1 ;
} else if( navigator.appName=="Netscape" && navigator.appVersion>="5.0" ) {
	PopupMenuEnable=0 ;
}

function MenuInitializing( MenuName ) {
	timer=null ;
	showtimer=null ;

	i=1 ;
	while ( MenuItemName=MenuName+"-"+i, obj=document.getElementById( MenuItemName ) ) {
		MenuPopupName=MenuItemName+"p" ;
		popup=document.getElementById( MenuPopupName ) ;
		if ( PopupMenuEnable ) {
			x=obj.offsetLeft ;
			y=obj.offsetTop ;
			obj2=obj ;
			while ( obj2=obj2.offsetParent ) {
				x+=obj2.offsetLeft ;
				y+=obj2.offsetTop ;
			}
			y+=obj.offsetHeight ;
			popup.style.left=x ;
			popup.style.top=y ;
			popup.style.visibility="hidden" ;
			popup.style.position="absolute" ;
		} else {
			popup.style.position="static" ;
		}
		i++ ;
	}
}

function MenuMouseOver( menu ) {
	if ( PopupMenuEnable ) {
		if ( timer ) {
			clearTimeout( timer ) ;
			timer=null ;
			if ( CurrMenu!=menu ) {
				MenuHidePopupByMenu() ;
			}
		}
		if ( showtimer ) {
			clearTimeout( showtimer ) ;
			CurrPopup.style.top=CurrPopupPos ;
		}
		CurrPopup=document.getElementById( menu.id+"p" ) ;
		CurrPopupPos=parseInt( CurrPopup.style.top ) ;
		GrowStep=0 ;
		showtimer=setTimeout( GrowPopup,20 ) ;
	}
}

function GrowPopup() {
	GrowStep++ ;
	if ( GrowStep*20<CurrPopup.offsetHeight ) {
		yy=CurrPopup.offsetHeight-GrowStep*20 ;
	} else {
		yy=0 ;
	}
	ww=CurrPopup.offsetWidth ;
	hh=CurrPopup.offsetHeight ;
	CurrPopup.style.clip="rect("+yy+"px,"+ww+"px,"+hh+"px,0px)" ;
	CurrPopup.style.top=CurrPopupPos-yy ;
	CurrPopup.style.visibility="visible" ;

	if ( yy>0 ) {
		showtimer=setTimeout( GrowPopup,20 ) ;
	} else {
		showtimer=null ;
	}
}

function MenuMouseOut( menu ) {
	if ( PopupMenuEnable ) {
		CurrMenu=menu ;
		timer=setTimeout( MenuHidePopupByMenu,100 ) ;
	}
}

function MenuHidePopupByMenu() {
	timer=null ;
	if ( showtimer ) {
		clearTimeout( showtimer ) ;
		showtimer=null ;
		CurrPopup.style.top=CurrPopupPos ;
	}
	CurrPopup=document.getElementById( CurrMenu.id+"p" ) ;
	CurrPopup.style.visibility="hidden" ;
}

function PopupMouseOver( popup ) {
	if ( PopupMenuEnable ) {
		clearTimeout( timer ) ;
		timer=null ;
	}
}

function PopupMouseOut( popup ) {
	if ( PopupMenuEnable ) {
		CurrPopup=popup ;
		timer=setTimeout( MenuHidePopupByPopup,100 ) ;
	}
}

function MenuHidePopupByPopup() {
	timer=null ;
	CurrPopup.style.visibility="hidden" ;
	if ( showtimer ) {
		clearTimeout( showtimer ) ;
		showtimer=null ;
		CurrPopup.style.top=CurrPopupPos ;
	}
}

