var stid = 1;
var id;
var kapid;
var araid;
var npid = 0;
var inter="'";
var refmenuw = "refmenuw";
var kfa01=0,kfa02=0,kfa03=0,kfa04=0,kfa05=0,kfa06=0,kfa07=0,kfa08=0,kfa09=0,kfa10=0,kfa11=0;
var txtFieldsFocused = false;
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
var rqforum = false;        
document.onkeyup = noego;

function noego(e) {
    try {
        if (document.getElementById("ctl00_txtSifre").value.length > 0) {
            var KeyID = (window.event) ? event.keyCode : e.keyCode;
            if (KeyID == 13) {
                if (!rqforum)
                    loginf2();
                else
                    loginfrm2();
            }
        }
    } catch (e) { }
}

function noe() {
    return !(window.event && window.event.keyCode == 13);
}

function getElementsByClassName(node, classname) {
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for (var i = 0, j = els.length; i < j; i++)
        if (re.test(els[i].className)) a.push(els[i]);
    return a;
}

function shelp(gl_h_box){try{document.getElementById("help"+gl_h_box).style.display="inline";}catch(e){}}
function hhelp(gl_h_box){try{document.getElementById("help"+gl_h_box).style.display="none";}catch(e){}}

function expandLogin() {
    onlogin();
    try { hideTheme = window.setTimeout("document.getElementById(\"themeBox\").style.display = \"none\";", 100); } catch (ex) { }
    document.getElementById("loginboxx").style.display = "block";
    try { document.getElementById("ctl00_txtCariKod").focus(); } catch (e) { }
}

function kaaplogin() {if (!txtFieldsFocused) { try { kapid = window.setTimeout("kapalogin();", 1000); } catch (ex) { } } }
function onlogin() {try{window.clearTimeout(kapid);}catch(ex){}}	
function kapalogin() {try{document.getElementById("loginboxx").style.display="none";}catch(ex){}}

function funcAjax() {
    var xmlHttpReq = false;
    if (window.XMLHttpRequest) {
        xmlHttpReq = new XMLHttpRequest();
        if (xmlHttpReq.overrideMimeType) {
            xmlHttpReq.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) {
        try { xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
            try { xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { }
        }
    }
    return xmlHttpReq;
}

function initAjax() {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'default.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) return;
    }
    xmlHttpReq.send('');
}

function popUpClose(popUpId) {
    var xmlHttpReq = funcAjax();

    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'default.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            document.getElementById("pd" + popUpId).style.display = "none";
            document.getElementById("pdc" + popUpId).style.display = "none";
            document.getElementById("phid" + popUpId).style.display = "none";
            document.getElementById("phdiv").style.display = "none";
            document.getElementById("grayout").style.display = "none";
        }
    }
    xmlHttpReq.send('pUp=close');
}

function setnotis(gl_item) {
    var xmlHttpReq = funcAjax();

    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'profile.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState < 4) {
            document.getElementById("notis" + gl_item).className = 'roller';
            document.getElementById("notis" + gl_item).style.margin = '1px';
        }
        if (xmlHttpReq.readyState == 4) {
            document.getElementById("notis" + gl_item).className = xmlHttpReq.responseText;
            document.getElementById("notis" + gl_item).style.margin = '0px';
        }
    }
    xmlHttpReq.send('ntf=' + gl_item);
}

function dvc(vc) {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'video.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                setTimeout(xmlHttpReq.responseText, 5);
            } else dvc(vc);
        }
    }
    xmlHttpReq.send('vcd=' + vc); 
}

function vcgo(vid) {
    var xmlHttpReq = funcAjax();
    document.getElementById("vcbtn").disabled = true;
    document.getElementById("vctext").disabled = true;
    document.getElementById("ruiv").disabled = true;
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'video.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState < 4) {
            document.getElementById("capcimg").innerHTML = '<img src="images/alg.gif">';
        }
        if (xmlHttpReq.readyState == 4) {
            if (xmlHttpReq.responseText == "2") {
                document.getElementById("vcbtn").disabled = false;
                document.getElementById("vctext").disabled = false;
                document.getElementById("capcimg").innerHTML = '<img src="/jpegimage.aspx" alt="" title="">';
                document.getElementById("ruiv").style.backgroundColor = '#FFCCCC';
                document.getElementById("ruiv").value = '';
                document.getElementById("ruiv").disabled = false;
                document.getElementById("ruiv").focus();
            }
            if (xmlHttpReq.responseText == "0" || xmlHttpReq.responseText == "1")
                document.location.href = document.location.href;
        }
    }
    xmlHttpReq.send('vcid=' + vid + '&vc=' + encodeURI(document.getElementById("vctext").value) + '&ruiv=' + document.getElementById("ruiv").value);    
}

