var slideShow2=function(){
	var bxs2,bxe2,fxs2,fxe2,ys2,ye2,ta2,ia2,ie2,st2,ss2,ft2,fs2,xp2,yp2,ci,t2,tar2,tarl2;
	ta2=document.getElementById(thumbid2); ia2=document.getElementById(imgid2);
	t2=ta2.getElementsByTagName('li'); ie2=document.all?true:false;
	st2=3; ss2=3; ft2=10; fs2=5; xp2,yp2=0;
	return{
		init2:function(){
			document.body.onmousemove=slideShow2.pos2;
			window.onresize=function(){setTimeout("slideShow2.lim2()",500)};
			ys2=this.toppos2(ta2); ye2=ys2+ta2.offsetHeight;
			len=t2.length;tar2=[];
			for(i=0;i<len;i++){
				var id=t2[i].value; tar2[i]=id; t2[i].onclick=new Function("slideShow2.getimg2('"+id+"')");
				if(i==0){this.getimg2(id)}
			}
			tarl2=tar2.length;
		},
		scrl2:function(d){
			clearInterval(ta2.timer);
			var l=(d==-1)?0:(t2[tarl2-1].offsetLeft-(ta2.parentNode.offsetWidth-t2[tarl2-1].offsetWidth)+10)
			ta2.timer=setInterval(function(){slideShow2.mv2(d,l)},st2);
		},
		mv2:function(d,l){
			ta2.style.left=ta2.style.left||'0px';
			var left=ta2.style.left.replace('px','');
			if(d==1){
				if(l-Math.abs(left)<=ss2){
					this.cncl2(ta2.id); ta2.style.left='-'+l+'px';
				}else{ta2.style.left=left-ss2+'px'}
			}else{
				if(Math.abs(left)-l<=ss2){
					this.cncl2(ta2.id); ta2.style.left=l+'px';
				}else{ta2.style.left=parseInt(left)+ss2+'px'}
			}
		},
		cncl2:function(){clearTimeout(ta2.timer)},
		getimg2:function(id){
			if(auto2){clearTimeout(ia2.timer)}
			if(ci!=null){
				var ts,tsl,x;
				ts=ia2.getElementsByTagName('img'); tsl=ts.length;x=0;
				for(x;x<tsl;x++){
					if(ci.id!=id){var o=ts[x]; clearInterval(o.timer); o.timer=setInterval(function(){slideShow2.fdout2(o)},fs2)}
				}
			}
			if(!document.getElementById(id)){
				var i=document.createElement('img');
				ia2.appendChild(i);
				i.id=id; i.av=0; i.style.opacity=0;
				i.style.filter='alpha(opacity=0)';
				i.src=imgdir+'/'+id+imgext;
			}else{
				i=document.getElementById(id); clearInterval(i.timer);
			}
			i.timer=setInterval(function(){slideShow2.fdin2(i)},fs2);
		},
		nav2:function(d){
			var c=0;
			for(key in tar2){if(tar2[key]==ci.id){c=key}}
			if(tar2[parseInt(c)+d]){
				this.getimg2(tar2[parseInt(c)+d]);
			}else{
				if(d==1){
					this.getimg2(tar2[0]);
				}else{this.getimg2(tar2[tarl2-1])}
			}
		},
		auto2:function(){ia2.timer=setInterval(function(){slideShow2.nav2(1)},autodelay2*1000)},
		fdin2:function(i){
			if(i.complete){i.av=i.av+fs2; i.style.opacity=i.av/100; i.style.filter='alpha(opacity='+i.av+')'}
			if(i.av>=100){if(auto2){this.auto2()}; clearInterval(i.timer); ci=i}
		},
		fdout2:function(i){
			i.av=i.av-fs2; i.style.opacity=i.av/100;
			i.style.filter='alpha(opacity='+i.av+')';
			if(i.av<=0){clearInterval(i.timer); if(i.parentNode){i.parentNode.removeChild(i)}}
		},
		lim2:function(){
			var taw,taa,len; taw=ta2.parentNode.offsetWidth; taa=taw/4; 
			bxs2=slideShow2.leftpos2(ta2); bxe2=bxs2+taa; fxe2=bxs2+taw; fxs2=fxe2-taa;
		},
		pos2:function(e2){
			xp2=ie2?event.clientX+document.documentElement.scrollLeft:e2.pageX; 
			yp2=ie2?event.clientY+document.documentElement.scrollTop:e2.pageY;
			if(xp2>bxs2&&xp2<bxe2&&yp2>ys2&&yp2<ye2){
				slideShow2.scrl2(-1);
			}else if(xp2>fxs2&&xp2<fxe2&&yp2>ys2&&yp2<ye2){
				slideShow2.scrl2(1);
			}else{slideShow2.cncl2()}
		},
		leftpos2:function(t2){
			var l=0;
			if(t2.offsetParent){
				while(1){l+=t2.offsetLeft; if(!t2.offsetParent){break}; t2=t2.offsetParent}
			}else if(t2.x){l+=t2.x}
			return l;
		},
		toppos2:function(t2){
			var p=0;
			if(t2.offsetParent){
				while(1){p+=t2.offsetTop; if(!t2.offsetParent){break}; t2=t2.offsetParent}
			}else if(t2.y){p+=t2.y}
			return p;
		}
	};
}();

window.onload=function(){slideShow.init(); slideShow.lim(); slideShow2.init2(); slideShow2.lim2();};