//jquery flash swf object
(function(A){A.flashPlayerVersion=function(){var D,B=null,I=false,H="ShockwaveFlash.ShockwaveFlash";if(!(D=navigator.plugins["Shockwave Flash"])){try{B=new ActiveXObject(H+".7")}catch(G){try{B=new ActiveXObject(H+".6");D=[6,0,21];B.AllowScriptAccess="always"}catch(F){if(D&&D[0]===6){I=true}}if(!I){try{B=new ActiveXObject(H)}catch(E){D="X 0,0,0"}}}if(!I&&B){try{D=B.GetVariable("$version")}catch(C){}}}else{D=D.description}D=D.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|,)(\d+)/);return[D[1]*1,D[3]*1,D[5]*1]}();A.flashExpressInstaller="expressInstall.swf";A.hasFlashPlayer=(A.flashPlayerVersion[0]!==0);A.hasFlashPlayerVersion=function(C){var B=A.flashPlayerVersion;C=(/string|integer/.test(typeof C))?C.toString().split("."):C;return(C)?(B[0]>=(C.major||C[0]||B[0])&&B[1]>=(C.minor||C[1]||B[1])&&B[2]>=(C.release||C[2]||B[2])):(B[0]!==0)};A.flash=function(M){if(!A.hasFlashPlayer){return false}var C=M.swf||"",K=M.params||{},E=document.createElement("body"),B,L,H,D,J,I,G,F;M.height=M.height||180;M.width=M.width||320;if(M.hasVersion&&!A.hasFlashPlayerVersion(M.hasVersion)){A.extend(M,{id:"SWFObjectExprInst",height:Math.max(M.height,137),width:Math.max(M.width,214)});C=M.expressInstaller||A.flashExpressInstaller;K={flashvars:{MMredirectURL:window.location.href,MMplayerType:(A.browser.msie&&A.browser.win)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}if(M.flashvars&&typeof K==="object"){A.extend(K,{flashvars:M.flashvars})}for(J in (I=["swf","expressInstall","hasVersion","params","flashvars"])){delete M[I[J]]}B=[];for(J in M){if(typeof M[J]==="object"){L=[];for(I in M[J]){L.push(I.replace(/([A-Z])/,"-$1").toLowerCase()+":"+M[J][I]+";")}M[J]=L.join("")}B.push(J+'="'+M[J]+'"')}M=B.join(" ");if(typeof K==="object"){B=[];for(J in K){if(typeof K[J]==="object"){L=[];for(I in K[J]){if(typeof K[J][I]==="object"){H=[];for(G in K[J][I]){if(typeof K[J][I][G]==="object"){D=[];for(F in K[J][I][G]){D.push(F.replace(/([A-Z])/,"-$1").toLowerCase()+":"+K[J][I][G][F]+";")}K[J][I][G]=D.join("")}H.push(G+"{"+K[J][I][G]+"}")}K[J][I]=H.join("")}L.push(window.escape(I)+"="+window.escape(K[J][I]))}K[J]=L.join("&amp;")}B.push('<PARAM NAME="'+J+'" VALUE="'+K[J]+'">')}K=B.join("")}if(!(/style=/.test(M))){M+=' style="vertical-align:text-top;"'}if(!(/style=(.*?)vertical-align/.test(M))){M=M.replace(/style="/,'style="vertical-align:text-top;')}if(A.browser.msie){M+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';K='<PARAM NAME="movie" VALUE="'+C+'">'+K}else{M+=' type="application/x-shockwave-flash" data="'+C+'"'}E.innerHTML="<OBJECT "+M+">"+K+"</OBJECT>";return A(E.firstChild)};A.fn.flash=function(C){if(!A.hasFlashPlayer){return this}var B=0,D;while((D=this.eq(B++))[0]){D.html(A.flash(A.extend({},C)));if(D[0].firstChild.getAttribute("id")==="SWFObjectExprInst"){B=this.length}}return this}}(jQuery));

var eski=0;
var HaberBaslik = new Array();
var HaberLink = new Array();
var HaberKategori = new Array();
var HaberSaat = new Array();
var theCharacterTimeout = 50;
var theStoryTimeout = 3000;
var theWidgetOne = "_";
var theWidgetTwo = "";
var theWidgetNone = "";
var theLeadString = "";
var theItemCount = 20; 
//--
var haberleryaz = '<table border="0" cellSpacing="2" align="left" cellpading="2"><tr><td vAlign="top"><div id="mansetyeri0"  ><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri1"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri2"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri3"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri4"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri5"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri6"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri7"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri8"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div><div id="mansetyeri9"  style="display:none"><a target="_blank" href=""><img class="rsm" border="0" src="" width="440" height="230" /></a></div></td></tr><tr><td style="HEIGHT: 1px"></td></tr><tr><td vAlign="top"><table border="0" cellSpacing="0" width="440" align="left" height="27" cellpading="0"><tr><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt0" class="mansetdiv" onmouseover="durgoster(0)" width="30" align="middle"><a id="pattlink0" class="patlangac" href="">1</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt1" class="mansetdiv" onmouseover="durgoster(1)" width="30" align="middle"><a id="pattlink1" class="patlangac" href="">2</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt2" class="mansetdiv" onmouseover="durgoster(2)" width="30" align="middle"><a id="pattlink2" class="patlangac" href="">3</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt3" class="mansetdiv" onmouseover="durgoster(3)" width="30" align="middle"><a id="pattlink3" class="patlangac" href="">4</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt4" class="mansetdiv" onmouseover="durgoster(4)" width="30" align="middle"><a id="pattlink4" class="patlangac" href="">5</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt5" class="mansetdiv" onmouseover="durgoster(5)" width="30" align="middle"><a id="pattlink5" class="patlangac" href="">6</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt6" class="mansetdiv" onmouseover="durgoster(6)" width="30" align="middle"><a id="pattlink6" class="patlangac" href="">7</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt7" class="mansetdiv" onmouseover="durgoster(7)" width="30" align="middle"><a id="pattlink7" class="patlangac" href="">8</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt8" class="mansetdiv" onmouseover="durgoster(8)" width="30" align="middle"><a id="pattlink8" class="patlangac" href="">9</a></td><td style="BORDER-LEFT: #cdcdcd 1px solid" id="patt9" class="mansetdiv" onmouseover="durgoster(9)" width="30" align="middle"><a id="pattlink9" class="patlangac" href="">10</a></td><td style="WIDTH: 110px" class="mansetdiv" align="left"><a class="patlangac2" href="http://www.haberturk.com/tummansetler.aspx?p=3">Tüm Manşetler</a></td></tr></table></td></tr></table>';

//--

function startTicker()
{
    theCurrentStory= -1;
    theCurrentLength = 0;
    if (document.getElementById) 
    {    
         theAnchorObject = document.getElementById("tickerAnchor");
         runTheTicker();    
    }
    else 
    {
        document.getElementById("sondakikahaber").innerHTML ="<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;
    }
}
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 arama(){ 
    if(2 == $('input[name=bul]:checked').val()) 
    {                                                                                   
        location.href="http://www.google.com.tr/search?hl=tr&q=site%3Ahaberturk.com+"+$("#arama_kutusu").val()+"&meta=&filter=0";    
    }
    else if(3 == $('input[name=bul]:checked').val()) 
    {
        location.href="http://www.google.com.tr/search?hl=tr&q="+$("#arama_kutusu").val()+"&meta=&filter=0";    
    }
    else
    {
        location.href="http://www.google.com.tr/search?hl=tr&q=site%3Ae-haberturk.com+"+$("#arama_kutusu").val()+"&meta=&filter=0";    
    }
    return false;
}


//tarih
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
function tarih()
{
var months = new makeArray('Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık');
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
$("#tarih").text(day + " " + months[month] + " " + year);
}
