/*首页FLASH图片*/
<!-- 
function FlashImg(pics,texts,links,focus_width,focus_height,text_height){
var interval_time=5 ;
var text_mtop = 0;
var text_lm = 0;
var textmargin = text_mtop+"|"+text_lm;
var textcolor = "#333333|0xfe3600";
var text_align= 'center'; 
var swf_height = focus_height+text_height+text_mtop; 
var text_size = 12;
var borderStyle="0|0xffffff|100";
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/FlashImg.swf"> <param name="quality" value="high"><param name="Wmode" value="transparent">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&textmargin='+textmargin+'&textcolor='+textcolor+'&borderstyle='+borderStyle+'&text_align='+text_align+'&interval_time='+interval_time+'&textsize='+text_size+'">');
document.write('<embed src="/images/FlashImg.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&textmargin='+textmargin+'&textcolor='+textcolor+'&borderstyle='+borderStyle+'&text_align='+text_align+'&interval_time='+interval_time+'&textsize='+text_size+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');	document.write('</object>');
}


function InfoTag(Tag,TagContent,Count,Num) {
    for(i=1; i<=Count; i++) {
	var TagId=document.getElementById(Tag+i);
	var TagContentId=document.getElementById(TagContent+i);
	if(TagId&&TagContentId){
		if (i==Num) {
			TagId.className="tab_d_"+i;
			TagContentId.style.display="block";
			}
		else {
			TagId.className="tab_"+i;
			TagContentId.style.display="none";
			}
		}
	}
}

var sid = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
	return destination;
}

var CurrentStyle = function(element){
	return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}

var Bind = function(object, fun) {
	var args = Array.prototype.slice.call(arguments).slice(2);
	return function() {
		return fun.apply(object, args.concat(Array.prototype.slice.call(arguments)));
	}
}

var Tween = {
	Quart: {
		easeOut: function(t,b,c,d){
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		}
	},
	Back: {
		easeOut: function(t,b,c,d,s){
			if (s == undefined) s = 1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		}
	},
	Bounce: {
		easeOut: function(t,b,c,d){
			if ((t/=d) < (1/2.75)) {
				return c*(7.5625*t*t) + b;
			} else if (t < (2/2.75)) {
				return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
			} else {
				return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
			}
		}
	}
}


//容器对象,滑动对象,切换数量
var SlideTrans = function(container, slider, count, options) {
	this._slider = sid(slider);
	this._container = sid(container);//容器对象
	this._timer = null;//定时器
	this._count = Math.abs(count);//切换数量
	this._target = 0;//目标值
	this._t = this._b = this._c = 0;//tween参数
	
	this.Index = 0;//当前索引
	
	this.SetOptions(options);
	
	this.Auto = !!this.options.Auto;
	this.Duration = Math.abs(this.options.Duration);
	this.Time = Math.abs(this.options.Time);
	this.Pause = Math.abs(this.options.Pause);
	this.Tween = this.options.Tween;
	this.onStart = this.options.onStart;
	this.onFinish = this.options.onFinish;
	
	var bVertical = !!this.options.Vertical;
	this._css = bVertical ? "top" : "left";//方向
	
	//样式设置
	var p = CurrentStyle(this._container).position;
	p == "relative" || p == "absolute" || (this._container.style.position = "relative");
	this._container.style.overflow = "hidden";
	this._slider.style.position = "absolute";
	
	this.Change = this.options.Change ? this.options.Change :
		this._slider[bVertical ? "offsetHeight" : "offsetWidth"] / this._count;
};
SlideTrans.prototype = {
  //设置默认属性
  SetOptions: function(options) {
	this.options = {//默认值
		Vertical:	true,//是否垂直方向（方向不能改）
		Auto:		true,//是否自动
		Change:		0,//改变量
		Duration:	50,//滑动持续时间
		Time:		10,//滑动延时
		Pause:		4000,//停顿时间(Auto为true时有效)
		onStart:	function(){},//开始转换时执行
		onFinish:	function(){},//完成转换时执行
		Tween:		Tween.Quart.easeOut//tween算子
	};
	Extend(this.options, options || {});
  },
  //开始切换
  Run: function(index) {
	//修正index
	index == undefined && (index = this.Index);
	index < 0 && (index = this._count - 1) || index >= this._count && (index = 0);
	//设置参数
	this._target = -Math.abs(this.Change) * (this.Index = index);
	this._t = 0;
	this._b = parseInt(CurrentStyle(this._slider)[this.options.Vertical ? "top" : "left"]);
	this._c = this._target - this._b;
	
	this.onStart();
	this.Move();
  },
  //移动
  Move: function() {
	clearTimeout(this._timer);
	//未到达目标继续移动否则进行下一次滑动
	if (this._c && this._t < this.Duration) {
		this.MoveTo(Math.round(this.Tween(this._t++, this._b, this._c, this.Duration)));
		this._timer = setTimeout(Bind(this, this.Move), this.Time);
	}else{
		this.MoveTo(this._target);
		this.Auto && (this._timer = setTimeout(Bind(this, this.Next), this.Pause));
	}
  },
  //移动到
  MoveTo: function(i) {
	this._slider.style[this._css] = i + "px";
  },
  //下一个
  Next: function() {
	this.Run(++this.Index);
  },
  //上一个
  Previous: function() {
	this.Run(--this.Index);
  },
  //停止
  Stop: function() {
	clearTimeout(this._timer); this.MoveTo(this._target);
  }
};


