var i=0;
var eski=0;
var tmp=0;
function degis()
{
 var dt=new Date()
 var ayy = dt.getMonth();
 ayy=ayy+1;
 if ( ayy < 10 ) ayy = "0"+ayy;
 var tarih = dt.getDate()+"."+ ayy +"."+dt.getFullYear()+" " ;
 if ( dt.getHours() < 10 ) ayy = "0"+dt.getHours();
 else ayy = dt.getHours();
 if ( dt.getMinutes() < 10 ) ayy += ":0"+dt.getMinutes();
 else ayy += ":"+dt.getMinutes();
 document.getElementById('saat').innerHTML=tarih+ayy;
 setTimeout('degis();',6000);
}

function durgoster(jj)
{
 document.getElementById("mansetyeri"+eski).style.display= "none";
 document.getElementById("mansetyeri"+jj).style.display= "";
 document.getElementById("pattlink"+eski+"").style.color="";
 document.getElementById("patt"+eski+"").className="mansetdiv";
 document.getElementById("pattlink"+jj+"").style.color="#ffffff";
 document.getElementById("patt"+jj+"").className="mansetdiv2";
 eski=jj;
}

function ucc(kk)
{
 kk=eski+kk;
 if(kk > 9) kk=0;
 if(kk < 0) kk=9;
 document.getElementById("mansetyeri"+eski).style.display= "none";
 document.getElementById("mansetyeri"+kk).style.display= "";
 document.getElementById("pattlink"+eski+"").style.color="";
 document.getElementById("patt"+eski+"").className="mansetdiv";
 document.getElementById("pattlink"+kk+"").style.color="#d60000";
 document.getElementById("patt"+kk+"").className="mansetdiv2";
 eski=kk;
}

durgoster(0);
degis();
//floatgo=true;

//
var rootdomain="http://"+window.location.hostname;
var bustcacheparameter="";

function Haberturk(url, txt)
{
	var page_request = false;

	if (window.XMLHttpRequest)
	{
		page_request = new XMLHttpRequest();
    }
	else 
	{
	    if (window.ActiveXObject)
	    { 
		    try {
			    page_request = new ActiveXObject("Msxml2.XMLHTTP");
			    } 
		    catch (e)
		    {
			    try
				    {
					    page_request = new ActiveXObject("Microsoft.XMLHTTP");
				    }
			    catch (e){}
		    }
	    }
	    else return false;
	}

	page_request.onreadystatechange=function()
	{ 
		loadpage(page_request, txt);
	}

	bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
	page_request.open('GET', url+bustcacheparameter, true);
	page_request.send(null);

}

function loadpage(page_request, txt)
{
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	{
		document.getElementById(txt).innerHTML=page_request.responseText;
	}
}
//Son dakika yazę js
function startTicker()
{
	theCurrentStory= -1;
	theCurrentLength = 0;
	if (document.getElementById) 
	{	
		 theAnchorObject = document.getElementById("tickerAnchor");
		 runTheTicker();	
    }
	else 
	{
        document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
        return true;
	}
}
function runTheTicker()
{
	var myTimeout;
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory= theCurrentStory % theItemCount;
		theStorySummary= HaberBaslik[theCurrentStory].replace(/&quot;/g,'"');
		theCat= HaberKategori[theCurrentStory].replace(/&quot;/g,'"');
		theTime= HaberSaat[theCurrentStory].replace(/&quot;/g,'"') + "&nbsp;&nbsp;";
		theTargetLink= HaberLink[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	= "<span class=\"tickls\">" + theLeadString + "</span>";
	}
	theAnchorObject.innerHTML = theCat + theTime + theStorySummary.substring(0,theCurrentLength) + whatWidget();

	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	setTimeout("runTheTicker()", myTimeout);
}
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}
var theCharacterTimeout = 50;
var theStoryTimeout = 3000;
var theWidgetOne = "_";
var theWidgetTwo = "";
var theWidgetNone = "";
var theLeadString = "";

var HaberBaslik = new Array();
var HaberLink = new Array();
var HaberKategori = new Array();
var HaberSaat = new Array();
