 // JavaScript Document

try {
  document.execCommand('BackgroundImageCache',false,true);
} catch(e) { }

timeID = new Array();

function fnGoodsMove_Type1() {
	this.GoodsSetTime = null;
	this.FlagNum = 0;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.TotalBox = this.ObjBox.parentNode;
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;

if(this.BannerPrevLeft==2226) this.BannerPrevLeft=1590;
this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
if(this.BannerNextLeft==1749) this.BannerNextLeft=0;
this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
 
		
		//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime);
		
		this.TotalBox.fnName = this.fnName;
		this.TotalBox.BannerNextLeft = val;
		this.TotalBox.DateWidth = this.DateWidth;
		this.TotalBox.DateNum = this.DateNum;
		this.TotalBox.BannerEnd = this.BannerEnd;
		this.TotalBox.FlagNum = this.FlagNum;
		this.TotalBox.onmouseover = function()	{ 
			eval("if (timeID['" + this.fnName + "']) clearTimeout(timeID['" + this.fnName + "']);");
			eval( this.fnName + ".FlagNum = 1");
		}
		this.TotalBox.onmouseout = function()		{
			eval( this.fnName + ".FlagNum = 0");
			eval("timeID['" + this.fnName + "'] = setTimeout(\"" + this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')\", 10)");
		}

		if ( this.FlagNum == 0 ) {

			if ( Math.abs(val - this.BannerCurrent) > 5 ) {
				this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
			} else {
				this.BannerCurrent = val;
			}
			
			this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
			
			if ( this.BannerCurrent != val ) {
				this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
			} else {
				this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
				
				this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
				this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
				
				if ( this.BannerCurrent == 0 ) {
					this.BannerPrevLeft = this.BannerEnd;
				} else if ( this.BannerCurrent == this.BannerEnd ) {
					this.BannerNextLeft = 0;
				}
				if(this.BannerPrevLeft==2226) this.BannerPrevLeft=1590;
				this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
				if(this.BannerNextLeft==1749) this.BannerNextLeft=0;
				this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
			}
		 
			//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
		}
	}
}



function fnGoodsMove_Type2() {
	this.GoodsSetTime = null;
	this.FlagNum = 0;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.TotalBox = this.ObjBox.parentNode;
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;

		if(this.BannerPrevLeft==1260) this.BannerPrevLeft=720;
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		if(this.BannerNextLeft==900) this.BannerNextLeft=0;
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
 
		
		//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime);
		
		this.TotalBox.fnName = this.fnName;
		this.TotalBox.BannerNextLeft = val;
		this.TotalBox.DateWidth = this.DateWidth;
		this.TotalBox.DateNum = this.DateNum;
		this.TotalBox.BannerEnd = this.BannerEnd;
		this.TotalBox.FlagNum = this.FlagNum;
		this.TotalBox.onmouseover = function()	{ 
			eval("if (timeID['" + this.fnName + "']) clearTimeout(timeID['" + this.fnName + "']);");
			eval( this.fnName + ".FlagNum = 1");
		}
		this.TotalBox.onmouseout = function()		{
			eval( this.fnName + ".FlagNum = 0");
			eval("timeID['" + this.fnName + "'] = setTimeout(\"" + this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')\", 10)");
		}

		if ( this.FlagNum == 0 ) {

			if ( Math.abs(val - this.BannerCurrent) > 5 ) {
				this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
			} else {
				this.BannerCurrent = val;
			}
			
			this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
			
			if ( this.BannerCurrent != val ) {
				this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
			} else {
				this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
				
				this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
				this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
				
				if ( this.BannerCurrent == 0 ) {
					this.BannerPrevLeft = this.BannerEnd;
				} else if ( this.BannerCurrent == this.BannerEnd ) {
					this.BannerNextLeft = 0;
				}
		if(this.BannerPrevLeft==1260) this.BannerPrevLeft=720;
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		if(this.BannerNextLeft==900) this.BannerNextLeft=0;
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
			}
			 
			//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
		}
	}
}


function fnGoodsMove_Type3() {
	this.GoodsSetTime = null;
	this.FlagNum = 0;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.TotalBox = this.ObjBox.parentNode;
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.PrevBtnLinkB = document.getElementById(this.PrevBtnB);
		this.NextBtnLinkB = document.getElementById(this.NextBtnB);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;

		 

		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		this.PrevBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		
		//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime);
		
		this.TotalBox.fnName = this.fnName;
		this.TotalBox.BannerNextLeft = val;
		this.TotalBox.DateWidth = this.DateWidth;
		this.TotalBox.DateNum = this.DateNum;
		this.TotalBox.BannerEnd = this.BannerEnd;
		this.TotalBox.FlagNum = this.FlagNum;
		this.TotalBox.onmouseover = function()	{ 
			eval("if (timeID['" + this.fnName + "']) clearTimeout(timeID['" + this.fnName + "']);");
			eval( this.fnName + ".FlagNum = 1");
		}
		this.TotalBox.onmouseout = function()		{
			eval( this.fnName + ".FlagNum = 0");
			eval("timeID['" + this.fnName + "'] = setTimeout(\"" + this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')\", 10)");
		}

		if ( this.FlagNum == 0 ) {

			if ( Math.abs(val - this.BannerCurrent) > 5 ) {
				this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
			} else {
				this.BannerCurrent = val;
			}
			
			this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
			
			if ( this.BannerCurrent != val ) {
				this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
			} else {
				this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
				
				this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
				this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
				
				if ( this.BannerCurrent == 0 ) {
					this.BannerPrevLeft = this.BannerEnd;
				} else if ( this.BannerCurrent == this.BannerEnd ) {
					this.BannerNextLeft = 0;
				}
		 
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
 		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		this.PrevBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
			}
			 
				
			//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
		}
	}
}



function fnGoodsMove_Type4() {
	this.GoodsSetTime = null;
	this.FlagNum = 0;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.TotalBox = this.ObjBox.parentNode;
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.PrevBtnLinkB = document.getElementById(this.PrevBtnB);
		this.NextBtnLinkB = document.getElementById(this.NextBtnB);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;

		 

		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		this.PrevBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		
		//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime);
		
		this.TotalBox.fnName = this.fnName;
		this.TotalBox.BannerNextLeft = val;
		this.TotalBox.DateWidth = this.DateWidth;
		this.TotalBox.DateNum = this.DateNum;
		this.TotalBox.BannerEnd = this.BannerEnd;
		this.TotalBox.FlagNum = this.FlagNum;
		this.TotalBox.onmouseover = function()	{ 
			eval("if (timeID['" + this.fnName + "']) clearTimeout(timeID['" + this.fnName + "']);");
			eval( this.fnName + ".FlagNum = 1");
		}
		this.TotalBox.onmouseout = function()		{
			eval( this.fnName + ".FlagNum = 0");
			eval("timeID['" + this.fnName + "'] = setTimeout(\"" + this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')\", 10)");
		}

		if ( this.FlagNum == 0 ) {

			if ( Math.abs(val - this.BannerCurrent) > 5 ) {
				this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
			} else {
				this.BannerCurrent = val;
			}
			
			this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
			
			if ( this.BannerCurrent != val ) {
				this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
			} else {
				this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
				
				this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
				this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
				
				if ( this.BannerCurrent == 0 ) {
					this.BannerPrevLeft = this.BannerEnd;
				} else if ( this.BannerCurrent == this.BannerEnd ) {
					this.BannerNextLeft = 0;
				}
		 
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		this.PrevBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLinkB.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
			}
			 
				
			//this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame(" + this.BannerNextLeft + ",'next')" , 3000 );
		
		}
	}
}
