var NowImg = 1;
var bStart = 0;
var bStop =0;
var MaxImg = pics.length;

function fnToggle() 
{
	var next = NowImg + 1;

	if(next == MaxImg+1) 
	{
		NowImg = MaxImg;
		next = 1;
	}
	if(bStop!=1)
	{

		if(bStart == 0)
		{
			bStart = 1;		
			setTimeout('fnToggle()', 4000);
			return;
		}
		else
		{
			oTransContainer.filters[0].Apply();

			document.images['oDIV'+next].style.display = "block";
			document.images['oDIV'+NowImg].style.display = "none";

			oTransContainer.filters[0].Play(duration=2);
			if(texts[next-1]){document.getElementById('oTransContent').innerHTML="<a href='" + links[next-1] + "'><p style='margin-top:12px;' align=center><b style='color:#bf0000;'>" + texts[next-1] + "</b></p><p style='margin-top:12px;line-height:18px;' align=left>" + contents[next-1] + "</p><p style='margin-top:12px;' align=right>ÏêÏ¸ÄÚÈÝ>></p><a>";}

			if(NowImg == MaxImg) 
				NowImg = 1;
			else
				NowImg++;
		}
		setTimeout('fnToggle()', 4000);
	}
}


function toggleTo(img)
{	bStop=0;NowImg=img;
	hideAllImg();
	if(document.images['oDIV' + img]){
		document.images['oDIV' + img].style.display = "block";
		if(texts[img-1]){document.getElementById('oTransContent').innerHTML="<a href='" + links[img-1] + "'><p style='margin-top:12px;' align=center><b style='color:#bf0000;'>" + texts[img-1] + "</b></p><p style='margin-top:12px;line-height:18px;' align=left>" + contents[img-1] + "</p><p style='margin-top:12px;' align=right>Ô”¼šƒÈÈÝ>></p><a>";}
	}
}
function hideAllImg(){
for(var i=1;i<=MaxImg;i++){
	document.images['oDIV'+i].style.display = "none";}
	}
function wdiv(){
document.write("<DIV id=oTransContainer style=\"FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 310px; HEIGHT: 225px;float:left;\"><div align=\"center\" style=\"height:204px;\">");
document.write("<A href=\"" + links[0] + "\" target=_blank><IMG id=\"oDIV1\" class=\"picframe\" style=\"DISPLAY: block;\" src=\"" + pics[0] + "\" /></A>");
if(MaxImg>1){
	for(i=2;i<=MaxImg;i++){
		document.write("<A href=\"" + links[i-1] + "\" target=_blank><IMG id=\"oDIV" + i + "\" class=\"picframe\" style=\"DISPLAY: none;\" src=\"" + pics[i-1] + "\" /></A>");
	}
}
document.write("</div><div align=\"right\" style=\"height:21px;\">");
for(i=1;i<=MaxImg;i++){
	document.write("<A href=\"javascript:toggleTo(" + i + ")\"><IMG height=21 src=\"../kimages/s_" + i + ".gif\" width=24 border=0></A>");
}
document.write("</div></DIV>");
document.write("<DIV id=oTransContent style=\"WIDTH: 260px; padding-right:10px;HEIGHT: 225px;float:right;\"></DIV>");
toggleTo(1);fnToggle();}