	function _Base()
	{
		this.LockSelected = null;
		this.LockInputed = null;
		this.Browser = ((navigator.appName == "Microsoft Internet Explorer") ? true : false);
		
		this.Http = /^(http|https):\/\/[A-Za-z0-9%\-_@]+\.[A-Za-z0-9%\-_@]{2,}[A-Za-z0-9\.\/=\?%\-&_~`@[\]:+!;]*$/ig;//Http地址
		this.Random = function(){return Math.random();}
		this.$ = function()
		{
			var Items = new Array();
			var aItems = arguments;
			for (var i = 0; i < aItems.length; i++)
			{
				var Item = aItems[i];
				if (typeof(Item) == "string") Item = document.getElementById(Item);
				if (aItems.length == 1) return Item; 
				Items.push(Item); 
			} 
			return Items; 
		}
		this.NoScroll = function(){document.body.style.overflow = "hidden";}
		this.Scroll = function(){document.body.style.overflow = "auto";}
		this.IsNull = function(object){return this.Null(object,false);}
		this.IsObject = function(object){return !this.Null(object,true);}
		this.NotNull = function(object){return !this.IsNull(object);}
		this.NotObject = function(object){return !this.IsObject(object);}
		this.Null = function(object, IsObject)
		{
			if (object == null) return true;
			if (IsObject) return false;
			if (object == "") return true;
			return false;
		}
		this.Search = function(object, Partent)
		{
			if (this.IsNull(object)) return false;
			Partent.lastIndex = 0;
			return Partent.test(object);
		}
		this.IsInt = function(object){return this.Search(object, this.Int);}
		this.IsMail = function(object){return this.Search(object, this.Mail);}
		this.IsFloat = function(object){return this.Search(object, this.Float);}
		this.ToInt = function(object){return this.ToDefaultInt(object,0);}
		this.ToDefaultInt = function(object,dValue)
		{
			if (!this.IsInt(object)) return dValue;
			return parseInt(object,10);
		}
		this.ToMinInt = function(object,minValue)
		{
			var iValue = this.ToInt(object);
			if (iValue < minValue) return 0;
			return iValue;
		}
		this.ToMinDefaultInt = function(object, minValue, dValue)
		{
			var iValue = this.ToDefaultInt(object, dValue);
			if (iValue < minValue) return dValue;
			return iValue;
		}
		this.ToMaxInt = function(object,maxValue)
		{
			var iValue = this.ToInt(object);
			if (iValue > maxValue) return 0;
			return iValue;
		}
		this.ToMaxDefaultInt = function(object, maxValue, dValue)
		{
			var iValue = this.ToDefaultInt(object, dValue);
			if (iValue > maxValue) return dValue;
			return iValue;
		}
		this.ToMinMaxInt = function(object, minValue, maxValue)
		{
			var iValue = this.ToInt(object);
			if (iValue < minValue) return 0;
			if (iValue > maxValue) return 0;
			return iValue;
		}
		this.ToMinMaxDefaultInt = function(object, minValue, maxValue, dValue)
		{
			var iValue = this.ToDefaultInt(object, dValue);
			if (iValue < minValue) return dValue;
			if (iValue > maxValue) return dValue;
			return iValue;
		}
		this.ToFloat = function(object){return this.ToDefaultFloat(object,0);}
		this.ToDefaultFloat = function(object, dValue)
		{
			if (!this.IsFloat(object)) return dValue;
			return parseFloat(object);
		}
		this.ToMinFloat = function(object, minValue)
		{
			var iValue = this.ToFloat(object);
			if (iValue < minValue) return 0;
			return iValue;
		}
		this.ToMinDefaulrFloat = function(object, minValue, dValue)
		{
			var iValue = this.ToDefaultFloat(object, dValue);
			if (iValue < minValue) return dValue;
			return iValue;
		}
		this.ToMaxFloat = function(object, maxValue)
		{
			var iValue = this.ToFloat(object);
			if (iValue > maxValue) return 0;
			return iValue;
		}
		this.ToMaxDefaulrFloat = function(object, maxValue, dValue)
		{
			var iValue = this.ToDefaultFloat(object, dValue);
			if (iValue > maxValue) return dValue;
			return iValue;
		}
		this.ToMinMaxFloat = function(object, minValue, maxValue)
		{
			var iValue = this.ToFloat(object);
			if (iValue < minValue) return 0;
			if (iValue > maxValue) return 0;
			return iValue;
		}
		this.ToMinMaxDefaultFloat = function(object, minValue, maxValue, dValue)
		{
			var iValue = this.ToDefaultFloat(object, dValue);
			if (iValue < minValue) return dValue;
			if (iValue > maxValue) return dValue;
			return iValue;
		}
		this.Left = function(string,len)
		{
			if (this.IsNull(string,"")) return "";
			if (string.length > len) return string.substring(0,len);
			return string;
		}
		this.Right = function(string,len)
		{
			if (this.IsNull(string,"")) return "";
			var slen = string.length;
			if (slen > len) return string.substring(slen - len, slen);
			return string;
		}
		this.Mid = function(string,star,end)
		{
			if (this.IsNull(string,"")) return "";
			var slen = string.length;
			if (star < 1) star = 1;
			star--;
			if (star > slen) return "";
			if (end > slen) return string.substring(star, slen);
			return string.substring(star, end);
		}
		this.MidLen = function(string,star,len)
		{
			if (this.IsNull(string,"")) return "";
			var slen = string.length;
			if (star < 1) star = 1;
			star--;
			if (star > slen) return "";
			if (star + len > slen) return string.substring(star, slen);
			return string.substring(star, star + len);
		}
		this.GetCnLen = function(string)
		{
			if (this.IsNull(string,"")) return 0;
			var astring = string.split("");
			var slen = astring.length;
			var clen = 0;
			for(var i = 0 ; i < slen; i++)
			{
				var temp = escape(astring[i]);
				if (temp.indexOf("%u") >= 0) clen++;
				clen++;
			}
			return clen;
		}
		this.GetEnLen = function(string)
		{
			if (this.IsNull(string,"")) return 0;
			return string.length;
		}
		this.ToNumUrl = function(Url,Name)
		{
			var Obj = this.$(Name);
			if (this.NotObject(Obj)) return;
			var P = this.ToDefaultInt(Obj.value,1);
			location.href = Url + "" + P + "";
		}
		this.ToUrl = function(Url){location.href = Url;}

		this.ClearOptions = function(Obj)
		{
			if (Obj.type.toUpperCase() != "SELECT-ONE") return;
			Obj.options.length = 0;
			this.AddOptions(Obj, "请选择....", "0");
		}
		this.AddOptions = function(Obj, Text, Value)
		{
			var Option = document.createElement("OPTION");
			Option.value = Value;
			Option.text = Text;
			Obj.options.add(Option); 
		}
		this.Alert = function(Objs, flag)
		{
			if (Objs == null) return;
			for(var i = 0;i < Objs.length;i++)
			{
				var obj = this.$(Objs[i]);
				if (obj == null) return;
				var css = obj.className;
				if (this.IsNull(css) && flag) return;
				if (this.IsNull(css) && !flag) obj.className = "Halert";
				(css.indexOf("Halert") >= 0) ? (flag ? (obj.className = css.replace("Halert","")) :"") : (flag ? "" : (obj.className = css + " Halert"));
			}
			(flag) ? this.NoScroll() : this.Scroll();
			this.LockSelect();
		}
		this.LockSelect = function()
		{
			this.LockSelected = new Array();
			var Objs = document.getElementsByTagName("SELECT");
			for(var i = 0 ; i < Objs.length; i++)
			{
				if (!Objs[i].disabled)
				{
					this.LockSelected[i] = (this.IsNull(Objs[i].id) ? Objs[i].name : Objs[i].id);
					Objs[i].disabled = true;
				}
				else
					this.LockSelected[i] = "";
			}
		}
		this.UnLockSelect = function()
		{
			if (this.LockSelected == null) return;
			var Objs = document.getElementsByTagName("SELECT");
			for(var i = 0 ; i < Objs.length; i++)
			{
				((this.IsNull(Objs[i].id) ? Objs[i].name : Objs[i].id) == this.LockSelected[i]) ? Objs[i].disabled = false : "";
			}
			this.LockSelected = null;
		}
		this.LockInput = function()
		{
			this.LockInputed = new Array();
			var Objs = document.getElementsByTagName("INPUT");
			for(var i = 0 ; i < Objs.length; i++)
			{
				if (!Objs[i].disabled)
				{
					this.LockInputed[i] = (this.IsNull(Objs[i].id) ? Objs[i].name : Objs[i].id);
					Objs[i].disabled = true;
				}
				else
					this.LockInputed[i] = "";
			}
		}
		this.UnLockInput = function()
		{
			if (this.LockInputed == null) return;
			var Objs = document.getElementsByTagName("INPUT");
			for(var i = 0 ; i < Objs.length; i++)
			{
				((this.IsNull(Objs[i].id) ? Objs[i].name : Objs[i].id) == this.LockInputed[i]) ? Objs[i].disabled = false : "";
			}
			this.LockInputed = null;
		}
		this.ReLoadImg = function(Obj)
		{
			var Src = Obj.src;
			var Int = Src.indexOf("?");
			if (Src.indexOf("?") > 0) Src = this.Left(Src,Int);
			Obj.src = Src + "?" + this.Random();
		}
		this.Point = function(Obj)
		{
			var _Point = { X: Obj.offsetLeft, Y: Obj.offsetTop };
			if (Obj.offsetParent)
			{
				var __Point = this.Point(Obj.offsetParent);
				_Point.X += __Point.X;
				_Point.Y += __Point.Y;
			}
			return _Point;
		}
	}
	var Base = new _Base();
	
	//ToSeconds 速度（毫秒）
	function _Advice(DivID , SpanID , ClassName , AutoStar , Height , MaxIndex , ToStep , ToSeconds)
	{
		this.DivID = DivID; this.SpanID = SpanID; this.ClassName = ClassName; this.AutoStar = AutoStar;
		this.Height = Height; this.MaxIndex = MaxIndex; this.ToStep = ToStep; this.ToSeconds = ToSeconds;
		this.Index = 0; this.ToIndex = 0; this.OperIndex = true; this.AutoInt = true; this.StarPix = 0;
		this.EndPix = 0; this.DivObj = null;
		this.OperClass = function()
		{
			for(var i = 0; i <= this.MaxIndex; i++) Base.$(this.SpanID + i).className = this.ClassName + ((this.ToIndex == i) ? "1" : "0");
		}
		this.Move = function(tIndex)
		{
			this.ToIndex = tIndex;
			if (this.ToIndex == this.Index) return;
			this.OperClass();
			this.DivObj = Base.$(this.DivID);
			this.OperIndex = this.ToIndex > this.Index;
			this.StarPix = this.Index * this.Height;
			this.EndPix = this.ToIndex * this.Height;
			this.Moving();
		}
		this.Moving = function()
		{
			if (!(this.OperIndex ? (this.StarPix < this.EndPix) : (this.StarPix > this.EndPix))){ this.Index = this.ToIndex; return; }
			var Self = this; this.MovePix();
			window.setTimeout(function(){ Self.Moving(); },1);
		}
		this.MovePix = function()
		{
			if (this.OperIndex)
			{
				this.StarPix += this.ToStep;
				if (this.StarPix > this.EndPix) this.StarPix = this.EndPix;
			}
			else
			{
				this.StarPix -= this.ToStep;
				if (this.StarPix < this.EndPix) this.StarPix = this.EndPix;
			}
			this.DivObj.style.marginTop = "-" + this.StarPix + "px";
		}
		this.Auto = function()
		{
			if (!this.AutoStar) return;
			if (!this.AutoInt)
			{
				if (this.Index == this.MaxIndex) {this.ToIndex = this.Index - 1; this.OperIndex = false;}
				else if(this.Index == 0) {this.ToIndex = this.Index + 1; this.OperIndex = true;}
				else {this.ToIndex = ((this.OperIndex) ? (this.Index + 1) : (this.Index - 1));}
				
				this.Move(this.ToIndex);
			}
			var Self = this; this.AutoInt = false;
			window.setTimeout(function(){Self.Auto();},this.ToSeconds);
		}
	}
	