var icerik=new Array();
var ie4 = document.all;
var dom = document.getElementById && navigator.userAgent.indexOf("Opera")== -1;
var curpos=yukseklik*1;
var derece=10;
var curcanvas="canvas0";
var curindex=0;
var nextindex=1;
bekleme = bekleme * 1000;

function moveslide(){
	if (curpos>0){
		curpos=Math.max(curpos-derece,0);
		tempobj.style.top=curpos+"px";
	}else{
		clearInterval(dropslide);
		nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1";
		tempobj=ie4 ? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas);
		tempobj.innerHTML=icerik[curindex];
		nextindex = (nextindex < icerik.length-1) ? nextindex + 1 : 0;
		setTimeout("rotateslide()",bekleme);
	}
}

function rotateslide(){
	if (ie4||dom){
		resetit(curcanvas);
		crossobj = tempobj = ie4 ? eval("document.all."+curcanvas) : document.getElementById(curcanvas);
		crossobj.style.zIndex++;
		var temp = 'setInterval("moveslide()",50)';
		dropslide = eval(temp);
		curcanvas = (curcanvas == "canvas0")? "canvas1" : "canvas0";
	}
	curindex=(curindex<icerik.length-1)? curindex+1 : 0;
}

function resetit(what){
	curpos=parseInt(yukseklik)*(1);
	var crossobj=ie4? eval("document.all."+what) : document.getElementById(what);
	crossobj.style.top=curpos+"px";
}

function startit(){
	icerik[0]=document.getElementById('item1').innerHTML;
	icerik[1]=document.getElementById('item2').innerHTML;
	setTimeout('switchContent()',2000);
	crossobj=ie4 ? eval("document.all."+curcanvas) : dom ? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub;
	if (ie4||dom){
		crossobj.innerHTML=icerik[curindex];
		rotateslide();
	}else{
		document.tickernsmain.visibility='show';
		curindex++;
		setInterval("rotateslide()",bekleme);
	}
}

function switchContent(){
	current = document.getElementById('mainContent');
	dynamic = document.getElementById('dynamicContent');
	current.innerHTML = dynamic.innerHTML;
	dynamic.innerHTML = "";
}
window.onload=startit;