var newsShowN=5; //the number of the news and newspic shown on the home page, and it cannot be more than the total number of the items!

var bannerAD=new Array(); 
//var bannerADlink=new Array(); 
var adNum=0;
var picTN=picurl.length-1;
for (i=0;i<newsShowN;i++){
bannerAD[i]=picurl[picTN-i];
}
preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}

function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
var times=0;
function nextAd(){
	if (times>0){
if(adNum<bannerAD.length-1){adNum++ ;}
else {adNum=0;}
//alert (adNum);
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
DrawImage(bannerADrotator, 288, 214);
	}else{
		//alert (adNum);
		setTransition();
		document.images.bannerADrotator.src=bannerAD[adNum];
		playTransition();
		theTimer=setTimeout("nextAd()", 5000);
		DrawImage(bannerADrotator, 288, 214);
		times ++;
		}
}

////////////////////////////////////////
var NtextN1=1;
function addNtext1(){
	AutoCheckTimer = setInterval("Nmaketips1()",5000);}
function Nmaketips1(){
	if(NtextN1<5){NtextN1++ ;}
else {NtextN1=1;}
if (NtextN1==1){
	document.getElementById('imgID1').innerHTML='<span class="imgIDNr">1</span>';
	}else{
	document.getElementById('imgID1').innerHTML='<span class="imgIDN">1</span>';
	}
}

var NtextN2=1;
function addNtext2(){
	AutoCheckTimer = setInterval("Nmaketips2()",5000);}
function Nmaketips2(){
	if(NtextN2<5){NtextN2++ ;}
else {NtextN2=1;}
if (NtextN2==2){
	document.getElementById('imgID2').innerHTML='<span class="imgIDNr">2</span>';
	}else{
	document.getElementById('imgID2').innerHTML='<span class="imgIDN">2</span>';
	}
}

var NtextN3=1;
function addNtext3(){
	AutoCheckTimer = setInterval("Nmaketips3()",5000);}
function Nmaketips3(){
	if(NtextN3<5){NtextN3++ ;}
else {NtextN3=1;}
if (NtextN3==3){
	document.getElementById('imgID3').innerHTML='<span class="imgIDNr">3</span>';
	}else{
	document.getElementById('imgID3').innerHTML='<span class="imgIDN">3</span>';
	}
}

var NtextN4=1;
function addNtext4(){
	AutoCheckTimer = setInterval("Nmaketips4()",5000);}
function Nmaketips4(){
	if(NtextN4<5){NtextN4++ ;}
else {NtextN4=1;}
if (NtextN4==4){
	document.getElementById('imgID4').innerHTML='<span class="imgIDNr">4</span>';
	}else{
	document.getElementById('imgID4').innerHTML='<span class="imgIDN">4</span>';
	}
}

var NtextN5=1;
function addNtext5(){
	AutoCheckTimer = setInterval("Nmaketips5()",5000);}
function Nmaketips5(){
	if(NtextN5<5){NtextN5++ ;}
else {NtextN5=1;}
if (NtextN5==5){
	document.getElementById('imgID5').innerHTML='<span class="imgIDNr">5</span>';
	}else{
	document.getElementById('imgID5').innerHTML='<span class="imgIDN">5</span>';
	}
}
