﻿var imgNum=0;
var countUrl=0;
for(v=0;v<imgUrl.length;v++)
{
  if(imgUrl[v]!=''){countUrl++;}else{break;}
}
if(countUrl==0){
  imgUrl[1]='../../images/alz_zanwu.jpg';
  imgLink[1]="#";
  imgAlt[1]="";
  imgtext[1]="";
}
var count=countUrl-1;


function $(id)
{
	return document.getElementById(id);
}

function goUrl()
{
	if(imgLink[imgNum]!="#"){window.open(imgLink[imgNum],'_blank');}
}

function changeimg(n)
{
	imgNum=n;
	window.clearInterval(theTimer);
	imgNum=imgNum-1;
	nextAd();
}
var key=0;
function nextAd(){
	if(imgNum<count){imgNum++;}	else{imgNum=1;}	
	
	if(imgLink[imgNum]=="#")
	{
		$("Rollimg").style.cursor="";
		$("Textstr").style.cursor="";
	}
	else
	{
		$("Rollimg").style.cursor="pointer";
		$("Textstr").style.cursor="pointer";
	}
	
	if(key==0)
	{
		key=1;
	}
	else if(document.all)
	{
		$("Rollimg").filters.revealTrans.Transition=23;
		$("Rollimg").filters.revealTrans.apply();
        $("Rollimg").filters.revealTrans.play();
    }
	$("Rollimg").src=imgUrl[imgNum];
	$("Textstr").title=imgAlt[imgNum];
	$("Textstr").innerHTML=imgtext[imgNum];
	if($("link"+imgNum))$("link"+imgNum).className="buttonOn";
	for (var i=1;i<=count;i++)
	{
	   if(i!=imgNum){$("link"+i).className="button";}
	}
	theTimer=setTimeout("nextAd()",TimeOut);
}

document.write('<div id="Roll">');
document.write('<img id="Rollimg" src="" onclick="goUrl()" />');
document.write('<div id="buttons">');
for(var i=1;i<countUrl;i++){document.write('<a id="link'+i+'" onmousemove="changeimg('+i+')" class="button">'+i+'</a>');}
document.write('</div>');
document.write('<div id="Textstr" onclick="goUrl()"></div>');
document.write('</div>');
nextAd();




function picviewrrr(thiss,url)
{
	var sTop=parent.scrollTop();
	var sheight=parent.scrollHeight();
	var cheight=parent.clientHeight();	
	var obj=getFid("viewpic");
	obj.style.display = "inline";
	obj.src=webpath+"images/loading2.gif";
	var imagev=new Image();
	imagev.onload=function(){setimg(obj,400,400,url);}
	imagev.src=url;
	var thetop=parseInt(event.y+sTop+130);
	obj.style.left = event.x+250+"px";
	obj.style.top = thetop+"px";
	thiss.onmouseout=function(){obj.style.display = "none";}
}