function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}

Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1)
	{
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}
	else
	{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0)
		{
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}
		else
		{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))			{
				msobj.ID.innerHTML = msobj.tempHTML;
				delete(msobj.tempHTML);
				return;
			}
			delete(msobj.tempHTML);
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}


function getid(id) { return document.getElementById(id); }

function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function(){
			oldonload();
			func();
		}
	}
}

function moveElement(elementID,final_x,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
    elem.style.left = "0px";
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x && ypos == final_y) {
		return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/10);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/10);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/10);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "px";
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}

function classNormal(iFocusBtnID,iFocusTxID){
	var iFocusBtns= getid(iFocusBtnID).getElementsByTagName('li');
	var iFocusTxs = getid(iFocusTxID).getElementsByTagName('li');
	for(var i=0; i<iFocusBtns.length; i++) {
		iFocusBtns[i].className='normal';
		iFocusTxs[i].className='normal';
	}
}

function classCurrent(iFocusBtnID,iFocusTxID,n){
	var iFocusBtns= getid(iFocusBtnID).getElementsByTagName('li');
	var iFocusTxs = getid(iFocusTxID).getElementsByTagName('li');
	iFocusBtns[n].className='current';
	iFocusTxs[n].className='current';
}

function iFocusChange() {
	if(!getid('ifocus')) return false;
	getid('ifocus').onmouseover = function(){atuokey = true};
	getid('ifocus').onmouseout = function(){atuokey = false};
	var iFocusBtns = getid('ifocus_btn').getElementsByTagName('li');
	var listLength = iFocusBtns.length;
	iFocusBtns[0].onmouseover = function() {
		moveElement('ifocus_piclist',0,0,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',0);
	}
	if (listLength>=2) {
		iFocusBtns[1].onmouseover = function() {
			moveElement('ifocus_piclist',0,-227,5);
			classNormal('ifocus_btn','ifocus_tx');
			classCurrent('ifocus_btn','ifocus_tx',1);
		}
	}
	if (listLength>=3) {
		iFocusBtns[2].onmouseover = function() {
			moveElement('ifocus_piclist',0,-454,5);
			classNormal('ifocus_btn','ifocus_tx');
			classCurrent('ifocus_btn','ifocus_tx',2);
		}
	}
	if (listLength>=4) {
		iFocusBtns[3].onmouseover = function() {
			moveElement('ifocus_piclist',0,-681,5);
			classNormal('ifocus_btn','ifocus_tx');
			classCurrent('ifocus_btn','ifocus_tx',3);
		}
	}
}

setInterval('autoiFocus()',5000);
var atuokey = false;
function autoiFocus() {
	if(!getid('ifocus')) return false;
	if(atuokey) return false;
	var focusBtnList = getid('ifocus_btn').getElementsByTagName('li');
	var listLength = focusBtnList.length;
	for(var i=0; i<listLength; i++) {
		if (focusBtnList[i].className == 'current') var currentNum = i;
	}
	if (currentNum==0&&listLength!=1 ){
		moveElement('ifocus_piclist',0,-227,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',1);
	}
	if (currentNum==1&&listLength!=2 ){
		moveElement('ifocus_piclist',0,-454,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',2);
	}
	if (currentNum==2&&listLength!=3 ){
		moveElement('ifocus_piclist',0,-681,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',3);
	}
	if (currentNum==3 ){
		moveElement('ifocus_piclist',0,0,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',0);
	}
	if (currentNum==1&&listLength==2 ){
		moveElement('ifocus_piclist',0,0,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',0);
	}
	if (currentNum==2&&listLength==3 ){
		moveElement('ifocus_piclist',0,0,5);
		classNormal('ifocus_btn','ifocus_tx');
		classCurrent('ifocus_btn','ifocus_tx',0);
	}
}

//幻灯片
function setTab(/*string*/name,/*int*/ itemCnt,/*int*/ curItem, /**/classHide, /**/classShow)
{
	 for(i=1;i<=itemCnt;i++)
	{
		eval("document.getElementById('tab_" + name + "_" + i + "').className='" + classHide + "'");
	} 
	eval("document.getElementById('tab_" + name + "_" + curItem + "').className='" + classShow + "'");
 
 for(i=1;i<=itemCnt;i++)
 {
  eval("ele_hide = document.getElementById('con_" + name + "_" + i +"')");
  if(ele_hide) ele_hide.style.display = "none";
 }
 eval("ele_play = document.getElementById('con_" + name + "_" + curItem + "')");
 if(ele_play) ele_play.style.display = "block";
}

var pause = false;
var con_num = 4;
var startIndex = 1;
function setLoop(){
	try{
	var oScroll = document.getElementById('banner');
	oScroll.noWrap = true;
	oScroll.onmouseover = function(e){pause = true;};
	oScroll.onmouseout = function(e){pause = false;};
	setInterval('scrollTopHome()', 3000);
	}catch(e){alert(e.toString());}
}
function scrollTopHome(){
	if(pause) return;
	startIndex += 1;
	if(startIndex > con_num){startIndex = 1;}
	setTab('tophome',4,startIndex,'out','on');
} 


/**************************/


function scrollDoor(){
}
scrollDoor.prototype = {
	sd : function(menus,divs,openClass,closeClass){
		var _this = this;
		if(menus.length != divs.length)
		{
			alert("菜单层数量和内容层数量不一样!");
			return false;
		}				
		for(var i = 0 ; i < menus.length ; i++)
		{	
			_this.$(menus[i]).value = i;				
			_this.$(menus[i]).onmouseover = function(){
					
				for(var j = 0 ; j < menus.length ; j++)
				{						
					_this.$(menus[j]).className = closeClass;
					_this.$(divs[j]).style.display = "none";
				}
				_this.$(menus[this.value]).className = openClass;	
				_this.$(divs[this.value]).style.display = "block";				
			}
		}
		},
	$ : function(oid){
		if(typeof(oid) == "string")
		return document.getElementById(oid);
		return oid;
	}
}

 
/*
 * Get the number part of a style property value.
 */
function GetStyleNumber(strArg) {
	if (null == strArg || "" == strArg) {
		return 0;
	}
	var i = 0;
	for (i = 0; i < strArg.length; i++) {
		if (isNaN(strArg.charAt(i))) break;
	}
	if (0 == i) {
		return 0;
	}
	var strNum = strArg.substr(0, i);
	return parseInt(strNum, 10);
}

/*##################################################*/
 
/*
 * Class SlideTab
 */
function SlideTab(parentDiv, titleWidth, stepPercent) {

	// Container Div.
	this.container = document.getElementById(parentDiv);
	if (null == this.container) {
		alert("SlideTab.Create: The DIV '" + parentDiv + "' doesn't exist.");
		return;
	}
	this.scopeW = GetStyleNumber(this.container.style.width);
	this.scopeH = GetStyleNumber(this.container.style.height);
	this.scopeT = GetStyleNumber(this.container.style.top);
	this.scopeL = GetStyleNumber(this.container.style.left);
	
	// Title width.
	if (isNaN(titleWidth)) {
		alert("SlideTab.Create: Title width should be a number.");
		return;
	}
	this.titleW = titleWidth;
	// Slide width.
	this.slideW = 0;
	
	// Step percent.
	if (isNaN(stepPercent)) {
		alert("SlideTab.Create: Step percent should be a number.");
		return;
	}
	this.stepPer = stepPercent;
	
	// Tab List.
	this.tabNames = new Array();
	this.tabFlags = new Array();
	this.tabInitX = new Array();
	this.tabPosX = new Array();
	// On Ging.
	this.runningIdx = -1;
	this.toLeft = false;
	// Timer.
	this.timer = null;
	this.percent = 0;
	
	//--------------------------------------------------------

	// Add a tab to this slide.
	this.addTab = function (tabName) {
		this.tabNames.push(tabName);
	}
	
	// Get the tab list length.
	this.getLength = function() {
		return this.tabNames.length;
	}
	
	// Initialize.
	this.init = function() {
		this.container.style.overflow = "hidden";		
		var i = 0;
		for (i = 0; i < this.tabNames.length; i++) {			
			var item = document.getElementById(this.tabNames[i]);
			var itemL = this.scopeL + (this.titleW * i);
			this.tabInitX.push(itemL);
			this.tabPosX.push(itemL);
			item.style.left = itemL + "px";
			item.style.top = this.scopeT + "px";
			item.style.zIndex = this.container.style.zIndex + (this.tabNames.length - i);
			item.style.display = "block";
			item.style.overflow = "hidden";
			this.tabFlags.push('R');
		}
		this.slideW = this.scopeW - (this.titleW * this.tabNames.length);
	}
	
	// Find a tab.
	this.findTab = function(tabName) {
		var i = 0;
		for (i = 0; i < this.tabNames.length; i++) {
			if (this.tabNames[i] == tabName) {
				return i;
			}
		}
		return -1;
	}
	
	// Clean the playing effect.
	this.clean = function() {
		// No running tab.
		if (this.runningIdx == -1) {
			return;
		}
		
		// Stop the playing effect.
		clearInterval(this.timer);
		this.timer = null;
		this.percent = 0;
		
		// Clean the house.
		if (this.toLeft) {
			// A tab should go to the left.
			var i = 0;
			for (i = 0; i <= this.runningIdx; i++) {
				if ('L' != this.tabFlags[i]) {
					var item = document.getElementById(this.tabNames[i]);
					this.tabPosX[i] = this.tabInitX[i] - this.slideW;
					item.style.left = this.tabPosX[i] + "px";
					this.tabFlags[i] = 'L';
					this.tabInitX[i] = this.tabPosX[i];
				}
			}
		} else {		
			// A tab should go to the right.
			var i = 0;
			for (i = this.runningIdx; i < this.tabFlags.length; i++) {
				if ('R' != this.tabFlags[i]) {
					var item = document.getElementById(this.tabNames[i]);
					this.tabPosX[i] = this.tabInitX[i] + this.slideW;
					item.style.left = this.tabPosX[i] + "px";
					this.tabFlags[i] = 'R';
					this.tabInitX[i] = this.tabPosX[i];
				}
			}
		}
		this.runningIdx = -1;
	}
	
	// Show the specified tab.
	this.show = function(instName, tabName) {
		var idx = this.findTab(tabName);
		this.showByIndex(instName, idx);
		return idx;
	}
	
	// Show the specified tab by index.

	this.showByIndex = function(instName, idx) {
		this.clean();
			
		if ('R' == this.tabFlags[idx]) {
			// Now, the given tab is on the right.
			if (0 == idx) {
				// The first one is open. Do nothing.
				return;
			} else {
				// Not the first one.
				if ('L' == this.tabFlags[idx - 1]) {
					// The left tab is on the left. Do nothing.
					return;
				} else {
					// The left tab should go to the left.
					this.runningIdx = idx - 1;
					this.toLeft = true;
				}
			}
		} else { 
			// Now, the given tab is on the left. It should go to the right.
			this.runningIdx = idx;
			this.toLeft = false;
		}		
		
		this.timer = setInterval(instName + ".doSlide()", 50);
	}
	
	// Do the slide action.
	this.doSlide = function() {
		// Calculate the percent.
		this.percent = this.percent + this.stepPer;
		if (100 < this.percent) {
			this.percent = 100;
		}
		
		if (this.toLeft) {
			// A tab should go to the left.
			var i = 0;
			for (i = 0; i <= this.runningIdx; i++) {
				if ('L' != this.tabFlags[i]) {
					var item = document.getElementById(this.tabNames[i]);
					var delta = this.slideW * (this.percent / 100);
					this.tabPosX[i] = this.tabInitX[i] - delta;
					item.style.left = this.tabPosX[i] + "px";
					if (100 == this.percent) {
						this.tabFlags[i] = 'L';
						this.tabInitX[i] = this.tabPosX[i];
					}
				}
			}
		} else {			
			// A tab should go to the right.
			var i = 0;
			for (i = this.runningIdx; i < this.tabFlags.length; i++) {
				if ('R' != this.tabFlags[i]) {
					var item = document.getElementById(this.tabNames[i]);
					var delta = this.slideW * (this.percent / 100);
					this.tabPosX[i] = this.tabInitX[i] + delta;
					item.style.left = this.tabPosX[i] + "px";
					if (100 == this.percent) {
						this.tabFlags[i] = 'R';
						this.tabInitX[i] = this.tabPosX[i];
					}
				}
			}
		}
		
		// If done, clean the house.
		if (100 == this.percent) {
			this.clean();
		}
	}
	
	// Auto slide.
	this.loopSlide = function(instName) {
		var i = 0;
		var baseLine = this.tabFlags[0];
		var swap = false;
		for (i = 0; i < this.tabFlags.length; i++) {
			if (baseLine != this.tabFlags[i]) {
				swap = true;
				if (i == this.tabFlags.length - 1) {
					this.showByIndex(instName, 0);
				} else {
					this.showByIndex(instName, i + 1);
				}
				break;
			}
		}
		if (!swap) {
			this.showByIndex(instName, 1);
		}
	}
	
}

/*##################################################*/
 
/*
 * Class SwapTab
 */
function SwapTab(idPrefix) {

	this.preFix = idPrefix;
	if (null == this.preFix) {
		alert("SwapTab.Create: invalid argument.");
		return;
	}
	
	// Image URL buffer.
	this.openImgs = new Array();
	this.closeImgs = new Array();
	// Internal buffer.
	this.imgBuffer = new Array();
	
	// Add a swap tab.
	this.addTab = function(openSrc, closeSrc) {
		var img;
		
		this.openImgs.push(openSrc);
		img = new Image();
		img.src = openSrc;
		this.imgBuffer.push(img);
		
		this.closeImgs.push(closeSrc);
		img = new Image();
		img.src = closeSrc;
		this.imgBuffer.push(img);
	}
	
	this.showTab = function(idx) {
		var tabListLen = this.openImgs.length;
		var i = 0;
		for (i = 0; i < tabListLen; i++) {
			var arrowImg = document.getElementById(this.preFix + i);
			if (null == arrowImg) {
				alert("SwapTab.showTab: Image " + this.preFix + i + " not found.");
				return;
			}
			if (i == idx) {
				arrowImg.src = this.openImgs[i];
			} else {
				arrowImg.src = this.closeImgs[i];
			}
		}
	}
}

var slide;
var swapTab;

function onPageLoad() {
	slide = new SlideTab("root", 32, 5);
//	slide.addTab("zwxx");
//	slide.addTab("bsdt");
//	slide.addTab("zmhd");
	
	slide.addTab("tech_dfish");
	slide.addTab("tech_oa");
	slide.addTab("tech_cms");
	slide.init();
	
	swapTab = new SwapTab("Arrow");
	swapTab.addTab("images/tab_open_03.gif", "images/tab_close_03.gif");
	swapTab.addTab("images/tab_open_04.gif", "images/tab_close_04.gif");
	swapTab.addTab("images/tab_open_05.gif", "images/tab_close_05.gif");
	swapTab.showTab(0);
}

function onShowTab(tabName) {
	var idx = slide.show("slide", tabName);
	swapTab.showTab(idx);			
}


/***************/
function DoListMenu(emid)
{
 var menuid="";
 var menu1="";
 var menuid = request("menu");
 var mlid = "";
 //alert(menuid);
 var mobj = document.getElementById(menuid);
 var eobj = document.getElementById(emid);
 var obj = document.getElementById("info_nav").getElementsByTagName("li");
	 for (var i=1; i<obj.length+1; i++) {
		 imid = document.getElementById("info_menu"+i);
		 mlid = document.getElementById("menu_list"+i);
		 if(menuid&&imid&&mlid){
			 if(mobj==imid||eobj==imid){
 				 //alert(mlid);
				 imid.className ="title"?"selected":"selected";
				 mlid.className ="collapsed"?"optiton":"optiton";
			 }else{
				 imid.className ="title";
				 mlid.className ="collapsed";
			 }
		 }else if(menuid&&imid&&!mlid){
			 if(mobj==imid||eobj==imid){
 				 //alert(mlid);
				 imid.className ="title"?"selected":"selected";
			 }else{
				 imid.className ="title";
			 }
		 }
	 }
}


function resizeImages(wrap, width) { 
	var objs = new Image();
	var objs = document.getElementById(wrap).getElementsByTagName('img'); 
		if(objs){
		for (var i = 0; i < objs.length; i++) { 
			if (objs[i].width > width) { 
				objs[i].style.width = width + 'px';
				objs[i].title = "点击查看放大图片";  
				objs[i].style.cursor= "pointer"; 
				objs[i].onclick = function() { window.open(this.src);}    
				objs[i].style.height = (objs[i].height * width / objs[i].width) + 'px';
			}
		} 
	}
}
