﻿function myslide(xctl, i, xtend) {

    var aa = i;
    if (aa > xtend) {
        aa = i - 10;
        document.getElementById(xctl).style.top = aa;
        document.getElementById("mylayerIF").style.top = aa;
        var kk = setTimeout("myslide('" + xctl + "'," + aa + "," + xtend + ")", 10);
    }

}

function myshowpopup(xctl, i, xtend, xwidth, xheight, xtext, xleft) {
    document.getElementById(xctl).style.height = xheight + "px";
    document.getElementById(xctl).style.width = xwidth + "px";
    document.getElementById(xctl).style.top = i + "px";
    document.getElementById(xctl).style.left = xleft + "px";
    document.getElementById(xctl).style.display = "";
    document.getElementById("mylayerIF").style.height = xheight + "px";
    document.getElementById("mylayerIF").style.width = xwidth + "px";
    document.getElementById("mylayerIF").style.top = i + "px";
    document.getElementById("mylayerIF").style.left = xleft + "px";
    document.getElementById("mylayerIF").style.display = "";
    document.getElementById("mydhtmltext").innerHTML = xtext;
    document.getElementById("mydhtmltext").style.height = xheight - 60 + "px";
    document.getElementById("mypopupkapat").style.top = xheight - 30 + "px";
    document.getElementById("mypopupkapat").style.left = xwidth / 2 - 30 + "px";
    myslide(xctl, i, xtend);
}


function mycollaps(xctl, xstep) {
    document.getElementById("mylayerIF").style.display = "none";
    var xw = document.getElementById(xctl).style.width;
    var xwidth = parseInt(xw.replace("px", ""));

    var xh = document.getElementById(xctl).style.height
    var xheigth = parseInt(xh.replace("px", ""));

    if (xwidth > xstep) {
        document.getElementById(xctl).style.width = xwidth - xstep;

    }

    if (xheigth > xstep)
        document.getElementById(xctl).style.height = xheigth - xstep;
    if (xwidth > xstep || xheigth > xstep) {
        var tmp = setTimeout("mycollaps('" + xctl + "'," + xstep + ")", 10);
    }
    else
        document.getElementById(xctl).style.display = "none";

}

function manuallink(myurl, myopt) {
    window.open(myurl, "userwindow", myopt);
    mycollaps("mylayer", 20);
}

function openpopup(myurl, myopt) {
    try {
        var WindowOpen = window.open(myurl, "user_window", myopt);
        var obj = WindowOpen.Name;
    }
    catch (e) {
        var mytext = "<p class=MsoNormal style='margin-left:0;margin-bottom:0cm;'><span lang=TR>www.passagework.com sitesindeki bütün fonksiyonlara eriþmek için bilgisayarýnýzdaki pop-up blocker(açýlýr pencere engelleyici) fonksiyonunu iptal edin veya buraya <a href=# onclick='manuallink(\"" + myurl + "\",\"" + myopt + "\")'>týklayýn.</a></span></p>";
        myshowpopup("mylayer", 450, 200, 200, 200, mytext, 200);
    }
}
