function setActiveStyleSheet(title) {
    var i, a, main;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true;
            if (a.getAttribute("title") == title) a.disabled = false;
        }
    }
}
function getActiveStyleSheet() {
    var i, a;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
    }
    return null;
}
function getPreferredStyleSheet() {
    var i, a;
    for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
        if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")
) return a.getAttribute("title");
    }
    return null;
}
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 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;
}
window.onload = function (e) {
    var cookie = readCookie("style");
    var title = cookie ? cookie : getPreferredStyleSheet();
    setActiveStyleSheet(title);
}
window.onunload = function (e) {
    var title = getActiveStyleSheet();
    createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function kapatac(layerID) {
    var Divtagi = document.getElementById(layerID)
    if (Divtagi.style.visibility == "visible")
        Divtagi.style.visibility = "hidden"
    else
        Divtagi.style.visibility = "visible"
}

function bilgial(git, yer) {
    document.getElementById(yer).innerHTML = ""//<img src='Resimler/loading.gif' align='absmiddle' border='0'/>
    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, yer)
    }
    page_request.open('GET', git, true)
    page_request.send(null)
}
function loadpage(page_request, yer) {
    if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1))
        document.getElementById(yer).innerHTML = page_request.responseText
}

function ccp(aa, bb, cc)
{
    field = document.getElementById(cc);
    if (document.selection)
    {
        field.focus();
        sel = document.selection.createRange();
        sel.text = aa + document.selection.createRange().text + bb;
    }
    else
    {
        if (field.selectionStart || field.selectionStart == "0")
        {
            field.focus();
            var B = field.selectionStart;
            var A = field.selectionEnd;
            field.value = field.value.substring(0, B) + aa + field.value.substring(A, B) + bb + field.value.substring(A, field.value.length);
        }
        else
        {
            field.focus();
            field.value = " " + aa + "" + bb + " ";
        }
    }
}

function yukari(yer, sitil, sure) {
    this.yer = yer
    this.b1 = sitil
    this.sure = sure
    this.a9 = 0
    this.a3 = 1
    document.write('<div id="' + sitil + '" style="position: relative; overflow: hidden"><div style="position: absolute; width: 100%" id="' + sitil + '1">' + yer[0] + '</div><div style="position: absolute; width: 100%; visibility: hidden" id="' + sitil + '2">' + yer[1] + '</div></div>')
    var a1 = this
    if (window.addEventListener)
        window.addEventListener("load", function () { a1.a2() }, false)
    else if (window.attachEvent)
        window.attachEvent("onload", function () { a1.a2() })
    else if (document.getElementById)
        setTimeout(function () { a1.a2() }, 10)
}
yukari.prototype.a2 = function () {
    this.a4 = document.getElementById(this.b1)
    this.a5 = document.getElementById(this.b1 + "1")
    this.a7 = document.getElementById(this.b1 + "2")
    this.a6 = parseInt(yukari.a8(this.a4))
    this.a5.style.width = this.a7.style.width = this.a4.offsetWidth - (this.a6 * 2) + "px"
    this.getinline(this.a5, this.a7)
    this.a7.style.visibility = "visible"
    var a1 = this
    document.getElementById(this.b1).onmouseover = function () { a1.a9 = 1 }
    document.getElementById(this.b1).onmouseout = function () { a1.a9 = 0 }
    if (window.attachEvent)
        window.attachEvent("onunload", function () { a1.a4.onmouseover = a1.a4.onmouseout = null })
    setTimeout(function () { a1.animateup() }, this.sure)
}
yukari.prototype.animateup = function () {
    var a1 = this
    if (parseInt(this.a7.style.top) > (this.a6 + 5)) {
        this.a5.style.top = parseInt(this.a5.style.top) - 5 + "px"
        this.a7.style.top = parseInt(this.a7.style.top) - 5 + "px"
        setTimeout(function () { a1.animateup() }, 10)
    }
    else {
        this.getinline(this.a7, this.a5)
        this.swapdivs()
        setTimeout(function () { a1.setmessage() }, this.sure)
    }
}
yukari.prototype.swapdivs = function () {
    var tempcontainer = this.a5
    this.a5 = this.a7
    this.a7 = tempcontainer
}
yukari.prototype.getinline = function (div1, div2) {
    div1.style.top = this.a6 + "px"
    div2.style.top = Math.max(div1.parentNode.offsetHeight, div1.offsetHeight) + "px"
}
yukari.prototype.setmessage = function () {
    var a1 = this
    if (this.a9 == 1)
        setTimeout(function () { a1.setmessage() }, 10)
    else {
        var i = this.a3
        var ceiling = this.yer.length
        this.a3 = (i + 1 > ceiling - 1) ? 0 : i + 1
        this.a7.innerHTML = this.yer[this.a3]
        this.animateup()
    }
}
yukari.a8 = function (tickerobj) {
    if (tickerobj.currentStyle)
        return tickerobj.currentStyle["paddingTop"]
    else if (window.getComputedStyle)
        return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
    else
        return 0
}
