﻿function AjaxBeginRequest(sender) {
    document.body.style.cursor = "wait";
}

function AjaxPageLoaded(sender) {
    document.body.style.cursor = "default";
}

function gizle(id) {
    document.getElementById(id).style.display = "none";
}

function goster(id) {
    document.getElementById(id).style.display = "";
}

function gizle_goster(id) {
    if (document.getElementById(id).style.display == "none")
        goster(id);
    else
        gizle(id);
}

function class_switch(id, class1, class2) {
    if (document.getElementById(id).className == class1)
        document.getElementById(id).className = class2;
    else
        document.getElementById(id).className = class1;
}

function goster_switch(liste, ind) {
    for (var i = 0; i < liste.length; i++) {
        if (i == ind) {
            document.getElementById(liste[i]).style.display = "";
        } else {
            document.getElementById(liste[i]).style.display = "none";
        }
    }
}

function k_cookieyaz(isim, deger) {
    var ss = "";
    ss = new Date((new Date()).getTime() + 24 * 3600 * 365);
    document.cookie = isim + "=" + escape(deger) + "; expires=" + ss.toGMTString();
}

function k_cookieoku(isim) {
    var deger = "";
    var ara = isim + "=";
    if (document.cookie.length > 0) {
        oindis = document.cookie.indexOf(ara);
        if (oindis != -1) {
            oindis += ara.length;
            son = document.cookie.indexOf(";", oindis);
            if (son == -1) son = document.cookie.length;
            deger = unescape(document.cookie.substring(oindis, son))
        }
    }
    return deger;
}

function tum_checkbox_sec(spanChk) {
    var oItem = spanChk.children;
    var theBox = (spanChk.type == "checkbox") ? spanChk : spanChk.children.item[0];
    xState = theBox.checked;
    elm = theBox.form.elements;

    for (i = 0; i < elm.length; i++)
        if (elm[i].type == "checkbox" &&
            elm[i].id != theBox.id) {
        if (elm[i].checked != xState)
            elm[i].click();
    }
}

function redirect_postback() {
    onay = confirm("Bu işlem sayfayı yenileyecek bu yüzden sayfada yaptığınız bazı işlemler (İlan Arama gibi) kaybolacaktır. Devam etmek istiyor musunuz?");
    if (!onay) {
        return false;
    }
}
 


