﻿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],target);}
}

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" onclick="goUrl()" />');
document.write('<div id="buttons">');
for(var i=1;i<countUrl;i++){document.write('<a id="link'+i+'" onclick="changeimg('+i+')" class="button">'+i+'</a>');}
document.write('</div>');
document.write('<div id="Textstr" onclick="goUrl()"></div>');
document.write('</div>');
nextAd();
noright2(window.document);
function noright2(obj)
{
	obj.oncontextmenu = function(){return false;}
	obj.ondragstart = function(){return false;}
	obj.onselectstart = function(){return false;}
	obj.onselect = function(){document.selection.empty();}
	obj.oncopy = function(){document.selection.empty();}
	obj.onbeforecopy = function(){return false;}
}

