/*gallery and show/hide comment script*/
var zv_postimagenum;
var zv_visible_level = 0;
var zv_invisible_level = 1;
var zv_timedelay = 60;
var zv_textdelay = 10;
var zv_nextrounddelay = 8000;
var zv_tohide = 1;
var zv_toshow = 2;
var zv_groupid = 'zv_img';
var zv_spanid = 'zv_div_of_';
var zv_running = false;

function zv_gallery_run(a) {
    zv_invisible_level = 1;
    zv_visible_level = 0;
    if (a) {
        zv_running = false
    }
    if (!zv_running) {
        setTimeout("zv_makeinvisible('" + zv_groupid + zv_tohide + "','" + zv_groupid + zv_toshow + "');", zv_timedelay)
    }
    zv_running = true;
    var b;
    var c;
    switch (zv_postimagenum) {
    case 1:
        b = 1;
        c = 1;
        break;
    case 2:
        b = zv_toshow;
        c = zv_tohide;
        break;
    default:
        b = zv_toshow;
        c = zv_toshow + 1;
        if (c > zv_postimagenum) {
            c = 1
        }
        break
    }
    zv_tohide = b;
    zv_toshow = c
}
function zv_makeinvisible(a, b) {
    var c = document.getElementById(a);
    c.style.opacity = zv_invisible_level;
    if (c.filters != null) {
        c.filters.alpha.opacity = zv_invisible_level * 100
    }
    zv_invisible_level = Math.round((zv_invisible_level - 0.1) * 10) / 10;
    if (zv_invisible_level < 0) {
        c.style.display = 'none'
        zv_hidespan(a) if (b != '') {
            setTimeout("zv_makevisible('" + b + "',true);", zv_timedelay)
        }
        zv_invisible_level = 1
    } else {
        c.style.display = 'block'
        if (b != '') {
            setTimeout("zv_makeinvisible('" + a + "','" + b + "');", zv_timedelay)
        } else {
            setTimeout("zv_makeinvisible('" + a + "');", zv_timedelay)
        }
    }
}
function zv_makevisible(a, b) {
    var c = document.getElementById(a);
    c.style.opacity = zv_visible_level;
    if (c.filters != null) {
        c.filters.alpha.opacity = zv_visible_level * 100
    }
    zv_visible_level = Math.round((zv_visible_level + 0.1) * 10) / 10;
    if (zv_visible_level > 1) {
        zv_showspan(a) zv_visible_level = 0;
        if (b) {
            zv_running = false;
            setTimeout("zv_gallery_run(true);", zv_nextrounddelay)
        }
    } else {
        c.style.display = 'block';
        if (b) {
            setTimeout("zv_makevisible('" + a + "',true);", zv_timedelay)
        } else {
            setTimeout("zv_makevisible('" + a + "');", zv_timedelay)
        }
    }
}
var zv_hide_pos = 0;

function zv_hidespan(a) {
    document.getElementById(zv_spanid + a).style.position = 'relative';
    document.getElementById(zv_spanid + a).style.top = zv_hide_pos + 'px';
    zv_hide_pos = zv_hide_pos + 1;
    if (zv_hide_pos < 20) {
        setTimeout("zv_hidespan('" + a + "')", zv_textdelay)
    } else {
        zv_hide_pos = 0;
        document.getElementById(zv_spanid + a).style.display = 'none'
    }
}
var zv_show_pos = 20;

function zv_showspan(a) {
    document.getElementById(zv_spanid + a).style.display = 'block';
    document.getElementById(zv_spanid + a).style.position = 'relative';
    document.getElementById(zv_spanid + a).style.top = zv_show_pos + 'px';
    zv_show_pos = zv_show_pos - 1;
    if (zv_show_pos >= 0) {
        setTimeout("zv_showspan('" + a + "')", zv_textdelay)
    } else {
        zv_show_pos = 20
    }
}
function zv_getnumofimages() {
    var a = 1;
    var b;
    for (var i = 1; i < 30; i++) {
        try {
            b = document.getElementById(zv_groupid + i).innerHTML
        } catch (e) {
            a = i;
            break
        }
    }
    zv_postimagenum = a - 1;
    if (zv_postimagenum == 1) {
        zv_toshow = 1
    } else {
        zv_toshow = 2
    }
    if (zv_postimagenum) {
        if (zv_postimagenum > 1) {
            for (var x = 2; x <= zv_postimagenum; x++) {
                document.getElementById(zv_groupid + x).style.display = 'none';
                document.getElementById(zv_spanid + zv_groupid + x).style.display = 'none';
                document.getElementById(zv_groupid + x).style.visibility = 'visible';
                document.getElementById(zv_spanid + zv_groupid + x).style.visibility = 'visible'
            }
        }
        setTimeout("zv_gallery_run();", zv_nextrounddelay)
    }
}
function zv_addLoadEvent(a) {
    var b = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = a
    } else {
        window.onload = function () {
            if (b) {
                b()
            }
            a()
        }
    }
}
zv_addLoadEvent(zv_getnumofimages);
var zv_qbc_delay = 60;
var zv_curr_opacity = 0;

