﻿var trgfrma = new Array();
var heightarr = new Array();

var mc = 7;
var sc_w = 240;
var sc_h = 164;

var inoout = false;
var spage;
var cvar = 0, say = 0, tpos = 0, enson = 0, hidsay = 0, hidson = 0;
var tmpv;
tmpv = sc_w - 8 - 8 - (2 * 1);
var psy = new Array();
var uzunobj = null, uzunobj2 = null;
var uzuntop = 0;
var toplay = 0;

function mdivmo(gnum, gnum5) {
    inoout = true;
}  

function restime(gnum2, gnum5) {
    inoout = false;
    //if (gnum5 == 1) {
    //    objd = document.getElementById('dz' + gnum2);
    //    objd2 = document.getElementById('hgdz' + gnum2);
    //}
    //else {
    //    objd = document.getElementById('d' + gnum2);
    //    objd2 = document.getElementById('hgd' + gnum2);
    //}
    //objd.style.color = "#DEE2ED";
    //objd2.style.color = "#FFFFFF";
    //objd.style.textDecoration = 'none';
    //objd2.style.textDecoration = 'none';
    //window.status = "";
}

function dotrans() {
    if (inoout == false) {
        uzuntop--;
        if (uzuntop < (-1 * toplay)) {
            uzuntop = 0;
            uzunobj2.style.top = sc_h + "px";
        }
        uzunobj.style.top = uzuntop + "px";
        if ((uzuntop + toplay) < sc_h) {
            uzunobj2.style.top = "" + (uzuntop + toplay) + "px";
        }
    }
    if (psy[(uzuntop * (-1)) + 8] == 3) {
        setTimeout('dotrans()', 2000 + 35);
    }
    else {
        setTimeout('dotrans()', 35);
    }
}

function initte2() {
    i = 0;
    for (i = 0; i < mc; i++) {
        objd = document.getElementById('d' + i);
        heightarr[i] = objd.offsetHeight;
    }
    toplay = 8;
    for (i = 0; i < mc; i++) {
        objd = document.getElementById('d' + i);
        objd2 = document.getElementById('dz' + i);
        objd.style.visibility = "visible";
        objd2.style.visibility = "visible";
        objd.style.top = "" + toplay + "px";
        objd2.style.top = "" + toplay + "px";
        psy[toplay] = 3;
        toplay = toplay + heightarr[i] + 10;
    }
    uzunobj = document.getElementById('enuzun');
    uzunobj.style.left = 8 + "px";
    uzunobj.style.height = toplay + "px";
    uzunobj.style.width = tmpv + "px";
    uzunobj.style.top = sc_h + "px";
    uzunobj2 = document.getElementById('enuzun2');
    uzunobj2.style.left = 8 + "px";
    uzunobj2.style.height = toplay + "px";
    uzunobj2.style.width = tmpv + "px";
    uzunobj2.style.top = sc_h + "px";
    uzuntop = sc_h;
    dotrans();
}

function initte() {
    spage = document.getElementById('spagens');
    if (spage != null) {
        spage.style.left = "0px";
        spage.style.top = "0px";
        setTimeout('initte2()', 500);
    }
}

window.onload = initte;