function filliframe(name, icontent) {
    var iframe = document.getElementById(name)
    if (iframe) {
        var iframeDoc;
        if (iframe.contentDocument) {
            iframeDoc = iframe.contentDocument;
        }
        else if (iframe.contentWindow) {
            iframeDoc = iframe.contentWindow.document;
        }
        else if (window.frames[iframe.name]) {
            iframeDoc = window.frames[iframe.name].document;
        }
        if (iframeDoc) {
            iframeDoc.open();
            iframeDoc.write("<html><head><link href=\"css/style.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body style=\"background-image:url(images/trans.gif);padding:10px 0px 10px 30px;\">" + icontent.replace(/&&&&/g, "'") + "</body></html>");
            iframeDoc.close();
        }
    }
}


function logout()
{
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', window.location.protocol + "//" + window.location.host + '/iforum/log_off_user.asp', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() { }
    xmlHttpReq.send('');
    top.window.location = window.location.protocol + "//" + window.location.host + "/logout.aspx";
}

function logoutfrm() {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', window.location.protocol + "//" + window.location.host + '/logout.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() { }
    xmlHttpReq.send('');
    top.window.location = 'log_off_user.asp';
}

var currentSlot = 0;
var cInterval;
var mon;
function p(glcid) {
    clearInterval(cInterval);
    if (mon) {
        mon = false;
        if (currentSlot != glcid + 1) {
            getcycflash(glcid);
        }
    }
}

function r() {
    mon = true;
    runcycflash();
}

function runcycflash() {
    cInterval = setInterval('getcycflash(currentSlot)', 12000);
}
function getcycflash(slot) {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'cycflash.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            currentSlot = xmlHttpReq.responseText.substring(xmlHttpReq.responseText.length - 1) - 1;
            document.getElementById("cycflash").innerHTML = xmlHttpReq.responseText.substring(0, xmlHttpReq.responseText.length - 1);
        }
    }
    xmlHttpReq.send('slot=' + (slot + 1));
}

var availpart = 1;
var edc = 1;
function fillDayView(gl_event_id, teh, teh2, mLeft, dwidth) {
    var xmlHttpReq = funcAjax();

    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'agenda.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            document.getElementById('tin' + teh).innerHTML = "<div class='refmenuo' style='cursor:auto; position:absolute; margin-top:-1px; margin-left:" + mLeft + "px; height:42px; width:" + dwidth + "px;' id='tinner" + teh + "'>" + xmlHttpReq.responseText + "</div>";
            document.getElementById("tinner" + teh).style.height = (findPosY(document.getElementById("t" + teh2)) - findPosY(document.getElementById("t" + teh)) - 14);
        }
    }

    xmlHttpReq.send('eid=' + gl_event_id + '&th=' + (findPosY(document.getElementById("t" + teh2)) - findPosY(document.getElementById("t" + teh)) - 8) + '&dw=' + dwidth + '&edc=' + edc);
    edc++;
}

function pr(srvmesg) {
    if (srvmesg.length != 0) {
        document.getElementById("loginIcon").innerHTML = '<img id="imgusermenuicon" class="usermenuicon" src="images/l_next.png" alt="" />';
        document.getElementById("ctl00_txtSifre").value = '';
        alert(srvmesg);
        document.location.href = document.location.href;
    } else document.location.href = document.location.href;
}