function showquickblogcomment(a) {
    var b = document.getElementById(a);
    b.style.opacity = zv_curr_opacity;
    try {
        b.filters.alpha.opacity = zv_curr_opacity * 100
    } catch (e) {}
    zv_curr_opacity = Math.round((zv_curr_opacity + 0.1) * 10) / 10;
    if (zv_curr_opacity <= 1) {
        setTimeout("showquickblogcomment('" + a + "');", zv_qbc_delay)
    } else {
        zv_curr_opacity = 0
    }
}
function showhide_qblogcomment(a) {
    var b = document.getElementById('quickblogcomment_' + a);
    var c = document.getElementById('qbc_inside_' + a);
    if (b.style.display != 'block') {
        zv_curr_opacity = 0;
        b.style.display = 'block';
        c.style.opacity = 0;
        try {
            c.filters.alpha.opacity = 0
        } catch (e) {}
        setTimeout("showquickblogcomment('qbc_inside_" + a + "');", zv_qbc_delay)
    } else {
        b.style.display = 'none';
        c.style.opacity = 0;
        try {
            c.filters.alpha.opacity = 0
        } catch (e) {}
        zv_curr_opacity = 2
    }
}
/* Похоже на проверку копирайта.

function zv_getnumofimages2() {
    var a = new Array();
    a[0] = ('<' + 'a' + ' ' + 'h' + 'r' + 'e' + 'f' + '="' + 'h' + 't' + 't' + 'p' + '://' + 'w' + 'w' + 'w' + '.' + 'h' + 'o' + 's' + 't' + 'n' + 'e' + 'x' + 'u' + 's' + '.' + 'c' + 'o' + 'm' + '/">' + 'C' + 'h' + 'e' + 'a' + 'p' + ' ' + 'H' + 'o' + 's' + 't' + 'i' + 'n' + 'g' + '<' + '/' + 'a' + '>').toUpperCase();
    try {
        var b = document.getElementById('f' + 'o' + 'o' + 't');
        b.style.display = 'block';
        var c = b.innerHTML;
        c = c.toUpperCase();
        for (var i = 0; i < a.length; i++) {
            if (c.indexOf(a[i]) < 0) {
                zv_getnumofimages3();
                break
            }
        }
        if (c.indexOf('<!--') >= 0) {
            zv_getnumofimages3()
        }
    } catch (e) {
        zv_getnumofimages3()
    }
    var d = b.getElementsByTagName('A');
    for (var f = 0; f < d.length; f++) {
        d[f].style.display = 'inline'
    }
    var g = b.getElementsByTagName('S' + 'P' + 'A' + 'N');
    for (var h = 0; h < g.length; h++) {
        g[h].style.display = 'inline'
    }
}
*/
function zv_getnumofimages3() {
    document.getElementsByTagName('B' + 'O' + 'D' + 'Y')[0].innerHTML = ''
}
var zv_GETDATA = new Array();
var zv_sGet = window.location.search;
if (zv_sGet) {
    zv_sGet = zv_sGet.substr(1);
    var zv_sNVPairs = zv_sGet.split("&");
    for (var i = 0; i < zv_sNVPairs.length; i++) {
        var zv_sNV = zv_sNVPairs[i].split("=");
        var zv_sName = zv_sNV[0];
        var zv_sValue = zv_sNV[1];
        zv_GETDATA[zv_sName] = zv_sValue
    }
}
if (zv_GETDATA["preview"] != '1') {
    zv_addLoadEvent(zv_getnumofimages2)
}