function setasHome(){
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage('http://www.girissayfasi.com');
}


function createCookie(name,value,days)
{
        if (days)
        {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++)
        {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
}

function eraseCookie(name)
{
        createCookie(name,"",-1);
}

var x = readCookie('baslik')



        function doPageTitleEvent() {
                var div = document.getElementById("baslik");
                var eskibaslik = (div.value=='') ? 'Giriş Sayfası' : (div.value);
                document.title = eskibaslik;
                div.onmouseover = function() {
                        this.style.backgroundColor = "#F9F6E0";
                        this.style.border = "1px dashed #61581D";
                }
                div.onmouseout = function() {
                        this.style.backgroundColor = "#F9F6E0";
                        this.style.border = "1px solid #61581D";
                }

                div.attachEvent('onkeydown',onEnterDown);
                function onEnterDown() {
                         if (window.event.keyCode==13) {
                            var value = (div.value=='') ? 'Giriş Sayfası' : (div.value);
                            document.title = value;
                            div.value = value;
                            createCookie('baslik',div.value,7)
                        div.onclick = null;
                        div.onmouseout();
                        div.onmouseover = null;
                         }
                }

                div.onblur = function() {
                         var value = (this.value=='') ? 'Giriş Sayfası' : (this.value);
                         document.title = value;
                         div.value = value;
                         doPageTitleEvent();
                         createCookie('baslik',this.value,7)
                }

                div.onclick = function() {
                        this.onclick = null;
                        this.onmouseout();
                        this.onmouseover = null;
                        }
                }


function rss_read(url_id) {
         var xmlhttp=true;
         var async =true;

           try {
           xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
           } catch (e) {
            try {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
             xmlhttp = false;
            }
           }

         if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
           xmlhttp = new XMLHttpRequest();
         }

             var element_id = 'pencere_no_'+url_id+'_lblRss';
             var resim_id = 'pencere_no_'+url_id+'_imgRefresh';
               var fragment_url='rss_read.php?id='+url_id;
               //alert(element_id[i]);
               //element = ;
               //resim = document.getElementById(resim_id);
               //alert(resim_id);
               /* element.innerHTML = 'Yeni Bilgiler Alınıyor ...';    */
               document.getElementById(resim_id).src='resimler/indicator.gif';
               xmlhttp.open("GET", fragment_url, async);
                 xmlhttp.onreadystatechange = function() {
                     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                     document.getElementById(element_id).innerHTML = xmlhttp.responseText;
                     document.getElementById(resim_id).src='resimler/refresh.gif';
                     }
                 }

             xmlhttp.send(null);
}

function menu_kapat() {
var testNode=document.getElementById('aaa')
if(testNode!=null){document.body.removeChild(testNode)}
//document.getElementById('aaa').style.display = "none";
}

function icerikmenu() {
  var element = document.createElement('icerikmenusu')
  var layer = document.createElement('DIV');
  layer.id= 'aaa';
  layer.style.position = 'absolute';
  layer.style.left = '4px';
  layer.style.top = '88px';
  layer.style.width = '200px'; layer.style.height = '400px'
  layer.style.backgroundColor = '#ECECEC';
  layer.style.border = '1px solid black';
  layer.innerHTML = '<table width="200px"><tr><td align="right" valign=middle><font size=1><b><u>İçerik Ekleme Menüsü</u></b></font>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="menu_kapat();"><img src="resimler/kapat.gif" alt="Kapat" border=0 valign=middle></a></td></tr>';
  layer.innerHTML +='</table>';
  document.body.appendChild(layer);
}

doPageTitleEvent();