function loginf2() {
    if (document.getElementById("ctl00_txtCariKod").value.length > 0 && document.getElementById("ctl00_txtSifre").value.length > 0) {
        var liteie7fixe = "";
        var liteie7fixe2 = "";
        if (_curTheme == 'lite') {
            if (navigator.appName.substring(0, 9) == "Microsoft") {
                if (version < 8) { liteie7fixe = ' style="margin-top:-8px;"'; liteie7fixe2 = ' style="margin-top:19px;margin-left:-21px;"'; }
            }
        }

        var prw8r = false;
        var srvmesg= "";

        var xmlHttpReqf = funcAjax();
        xmlHttpReqf.open('POST', 'iforum/login_user.asp', true);
        xmlHttpReqf.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlHttpReqf.send("name=" + document.getElementById("ctl00_txtCariKod").value.replace(" ", "+") + "&password=" + document.getElementById("ctl00_txtSifre").value.replace(" ", "+") + "&NS=1&returnURL=default.asp");
        
        var xmlHttpReq = funcAjax();
        xmlHttpReq.open('POST', 'default.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState < 4) {
                document.getElementById("loginIcon").innerHTML = '<img class="usermenuicon" src="images/l_work.png" alt=""' + liteie7fixe + ' /><div class="l_work"' + liteie7fixe2 + '></div>';
            }
            if (xmlHttpReq.readyState == 4) {
                srvmesg = xmlHttpReq.responseText;
                pr(srvmesg);
            }
        }
        xmlHttpReq.send("ctl00$txtCariKod=" + document.getElementById("ctl00_txtCariKod").value + "&ctl00$txtSifre=" + document.getElementById("ctl00_txtSifre").value + "&ctl00$chkBeniHatirla=" + document.getElementById("ctl00_chkBeniHatirla").value);
        
    }
}

function loginfrm2() {
    if (document.getElementById("ctl00_txtCariKod").value.length > 0 && document.getElementById("ctl00_txtSifre").value.length > 0) {
        var liteie7fixe = "";
        var liteie7fixe2 = "";
        if (_curTheme == 'lite') {
            if (navigator.appName.substring(0, 9) == "Microsoft") {
                if (version < 8) { liteie7fixe = ' style="margin-top:-8px;"'; liteie7fixe2 = ' style="margin-top:19px;margin-left:-21px;"'; }
            }
        }

        var prw8r = false;
        var srvmesg = "";
       
        var xmlHttpReq = funcAjax();
        xmlHttpReq.open('POST', '../default.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState < 4) {
                document.getElementById("loginIcon").innerHTML = '<img class="usermenuicon" src="../images/l_work.png" alt=""' + liteie7fixe + ' /><div class="l_work"' + liteie7fixe2 + '></div>';
            }
            if (xmlHttpReq.readyState == 4) {
                srvmesg = xmlHttpReq.responseText;
                if (prw8r) pr(srvmesg);
                prw8r = true;
            }
        }
        xmlHttpReq.send("ctl00$txtCariKod=" + document.getElementById("ctl00_txtCariKod").value + "&ctl00$txtSifre=" + document.getElementById("ctl00_txtSifre").value + "&ctl00$chkBeniHatirla=" + document.getElementById("ctl00_chkBeniHatirla").value);


        var xmlHttpReqf = funcAjax();
        xmlHttpReqf.open('POST', 'login_user.asp', true);
        xmlHttpReqf.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlHttpReqf.onreadystatechange = function() {
            if (xmlHttpReqf.readyState == 4) {
                if (prw8r) pr(srvmesg);
                prw8r = true;
            }
        }
        xmlHttpReqf.send("name=" + document.getElementById("ctl00_txtCariKod").value.replace(" ", "+") + "&password=" + document.getElementById("ctl00_txtSifre").value.replace(" ", "+") + "&NS=1&returnURL=default.asp");
    }
}

function gosc(gl_kw) {
    if (window.event && window.event.keyCode == 13) {
        top.window.location = "search.aspx?kw=" + gl_kw;
    }
}

function goscfrm(gl_kw) {
    if (window.event && window.event.keyCode == 13) {
        top.window.location = "../search.aspx?kw=" + gl_kw;
    }
}

function chstab(gl_tid)
{
  top.window.location = "search.aspx?kw=" + document.getElementById("bartxt_kw").value + "&t"+gl_tid+"p=0";
}

function put_bri(gl_objBottom, gl_objTop) {
    var o = findPosY(gl_objBottom) - findPosY(gl_objTop) - 8;
    if (navigator.appName.substring(0, 9) == "Microsoft")
            if (version < 8) {o=o+8;}
document.getElementById("bri").style.height = o + "px";                
}

function put_main(gl_objEOL) {
    var om = findPosY(gl_objEOL);
    document.getElementById("ptmain").style.height = (om - 280) + "px";
}

