var count=0;
for (i=0;i<imgUrl.length;i++) {
	if( (imgUrl[i]!="") && (imgText[i]!="")&& (imgLink[i]!="")&& (imgAlt[i]!="")) {
		count++;
	}else {
		break;
	}
}
document.write("<style> #slideImg { width:"+imgWidth+"px;height:"+imgHeight+"px;</style>");
function change() {
	if (ver==1) {
		with($('slideImg').filters[0]){
			Transition=1;
			apply();
			play();
		}
	}
	if (firstTime){ 
		firstTime=false;
		timeOut=_timeOut_/1000;
	}else{
		$('slideImg').src=imgUrl[now];
		$('slideImg').alt=imgAlt[now];
		$('slideImgLink').href=imgLink[now];
		if (show_text) $('textDiv').innerHTML=imgText[now];
		for (var i=0;i<count;i++) {
			$('b'+i).className="indexbutton";
		} 
		$('b'+now).className="on";
		now=(now>=imgUrl.length-1)?0:now+1;
		timeOut=_timeOut_;
	}
	theTimer=setTimeout("change()", timeOut);
}
function b_change(num) {
	window.clearInterval(theTimer);
	now=num;
	firstTime=false;
	change();
}
function draw_line() {
	var div = document.createElement("div");
	div.id = 'lineDiv';
	$('buttonDiv').insertBefore(div,$('buttonDiv').childNodes.item(0));
}
var a = document.createElement("a");
a.id="slideImgLink";
a.target=target;
a.href=imgLink[now];
$('imgDiv').appendChild(a);
var img = document.createElement("img");
img.id="slideImg";
img.width=imgWidth;img.height=imgHeight;
img.src=imgUrl[now];
img.alt=imgAlt[now];a.appendChild(img);
for (var i=count-1;i>=0;i--) {
	var div_bg = document.createElement("div");
	div_bg.id = 'div_bg'+i;
	div_bg.className='bg';
	$('buttonText').appendChild(div_bg);
	var a = document.createElement("a");
	a.id = 'b'+i;
	a.className = (i==now+1)?"button_on":"button_off";
	a.title=imgAlt[i];a.innerHTML=i+1;
	a.href="javascript:b_change("+i+")";
	$('div_bg'+i).appendChild(a);
	var div= document.createElement("div");
	$('buttonText').appendChild(div);
}
if (show_text) $('textDiv').innerHTML = imgText[now];
$('slideImg').onmouseover=function(){
	window.clearInterval(theTimer);
}
$('slideImg').onmouseout=function() {
	theTimer=setTimeout("change()", timeOut2);
}
try{
	new ActiveXObject("DXImageTransform.Microsoft.Fade");
	$('slideImg').filters[0].play();ver=1;draw_line();
}
catch (e){
	ver=2;
}
var theTimer = setTimeout("change()", _timeOut_/1000);
