﻿// JavaScript Document
var imnnum=1;
var t;
function changeimg(imgurl,id)
{
	document.getElementById("index1").src=imgurl
	document.getElementById("imglink").href="newsnr.aspx?id="+id+"&a=s";
}
function changeIdv(divid)
{
	for(var a=1;a<=4;a++)
	{
		 document.getElementById("divthis"+a).style.background='#000000';
	}
	document.getElementById(divid).style.background='#b93613';
}

function changeIdvtext(divid)
{
	for(var a=1;a<=4;a++)
	{
		 document.getElementById("indexdiv"+a).style.display='none';
	}
	document.getElementById(divid).style.display=""
}

function clickdivid(imgurl,showdiv,showindex,id)
{
	clearTimeout(t)
	changeimg(imgurl,id);
	
	//alert(showindex);
	changeIdv(showdiv);
	changeIdvtext(showindex);
	imnnum=1;
	t=setTimeout("chag()",3000);
}



function chag()
{

	if (imnnum<=4)
	{
	  var imgurlthis=document.getElementById("img"+imnnum).src;
	  changeIdv("divthis"+imnnum)
	 changeimg(imgurlthis);
	  changeIdvtext("indexdiv"+imnnum)
	 
	}
	else
	{
		imnnum=0;
	}
	
	imnnum++;
	t=setTimeout("chag()",3000);
	
}
 chag();