function setside() {
    if (_curTheme != 'lite') {
        if (navigator.appName.substring(0, 9) == "Microsoft") {
            if (version < 8) {
                try {
                    document.getElementById('ssL').style.marginTop = "193px";
                    document.getElementById('ssR').style.marginTop = "193px";
                } catch (e) { }
            } else {
                try {
                    document.getElementById('ssL').style.marginTop = "191px";
                    document.getElementById('ssR').style.marginTop = "191px";
                } catch (e) { }
            }
        } else {
            if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
                try {
                    document.getElementById('ssL').style.marginTop = "192px";
                    document.getElementById('ssR').style.marginTop = "192px";
                    document.getElementById('mainC').style.marginLeft = "1px";
                    document.getElementById('mainC').style.width = "809px";
                } catch (e) { }
            } else {
                try {
                    document.getElementById('ssL').style.marginTop = "191px";
                    document.getElementById('ssR').style.marginTop = "191px";
                } catch (e) { }
            }
        }
        try {
            document.getElementById('ssL').style.height = (findPosY(document.getElementById('sbb')) - findPosY(document.getElementById('stb'))) - 72 + 'px';
            document.getElementById('ssR').style.height = (findPosY(document.getElementById('sbb')) - findPosY(document.getElementById('stb'))) - 72 + 'px';
            document.getElementById('loginboxx').style.Left = findPosX(document.getElementById('stb'));
        } catch (e) { } 
    }
}

function resize_search_polder() {
    var s_End_Y = findPosY(document.getElementById("search_end_posx"));
    s_End_Y = s_End_Y - 266;
    if (s_End_Y < 350) {
        s_End_Y = 350;
        document.getElementById("pholder").style.height = 345;
    } else {
        document.getElementById("pholder").style.height = s_End_Y + 15;
    }
    document.getElementById("pbackx").style.height = s_End_Y + 30;
}

function onm(kimmis)
{
    kimmis.value = parseInt(kimmis.value);

    if (kimmis.value.length >= 3) {
        if (kimmis.value.substring(0, 3) == "NaN")
        { kimmis.value = ""; }
    }
}

function pfspanon(gltxid) {
    var tumpfspans = getElementsByClassName(document, 'pfspan');
    for (var k = 0; k < tumpfspans.length; k++) { tumpfspans[k].style.display = "none"; }
    document.getElementById("popcal_" + gltxid).style.display = "inline";
}

function clearAllAEs() {
    var tumAEs = getElementsByClassName(document, 'AEs');
    for (var k = 0; k < tumAEs.length; k++) { tumAEs[k].innerHTML = ""; }
}

function ckkh(objc) {
    document.cookie = "shonsupr=" + objc.checked + "; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/;"; bayiman(2);
}

function setTheme(gl_theme) {
    if (gl_theme == "lite") {
        document.getElementById('backgroundImage').style.display = "none";
        eraseCookie("dynBG");
        document.getElementById('siteTheme').href = "css/lite.css";
        document.body.style.backgroundImage = '';
    }
    if (gl_theme == "litex") {
        gl_theme = "lite";
        document.cookie = "dynBG=1; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/;";
        document.cookie = "dynBG_sr=" + screen.width + 'x' + screen.height + "; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/;";
        setThemep2(gl_theme);
    } else {
    document.cookie = "dynBG=''; expires=Fri, 31 Dec 1099 23:59:59 GMT; path=/;";
    document.cookie = "dynBG_sr=''; expires=Fri, 31 Dec 1099 23:59:59 GMT; path=/;";
        clearSession(gl_theme);
    }

}

function clearSession(gl_theme)
{
var xmlHttpReq = funcAjax();
        if (!xmlHttpReq) { return false; }
        xmlHttpReq.open('POST', 'default.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState == 4) {
                if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                    setThemep2(gl_theme);
                } else clearSession();
            }
        }
        xmlHttpReq.send('_dynclr=0');
}


function setThemep2(gl_theme) {
    var resneeded=false;
    _curTheme = "" + gl_theme;
    
    document.cookie = "siteTheme=" + _curTheme + "; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/;";
    if ((version < 7 && navigator.appName.substring(0, 9) == "Microsoft") || navigator.appName.substring(0, 5) == "Opera") {
        resneeded = true;
    } else {
    if (gl_theme != "lite") {document.body.style.backgroundImage = ''; document.getElementById('backgroundImage').style.display = "none"; eraseCookie("dynBG"); } else backimage();
    document.getElementById('siteTheme').href = "css/" + _curTheme + ".css";
    try { window.frames['agenda'].document.getElementById('siteTheme').href = "css/" + _curTheme + ".css"; }
        catch (ex) { }
        try { document.getElementById('iHtext').src = document.getElementById('iHtext').src + "&"; }
        catch (ex) { }
    }
    if (resneeded) document.location.href = document.location.href;
}


