function TopMenuScroll() {
	this.GoodsSetTime = null;
}

TopMenuScroll.prototype.GoodsSetting = function(val) {
	this.TopMenuLocation = new Array();
	this.TopMenuDepth2Location = new Array();
	this.TopMenuWrap = document.getElementById(this.DivName);
	this.TopMenuList = this.TopMenuWrap.getElementsByTagName("dl")[0].getElementsByTagName("dt");
	this.TopMenuList1 = this.TopMenuWrap.getElementsByTagName("dl")[0].getElementsByTagName("dd");
	this.TopMenuTotal = this.TopMenuList.length;
	
	this.IEOpacityArray = new Array();
	this.FFOpacityArray = new Array();
	
	for ( var i=0; i<this.TopMenuTotal; i++ ) {
		this.TopMenuLocation[i] = -this.MovieHeight;
		this.TopMenuDepth2Location[i] = this.topMenuDepthStart;

		this.TopMenuListLink = this.TopMenuList.item(i).getElementsByTagName("a")[0];
		this.TopMenuListLink.style.backgroundPosition = "left " + this.TopMenuLocation[i] + "px";
		this.TopMenuListLink.Num = i;
		this.TopMenuListLink.onmouseover = function() {
			eval( "clearTimeout(" + TScroll.GoodsSetTime + ")");
			eval( TScroll.ScrollName + ".TopMenuMove(" + this.Num + ")");
		}
		
		this.TopMenuListLink.onfocus = function() {
			eval( "clearTimeout(" + TScroll.GoodsSetTime + ")");
			eval( TScroll.ScrollName + ".TopMenuMove(" + this.Num + ")");
		}
		
		if ( this.TopMenuList1.item(i) != undefined ) {
			if ( navigator.appName.indexOf("Explorer") != -1 ) {
				this.TopMenuList1.item(i).style.filter="Alpha(opacity=0)";
				this.IEOpacityArray[i] = - this.IEOpacity;
			} else {
				this.TopMenuList1.item(i).style.opacity=0;
				this.FFOpacityArray[i] = - this.FFOpacity;
			}
		}
	}
	if ( val != undefined && val >= 0 && val < this.TopMenuTotal) {
		this.TopMenuMove(val);
	}
}

TopMenuScroll.prototype.TopMenuMove = function(val) {
	this.TopMenuDepth1(val);
	this.TopMenuDepth2(val);
}

TopMenuScroll.prototype.TopMenuDepth1 = function(val,val2) {
	for ( var i=0; i<this.TopMenuTotal; i++ ) {
		this.TopMenuListLink = this.TopMenuList.item(i).getElementsByTagName("a")[0];
		if ( i == val ) {
			if ( this.TopMenuLocation[i] != 1 ) {
				this.TopMenuStop = 1;
				this.TopMenuLocation[i] = this.TopMenuLocation[i] + this.Speed;
				this.TopMenuListLink.style.backgroundPosition = "left " + this.TopMenuLocation[i] + "px";
			} else {
				this.TopMenuStop = 0;
			}
		} else {
			if ( this.TopMenuLocation[i] != -this.MovieHeight ) {
				this.TopMenuLocation[i] = this.TopMenuLocation[i] - this.Speed;
				this.TopMenuListLink.style.backgroundPosition = "left " + this.TopMenuLocation[i] + "px";
			}
		}
	}
	
	
	if ( this.TopMenuStop == 1 ) {
		this.GoodsSetTime = setTimeout( TScroll.ScrollName + ".TopMenuMove(" + val + ")",1);
		val2 += 1;
	}
}

TopMenuScroll.prototype.TopMenuDepth2 = function(val,val2) {
	for ( var i=0; i<this.TopMenuTotal; i++ ) {
		this.TopMenuListDepth2 = this.TopMenuWrap.getElementsByTagName("dl")[0].getElementsByTagName("dd")[i];
		if ( i == val ) {
			if ( this.TopMenuListDepth2 != undefined && this.TopMenuDepth2Location[i] >= this.topMenuDepthStart - ( this.topMenuDepthSpeed * this.topMenuDepthStep ) ) {
				this.TopMenuDepth2Location[i] = this.TopMenuDepth2Location[i] - this.topMenuDepthSpeed;
				this.TopMenuListDepth2.style.top = this.TopMenuDepth2Location[i] + "px";
				if ( navigator.appName.indexOf("Explorer") != -1 ) {
					this.IEOpacityArray[i] = this.IEOpacityArray[i] + this.IEOpacity;
					this.TopMenuListDepth2.style.filter = "Alpha(opacity=" + this.IEOpacityArray[i] + ")";
				} else {
					this.FFOpacityArray[i] = this.FFOpacityArray[i] + this.FFOpacity;
					this.TopMenuListDepth2.style.opacity = this.FFOpacityArray[i];
				}
			}
		} else {
			if ( this.TopMenuListDepth2 != undefined ) {
				if ( this.TopMenuDepth2Location[i] != this.topMenuDepthStart ) {
					this.TopMenuDepth2Location[i] = this.TopMenuDepth2Location[i] + this.topMenuDepthSpeed;
					this.TopMenuListDepth2.style.top = this.TopMenuDepth2Location[i] + "px";
					if ( navigator.appName.indexOf("Explorer") != -1 ) {
						this.IEOpacityArray[i] = this.IEOpacityArray[i] - this.IEOpacity;
						this.TopMenuListDepth2.style.filter = "Alpha(opacity=" + this.IEOpacityArray[i] + ")";
					} else {
						this.FFOpacityArray[i] = this.FFOpacityArray[i] - this.FFOpacity;
						this.TopMenuListDepth2.style.opacity = this.FFOpacityArray[i];
					}
				}
			}
		}
	}
}