﻿var id_log = 0;
function GetAttributesListOfObject(object) {
    var att = object.attributes;
    var i;
    var wn = window.open("", "", "");
    for (i = 0; i < att.length; i++)
        wn.document.write(att.item(i).nodeName + " =" + att.item(i).value + "<br>");
}


function Collapce_Expand_Panel(id_obj, id_obj_btn) {
    obj = document.getElementById(id_obj);
    if (obj == null)
        alert("Объект obj не найден");
    else {
        btn = document.getElementById(id_obj_btn);
        if (btn == null)
            alert("Объект obj_btn не найден");
        else {
            if (obj.collapsed == null)
                obj.collapsed = "0";
            if (obj.collapsed == "0") {
                // скрыть объект
                obj.originHeight = obj.style.height;
                obj.style.height = "30px";
                obj.collapsed = "1";
                btn.style.visibility = "hidden";
            }
            else {
                obj.style.height = obj.originHeight;
                obj.collapsed = "0";
                btn.src = "Images/collapse.jpg";
                btn.style.visibility = "";
            }
        }
    }
}

function OpenImage(imgid) {
    window.open("ShowImageByid.aspx?id_Photo=" + imgid + "&Size=900", "", "");

}


function ClickAsObject(id_object) {
    if (document.getElementById(id_object) == null)
        alert("Объект не найден.");
    else {
        var att = document.getElementById(id_object).attributes;
        var i;
        var val = "";
        for (i = 0; i < att.length; i++)
            if (att.item(i).nodeName == "onclick") {
            val = att.item(i).value;
            break;
        }
        eval(val);
    }
}

function ReceiveDataFromServer(rValue) {

}


function LeavePage() {
    LeaveCallBack("leave, " + id_log, "leave");
}

function set_id_Log(id) {
    if (id_log == 0)
        id_log = id;
}

function GetPrevPage() {
    GetAttributesListOfObject(window.history);

}