function resetHeader(gl_text) {
    try { document.getElementById('iHtext').src = "jpegimage.aspx?htext=" + gl_text; }
    catch (ex) { }
}

function initDPage() {
    var dpgap1; dpgap1 = findPosY(document.getElementById("ndLine")) - findPosY(document.getElementById("stLine")) - 44;
    var xTableRowN = document.getElementById('defp_news').rows; try { xTableRowN[0].height = dpgap1; } catch (e) { }
    var xTableRowA = document.getElementById('defp_updates').rows; try { xTableRowA[0].height = dpgap1; } catch (e) { }
}

function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent)
        while (1) {
        curtop += obj.offsetTop;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}

function findPosX(obj) {
    var curleft = 0;
    if (obj.offsetParent)
        while (1) {
        curleft += obj.offsetLeft;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function btnHover(gl_obj) {
    try { gl_obj.style.cursor = "pointer"; } catch (e) { }
    try { gl_obj.rows[0].cells[0].className = gl_obj.rows[0].cells[0].className.substring(0, 5) + "1"; } catch (e) { }
    try { gl_obj.rows[0].cells[1].className = gl_obj.rows[0].cells[1].className.substring(0, 5) + "1"; } catch (e) { }
    try { gl_obj.rows[0].cells[2].className = gl_obj.rows[0].cells[2].className.substring(0, 5) + "1"; } catch (e) { }
    try { gl_obj.rows[0].cells[3].className = gl_obj.rows[0].cells[3].className.substring(0, 5) + "1"; } catch (e) { }
}

function btnClear(gl_obj) {
    try { gl_obj.style.cursor = "normal"; } catch (e) { }
    try { gl_obj.rows[0].cells[0].className = gl_obj.rows[0].cells[0].className.substring(0, 5) + "0"; } catch (e) { }
    try { gl_obj.rows[0].cells[1].className = gl_obj.rows[0].cells[1].className.substring(0, 5) + "0"; } catch (e) { }
    try { gl_obj.rows[0].cells[2].className = gl_obj.rows[0].cells[2].className.substring(0, 5) + "0"; } catch (e) { }
    try { gl_obj.rows[0].cells[3].className = gl_obj.rows[0].cells[3].className.substring(0, 5) + "0"; } catch (e) { }
}

function showThemeBox() {document.getElementById("themeBox").style.display = "block";}
function hideThemeBox() {try{hideTheme = window.setTimeout("document.getElementById(\"themeBox\").style.display = \"none\";",100);}catch(ex){}}
function onThemeBox() {try{window.clearTimeout(hideTheme);}catch(ex){}}

function togglend(gl_node) {
    if (document.getElementById(gl_node).style.display != 'block') {
        document.getElementById(gl_node).style.display = 'block';
        document.getElementById('p' + gl_node).src = 'images/minus.gif';
    } else {
        document.getElementById(gl_node).style.display = 'none';
        document.getElementById('p' + gl_node).src = 'images/plus.gif';
    }
    document.getElementById('ssL').style.height = '10px';
    document.getElementById('ssR').style.height = '10px';
    setside();
}

var stshs = [];
var stshh = [];
var adcs = [];
var adch = [];
function showstartsat(gl_sat) {
    clearTimeout(stshh[parseInt(gl_sat, 10)]);
    var s_bt = document.getElementById('startsat' + gl_sat).style.bottom.substring(0, document.getElementById('startsat' + gl_sat).style.bottom.length - 2);
    if (s_bt < 0) {
        document.getElementById('startsat' + gl_sat).style.bottom = (parseInt(s_bt, 10) + 1);
        stshs[parseInt(gl_sat, 10)] = setTimeout('showstartsat(' + gl_sat + ');', 0);
    } else {
        clearTimeout(stshs[parseInt(gl_sat, 10)]);
    }
}

function hidestartsat(gl_sat, toorg) {
    clearTimeout(stshs[parseInt(gl_sat, 10)]);
    var s_bt = document.getElementById('startsat' + gl_sat).style.bottom.substring(0, document.getElementById('startsat' + gl_sat).style.bottom.length - 2);
    if (s_bt > toorg) {
        document.getElementById('startsat' + gl_sat).style.bottom = (parseInt(s_bt, 10) - 1); 
        stshh[parseInt(gl_sat, 10)] = setTimeout('hidestartsat(' + gl_sat + ',' + toorg + ');', 0);
    }
    else {
        clearTimeout(stshh[parseInt(gl_sat, 10)]);
    }
}

function showec(gl_sat) {
    clearTimeout(adch[parseInt(gl_sat, 10)]);
    var s_bt = document.getElementById('adc' + gl_sat).style.height.substring(0, document.getElementById('adc' + gl_sat).style.height.length - 2);
    if (s_bt < 164) {
        document.getElementById('adc' + gl_sat).style.height = (parseInt(s_bt, 10) + 6);
        document.getElementById('inadc' + gl_sat).style.height = (parseInt(s_bt, 10) + 7);
        adcs[parseInt(gl_sat, 10)] = setTimeout('showec(' + gl_sat + ');', 0);
    } else {
        clearTimeout(adcs[parseInt(gl_sat, 10)]);
    }
}

function hideec(gl_sat, toorg) {
    clearTimeout(adcs[parseInt(gl_sat, 10)]);
    var s_bt = document.getElementById('adc' + gl_sat).style.height.substring(0, document.getElementById('adc' + gl_sat).style.height.length - 2);
    if (s_bt > toorg) {
        document.getElementById('adc' + gl_sat).style.height = (parseInt(s_bt, 10) - 6);
        document.getElementById('inadc' + gl_sat).style.height = (parseInt(s_bt, 10) - 7);
        adch[parseInt(gl_sat, 10)] = setTimeout('hideec(' + gl_sat + ',' + toorg + ');', 0);
    } else { clearTimeout(adch[parseInt(gl_sat, 10)]); }
}

function getvcs(gl_vid, gl_p) {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'video.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                document.getElementById("vidcomments_" + gl_vid).innerHTML = xmlHttpReq.responseText;
            } else getvcs(gl_vid, gl_p);
        }
    }
    xmlHttpReq.send('pid=' + gl_vid + '&p=' + gl_p);
}

