

slidePlayer.prototype.container=null;
slidePlayer.prototype.imageList=null;
slidePlayer.prototype.textList=null;
slidePlayer.prototype.width=0;
slidePlayer.prototype.height=0;
slidePlayer.prototype.currentNum=1;
slidePlayer.prototype.playTimer=null;
slidePlayer.prototype.loopTimer;
slidePlayer.prototype.intervalTime=50;
slidePlayer.prototype.waiting=2000;
slidePlayer.prototype.isPause=false;
slidePlayer.prototype.isPlaying=false;
slidePlayer.prototype.endPlay=new Function;
slidePlayer.prototype.initial=new Function;
slidePlayer.prototype.getCurrnetNum=function(){return this.currentNum;};
slidePlayer.prototype.goToPlay=function(n)
{
	var o=this;
	if(o.playTimer||o.playTimer!=null){window.clearInterval(o.playTimer);}
	if(o.loopTimer){window.clearTimeout(o.loopTimer);}
	var d;
	for(var i=0;i<o.imageList.length;i++)
	{
		o.imageList[i].style.display="none";
		o.textList[i].style.display="none";
		
		if(o.imageList[i].parentNode&&o.imageList[i].parentNode.tagName.toLowerCase()=='a')
		{
			d=o.imageList[i].parentNode;
		}
		else
		{
			d=o.imageList[i];
		}
		d.style.zIndex="1";
		d.style.filter="alpha(opacity=100)";
		d.style.MozOpacity=1;
		d.style.opacity=1;
	}
	o.isPlaying=false;
	o.imageList[o.currentNum-1].style.display="block";
	o.textList[o.currentNum-1].style.display="block";
	o.play(n);
};
slidePlayer.prototype.play=function(num)
{
	var o=this;
	if(o.isPlaying){return;}
	if(num){var nn=num;var on=o.currentNum;}
	else{var nn=o.currentNum+1;var on=o.currentNum;}
	if(nn>o.imageList.length){nn=1;}
	if(on==nn){o.loopTimer=window.setTimeout(function(){o.play();},o.waiting);return;}
	if(o.playTimer||o.playTimer!=null){window.clearInterval(o.playTimer);}
	if(o.loopTimer){window.clearTimeout(o.loopTimer);}
	var n_el=(o.imageList[nn-1].parentNode&&o.imageList[nn-1].parentNode.tagName.toLowerCase()=='a')?o.imageList[nn-1].parentNode:o.imageList[nn-1];
	var o_el=(o.imageList[on-1].parentNode&&o.imageList[on-1].parentNode.tagName.toLowerCase()=='a')?o.imageList[on-1].parentNode:o.imageList[on-1];
	n_el.style.zIndex=1;
	o_el.style.zIndex=10;
	o_el.style.filter="alpha(opacity=100)";
	o_el.style.MozOpacity=1;
	o_el.style.opacity=1;
	n_el.style.filter="alpha(opacity=100)";
	n_el.style.MozOpacity=1;
	n_el.style.opacity=1;
	o.imageList[nn-1].style.display="block";
			o.textList[on-1].style.display="none";
	o.textList[nn-1].style.display="block";
	o.isPlaying=true;
	var n=100;
	var _is_start=false;
	var anim=function()
	{
		if(o.isPause)
		{
		o_el.style.filter="alpha(opacity=100)";
		o_el.style.MozOpacity=1;
		o_el.style.opacity=1;
		return;
		}
		n-=20;
		_is_start=true;
		if(n<=0)
		{
			o_el.style.filter="alpha(opacity=0)";
			o_el.style.MozOpacity=0;
			o_el.style.opacity=0;
			o_el.style.zIndex=1;
			o.imageList[on-1].style.display="none";
			o.textList[on-1].style.display="none";
			o.isPlaying=false;
			o.currentNum=nn;
			o.loopTimer=window.setTimeout(function(){o.play();},o.waiting);
			window.clearInterval(o.playTimer);
			o.endPlay();
		}
		else
		{
			o_el.style.filter="alpha(opacity="+n+")";
			o_el.style.MozOpacity=n/100;
			o_el.style.opacity=n/100;
		}
	}
	o.playTimer=window.setInterval(anim,o.intervalTime);
};
function slidePlayer(con_id)
{
	var o=this;
	var cont=ycn.Common.getEl(con_id);
	if(!cont){return;}
	var imgs=cont.getElementsByTagName("img");
	if(!imgs||imgs.length<=0){o=null;return;}
	o.container=cont;
	o.imageList=imgs;
	var txts=new Array;
	for(i=0;i<imgs.length;i++)
	{
	    txts[i]=document.getElementById('txt'+imgs[i].id.substring(4,imgs[i].id.length));
	txts[0].style.display="none";
	}
	o.textList=txts;
	var img=new Image();
	img.src=imgs[0].src;
	//o.width=img.width;
	//o.height=img.height;
	//o.container.style.width=o.width+"px";
	//o.container.style.height=o.height+"px";
	imgs[0].style.display="block";
	txts[0].style.display="block";
	o.loopTimer=window.setTimeout(function(){o.play();},o.waiting);
	o.initial();
}