// JavaScript Document


/* 

	haber blogundaki linkleri sekillendirir

*/


var c = 0;
var c2 = 0;
var t;

function changethis(e)
{
	
	var hotblock = document.getElementById("hotlink");
	var newblock = document.getElementById("news" + e);
	var hotphoto = document.getElementById("hotphoto");
	
	if(e >= 0)
	{
		if (t) {
			window.clearTimeout(t);
		}
		hotblock.href = newblock.getAttribute("href");
		hotblock.innerHTML = "<span>" + newblock.getAttribute("subject") + "</span>" + newblock.getAttribute("text")
		hotphoto.style.backgroundImage = "url(" + newblock.getAttribute("photo") + ")"

	}
}

function changethis2(e)
{
	
	var hotblock = document.getElementById("hotlink2");
	var newblock = document.getElementById("news2_" + e);
	var hotphoto = document.getElementById("hotphoto2");
	
	if(e >= 0)
	{
		if (t) {
			window.clearTimeout(t);
		}
		hotblock.href = newblock.getAttribute("href");
		hotblock.innerHTML = "<span>" + newblock.getAttribute("subject") + "</span>" + newblock.getAttribute("text")
		hotphoto.style.backgroundImage = "url(" + newblock.getAttribute("photo") + ")"

	}
}

function changeAutoThis(e)
{
	
	var hotblock = document.getElementById("hotlink");
	var newblock = document.getElementById("news" + e);
	var hotphoto = document.getElementById("hotphoto");
	
	if(e >= 0)
	{
		hotblock.href = newblock.getAttribute("href");
		hotblock.innerHTML = "<span>" + newblock.getAttribute("subject") + "</span>" + newblock.getAttribute("text")
		hotphoto.style.backgroundImage = "url(" + newblock.getAttribute("photo") + ")"

	}
}

function changeAutoThis2(e)
{
	
	var hotblock = document.getElementById("hotlink2");
	var newblock = document.getElementById("news2_" + e);
	var hotphoto = document.getElementById("hotphoto2");
	
	if(e >= 0)
	{
		hotblock.href = newblock.getAttribute("href");
		hotblock.innerHTML = "<span>" + newblock.getAttribute("subject") + "</span>" + newblock.getAttribute("text")
		hotphoto.style.backgroundImage = "url(" + newblock.getAttribute("photo") + ")"

	}
}



function newIndexChange(){
	
	var index2 =  document.getElementById("indexCount").value;
	
	if (c == 5){
		c = 0;
	}
	
	if (c2 == index2){
		c2 = 0;
	}
		
	changeAutoThis(c2);
	changeAutoThis2(c);
	c=c+1;
	c2=c2+1;
	t=setTimeout("newIndexChange()",3000);

}

/*
	---------------------------------------------------------
*/