function bdgah(gl_eid, gl_uid) {
    var xmlHttpReq = funcAjax();

    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'agenda.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState < 4) {
            document.getElementById("evreg" + gl_eid).innerHTML = '<img class="roller" style="padding:10px;">';
        }
        if (xmlHttpReq.readyState == 4) {
            document.frames['agenda'].__doPostBack('popcal01', gl_uid);
            document.frames['agenda'].edc = 0;
        }
    }
    xmlHttpReq.send('eid=' + gl_eid + '&uid=' + gl_uid);
}

function opacity(id, opacStart, opacEnd, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    var tref = "changeOpac";
    if (navigator.appName.substring(0, 9) != "Microsoft") tref = "changeOpacx";
 
    if (opacStart > opacEnd) {
        for (i = opacStart; i >= opacEnd; i--) {
            setTimeout("" + tref + "(" + i + ",'" + id + "')", (timer * speed));
            timer++;
        }
    } else if (opacStart < opacEnd) {
        for (i = opacStart; i <= opacEnd; i++) {
            setTimeout("" + tref + "(" + i + ",'" + id + "')", (timer * speed));
            timer++;
        }
    }
}

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function changeOpacx(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
}
function currentOpac(id, opacEnd, millisec) {
    var currentOpac = 100;
    if (document.getElementById(id).style.opacity < 100) {
        currentOpac = document.getElementById(id).style.opacity * 100;
    }
    opacity(id, currentOpac, opacEnd, millisec)
}

function backimage() {
    if (_curTheme == 'lite' && readCookie("dynBG") == "1") {
    var xmlHttpReq = funcAjax();
        if (!xmlHttpReq) { return false; }
        xmlHttpReq.open('POST', 'default.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState == 4) {
                if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                    setTimeout(xmlHttpReq.responseText, 5);
                } else backimage();
            }
        }
        xmlHttpReq.send('_dynbg=' + screen.width + 'x' + screen.height);
    }
}

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) {
    document.cookie = name + "=''; expires=Fri, 31 Dec 1099 23:59:59 GMT;";
    document.cookie = name + "=''; expires=Fri, 31 Dec 1099 23:59:59 GMT; path=;";
    document.cookie = name + "=''; expires=Fri, 31 Dec 1099 23:59:59 GMT; path=/;";
}

function nottigo() {
    if (document.getElementById('n_email').value != "" && document.getElementById('n_sifre').value != "" && document.getElementById('n_code').value != "") {
        window.location = "?mail=" + document.getElementById('n_email').value + "&sifre=" + document.getElementById('n_sifre').value + "&code=" + document.getElementById('n_code').value;
    } else {
        alert(document.getElementById('n_text').innerHTML.replace(/(<([^>]+)>)/ig, ""));
    }
}

function demoGo(gl_ctr) {
    var preserveBtnGo = document.getElementById("btnGo").innerHTML;
    if (document.getElementById("ctl00_ContentPlaceHolder1_txtAd").value != "" && document.getElementById("ctl00_ContentPlaceHolder1_txtSoyad").value != "" && document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value != "") {
        document.getElementById("btnGo").innerHTML = "<div class=\"roller\">&nbsp;</div>";
        var demoreqs = ""; for (ixac = 1; ixac < gl_ctr; ixac++) { if (document.getElementById("c_" + ixac).checked == true) demoreqs += document.getElementById("c_" + ixac).value + "<br/>"; }
        window.location = "demo.aspx?dsend=1&txtFirma=" + document.getElementById("ctl00_ContentPlaceHolder1_txtFirma").value + "&txtAd=" + document.getElementById("ctl00_ContentPlaceHolder1_txtAd").value + "&txtSoyad=" + document.getElementById("ctl00_ContentPlaceHolder1_txtSoyad").value + "&txtAdres=" + document.getElementById("ctl00_ContentPlaceHolder1_txtAdres").value + "&txtNot=" + document.getElementById("ctl00_ContentPlaceHolder1_txtNot").value + "&txtSehir=" + document.getElementById("ctl00_ContentPlaceHolder1_txtSehir").value + "&txtTel=" + document.getElementById("ctl00_ContentPlaceHolder1_txtTel").value + "&txtEmail=" + document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value + "&ddl_dil=" + document.getElementById("ctl00_ContentPlaceHolder1_ddl_dil").value + "&ddl_sektor=" + document.getElementById("ctl00_ContentPlaceHolder1_ddl_sektor").value + "&ddl_size=" + document.getElementById("ctl00_ContentPlaceHolder1_ddl_size").value + "&ddl_users=" + document.getElementById("ctl00_ContentPlaceHolder1_ddl_users").value + "&demoreqs=" + demoreqs;
    } else {
        if (document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value == "") document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").focus();
        if (document.getElementById("ctl00_ContentPlaceHolder1_txtSoyad").value == "") document.getElementById("ctl00_ContentPlaceHolder1_txtSoyad").focus();
        if (document.getElementById("ctl00_ContentPlaceHolder1_txtAd").value == "") document.getElementById("ctl00_ContentPlaceHolder1_txtAd").focus();
        document.getElementById("btnGo").innerHTML = preserveBtnGo;
    }
}

function ws_switch(gl_t) {
    document.getElementById("ws_t1").className = "wsheader";
    document.getElementById("ws_t2").className = "wsheader";
    document.getElementById("ws_t3").className = "wsheader";
    document.getElementById("ws_t" + gl_t).className = "wsheaderx";
    document.getElementById("ws_p1").style.display = "none";
    document.getElementById("ws_p2").style.display = "none";
    document.getElementById("ws_p3").style.display = "none";
    document.getElementById("ws_p" + gl_t).style.display = "block";
    document.cookie = "ws_tab=" + gl_t + "; expires=Fri, 31 Dec 2099 23:59:59 GMT; path=/;";
    setside(); setTimeout("setside();", 75); setTimeout("setside();", 150); setTimeout("setside();", 225);
}

function oTabSwitch(gl_class) {
    var gl_state;
    for (var kx = 0; kx < 9; kx++) {
        $('.oTab_' + kx).slideUp();
    }
    $('.' + gl_class).slideDown();
    setside();
}

function get_ddl(gl_type,gl_code) {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'channels.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState < 4) {
            document.getElementById("div_ddl_" + gl_type + "_w").innerHTML = '<img src=\"/images/r18.gif\" style="padding:1px;"/>';
        }
        if (xmlHttpReq.readyState == 4) {
            if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                document.getElementById("div_ddl_" + gl_type + "_w").innerHTML = '';
                document.getElementById("div_ddl_" + gl_type + "").innerHTML = xmlHttpReq.responseText;
                if (gl_type == 'il') {
                    document.getElementById("div_ddl_ilce").innerHTML = '<select style=\"font-size:11px;width:150px;font-family:tahoma;\" disabled></select>';
                    get_ddl('ilce', document.getElementById("_ddl_il").options[document.getElementById("_ddl_il").selectedIndex].value);
                }
                if (gl_type == 'ilce') {
                    get_cl();
                }
            }
            else get_ddl(gl_type, gl_code);
        }
    }
    xmlHttpReq.send('ddl_' + gl_type + '=' + gl_code);
}

function get_cl() {
    if(document.getElementById("_ddl_il").options[document.getElementById("_ddl_il").selectedIndex].value != 0){
        var xmlHttpReq = funcAjax();
        if (!xmlHttpReq) { return false; }
        xmlHttpReq.open('POST', 'channels.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState < 4) {
                document.getElementById("div_chanlist_w").innerHTML = '<img src=\"/images/r18.gif\" style="padding:1px;"/>';
            }
            if (xmlHttpReq.readyState == 4) {
                if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                    document.location.href = window.location.protocol + "//" + window.location.host + "/channels/" + xmlHttpReq.responseText;
                } else get_cl();
            }
        }
        xmlHttpReq.send('cl_1=' + document.getElementById("_ddl_ulke").options[document.getElementById("_ddl_ulke").selectedIndex].value + '&'
        + 'cl_2=' + document.getElementById("_ddl_il").options[document.getElementById("_ddl_il").selectedIndex].value + '&'
        + 'cl_3=' + document.getElementById("_ddl_ilce").options[document.getElementById("_ddl_ilce").selectedIndex].value + '&'
        + 'cl_4=' + document.getElementById("_ddl_cs").options[document.getElementById("_ddl_cs").selectedIndex].value + '&'
        + 'cl_5=' + document.getElementById("_ddl_s").options[document.getElementById("_ddl_s").selectedIndex].value);
    }
}

function sipeftonay(gl_wxid) {
    var xmlHttpReq = funcAjax();
    if (!xmlHttpReq) { return false; }
    xmlHttpReq.open('POST', 'wservice.aspx', true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState < 4) {
            document.getElementById("onaybutton").innerHTML = '<img src=\"/images/r18.gif\" style="padding:10px;"/>';
        }
        if (xmlHttpReq.readyState == 4) {
            if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) alert(xmlHttpReq.responseText); else sipeftonay(gl_wxid);
            top.window.location = "default.aspx";
        }
    }
    xmlHttpReq.send('eft=2&wxid=' + gl_wxid);
}

function mmt(gl_id) {
    if (document.getElementById('i' + gl_id).src.indexOf('plus') == -1) {
        document.getElementById('i' + gl_id).src = "images/plus.gif";
        document.getElementById('p' + gl_id).style.display = "none";
    } else {
        if (document.getElementById('p' + gl_id).innerHTML == "") {
            var xmlHttpReq = funcAjax();
            if (!xmlHttpReq) { return false; }
            xmlHttpReq.open('POST', 'yardim.aspx', true);
            xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() {
                if (xmlHttpReq.readyState == 4) {
                    document.getElementById('i' + gl_id).src = "images/minus.gif";
                    document.getElementById('p' + gl_id).innerHTML = xmlHttpReq.responseText;
                    document.getElementById('p' + gl_id).style.display = "block";
                }
            }
            xmlHttpReq.send('id=' + gl_id);
        } else {
            document.getElementById('i' + gl_id).src = "images/minus.gif";
            document.getElementById('p' + gl_id).style.display = "block";
        }
    }
}

function mmto(gl_link) {
    if (gl_link.toString().length > 0) {
        var xmlHttpReq = funcAjax();
        if (!xmlHttpReq) { return false; }
        xmlHttpReq.open('POST', 'yardim.aspx', true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlHttpReq.onreadystatechange = function() {
            if (xmlHttpReq.readyState < 4) {
                document.getElementById("loadInd").className = "roller";
            }
            if (xmlHttpReq.readyState == 4) {
                if (xmlHttpReq.responseText.indexOf("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") == -1) {
                    if (xmlHttpReq.responseText.indexOf("file:") == 0) {
                        document.getElementById("loadInd").className = "";
                        if (navigator.appName.substring(0, 9) == "Microsoft")
                            top.window.location = xmlHttpReq.responseText.replace("file:", "");
                        else
                            window.open(xmlHttpReq.responseText.replace("file:", ""), "file", "width=100,height=50");
                    } else {
                        document.getElementById("loadInd").className = "";
                        document.getElementById("fraContent").innerHTML = xmlHttpReq.responseText;
                        setside(); setTimeout("setside();", 250); setTimeout("setside();", 1000);
                    }
                }
                else
                    mmto(gl_link);
            }
        }
        xmlHttpReq.send('gl_link=' + gl_link);
    }
}
