//Javascripts by Ivan "Artifex" Stepanov (artifex@mail.ru)

var header = new Array();
var menu = new Array();
var msg=''
var winex=false
jspeed=100;
joutputsize=90;
jblanksize=30;
jmsg1='Официальный сайт А. Карпова';

    
for(i=1;i<=6;i++)
{
header[i] = 0;
menu[i] = 0;
}

    var flagind1 = 0
            
    items = new Array()
    for(i=1;i<=6;i++)
       {
        items[i] = new Image()
        if(i==1) items[i].src = "img/point1.gif"
        if(i==2) items[i].src = "img/point2.gif"
        if(i==3) items[i].src = "img/point3.gif"
        if(i==4) items[i].src = "img/point4.gif"
        if(i==5) items[i].src = "img/point5.gif"
        if(i==6) items[i].src = "img/point6.gif"
        if(i==7) items[i].src = "img/pix.gif"
       }
    
    items1 = new Array()
    for(i=1;i<=6;i++)
       {
        items1[i] = new Image()
        if(i==1) items1[i].src = "img/point11.gif"
        if(i==2) items1[i].src = "img/point21.gif"
        if(i==3) items1[i].src = "img/point31.gif"
        if(i==4) items1[i].src = "img/point41.gif"
        if(i==5) items1[i].src = "img/point51.gif"
        if(i==6) items1[i].src = "img/point61.gif"
        if(i==7) items1[i].src = "img/arrow.gif"
       }

function Over(ind,flag)
{
        var a   
        a = 'item'+ind
        if (flag == 1) document.images[a].src = items1[ind].src;
        if (flag == 0) document.images[a].src = items[ind].src;
}

function Over2(ind,flag)
{
        var a   
        a = 'sub'+ind
        if (flag == 1) document.images[a].src = items1[ind].src;
        if (flag == 0) document.images[a].src = items[ind].src;
}

function createmenu(cont, id)
{
if(document.layers)
 {
  var str="<LAYER ID=menu" + id + " TOP=166 LEFT=455 onmouseover=\"menu[" + id + "]=1;\" onmouseout=\"Turn('" + id + "',0);menu[" + id + "]=0;\" VISIBILITY=hide>" + cont + "</LAYER>";
  document.write(str);
 }
 else if(document.all)
 {
  var strng="<div id=menu" + id + " style=\"position:absolute;top:166;left:455;visibility:hidden;width:159;\" onmouseover=\"menu[" + id + "]=1;\" onmouseout=\"Turn('" + id + "',0);menu[" + id + "]=0;\">" + cont + "</div>";
  document.write(strng);
 }
}

function Turn(id, mode)
{
if (mode==1)
    {
    for(i=2;i<=4;i++)
    {
     if (document.all && eval("menu"+i).style.visibility=='visible') eval("menu"+i).style.visibility='hidden';
     if (document.layers && eval("document.layers['menu" + id + "']").visibility=='show') eval("document.layers['menu" + id + "']").visibility='hide';
    }
    }
    
 if (document.layers || document.all)
 {
  if (mode) eval("setTimeout(\"flip(" + id + ", " + mode + ");\",50)");
  else eval("setTimeout(\"flip(" + id + ", " + mode + ");\",2000)");
 }
}

function flip(id, mode)
{
if (mode==1)
    {
  if(header[id])
   if(document.all)
    eval("menu" + id).style.visibility = 'visible';
   else if(document.layers)
    eval("document.layers['menu" + id + "']").visibility = "show";
    }
else
    {
  if(!menu[id] && !header[id])
   if(document.all)
    eval("menu" + id).style.visibility = 'hidden';
   else if(document.layers)
    eval("document.layers['menu" + id + "']").visibility = "hide";
    }
}

function menusgo()
{
var txt2
txt2='<table cellspacing="0" cellpadding="0" border="0" background="img/bgclock.gif" width="193"><tr><td>'
txt2+='<table cellspacing="0" cellpadding="5" border="0" background="img/pix.gif" width="243" height="185"><tr><td><img src="img/pix.gif" width="5" height="1" alt="" border="0"></td>'
txt2+='<td valign="top">'
txt2+='<a href="biography.asp"><img src="menu/s2item1.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='<a href="family.asp"><img src="menu/s2item2.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='<a href="politics.asp"><img src="menu/s2item3.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='<a href="hobbies.asp"><img src="menu/s2item4.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='<a href="chess.asp"><img src="menu/s2item5.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='<a href="photoes.asp"><img src="menu/s2item6.gif" width="170" height="18" alt="" border="0"></a><br>'
txt2+='</td></td></tr></table></td></td></tr></table>'

var txt3
txt3='<table cellspacing="0" cellpadding="0" border="0" background="img/bgclock.gif" width="243"><tr><td>'
txt3+='<table cellspacing="0" cellpadding="5" border="0" background="img/pix.gif" width="243" height="185"><tr><td><img src="img/pix.gif" width="7" height="1" alt="" border="0"></td>'
txt3+='<td valign="top">'
txt3+='<a href="history.asp"><img src="menu/s3item1.gif" width="170" height="18" alt="" border="0"></a><br>'
txt3+='<a href="pravila.asp"><img src="menu/s3item2.gif" width="170" height="18" alt="" border="0"></a><br>'
txt3+='<a href="history-champions.asp"><img src="menu/s3item3.gif" width="170" height="18" alt="" border="0"></a><br>'
txt3+='<a href="articles.asp"><img src="menu/s3item4.gif" width="170" height="18" alt="" border="0"></a><br>'
txt3+='<a href="discussion.asp"><img src="menu/s3item5.gif" width="170" height="18" alt="" border="0"></a><br>'
//txt3+='<a href="game.asp"><img src="menu/s3item6.gif" width="170" height="18" alt="" border="0"></a><br>'
//txt3+='<a href="base.asp"><img src="menu/s3item7.gif" width="170" height="18" alt="" border="0"></a><br>'
//txt3+='<a href="links.asp"><img src="menu/s3item8.gif" width="170" height="18" alt="" border="0"></a><br>'
txt3+='</td></td></tr></table></td></td></tr></table>'

var txt4
txt4='<table cellspacing="0" cellpadding="0" border="0" background="img/bgclock.gif" width="243"><tr><td>'
txt4+='<table cellspacing="0" cellpadding="5" border="0" background="img/pix.gif" width="243" height="185"><tr><td><img src="img/pix.gif" width="7" height="1" alt="" border="0"></td>'
txt4+='<td valign="top">'
txt4+='<a href="association.asp"><img src="menu/s4item1.gif" width="170" height="18" alt="" border="0"></a><br>'
txt4+='<a href="fund.asp"><img src="menu/s4item2.gif" width="170" height="18" alt="" border="0"></a><br>'
txt4+='</td></td></tr></table></td></td></tr></table>'

var txt6
txt6='<table cellspacing="0" cellpadding="0" border="0" background="img/bgclock.gif" width="193"><tr><td>'
txt6+='<table cellspacing="0" cellpadding="5" border="0" background="img/pix.gif" width="243" height="185"><tr><td><img src="img/pix.gif" width="5" height="1" alt="" border="0"></td>'
txt6+='<td valign="top">'
txt6+='<a href="katalog.asp"><img src="menu/s6item1.gif" width="170" height="18" alt="" border="0"></a><br>'
txt6+='<a href="netsuke.asp"><img src="menu/s6item2.gif" width="170" height="18" alt="" border="0"></a><br>'
txt6+='<a href="religious.asp"><img src="menu/s6item3.gif" width="170" height="18" alt="" border="0"></a><br>'
txt6+='</td></td></tr></table></td></td></tr></table>'

createmenu(txt2,2)
createmenu(txt3,3)
createmenu(txt4,4)
createmenu(txt6,6)
}

function jscroll()
{
msg=msg.substring(1)+msg.substring(0,1);
window.status=msg;
timer=window.setTimeout('jscroll()',jspeed);
}

function jinit()
{
esp=' ';
blank='';
for (i=jblanksize;i>0;i>>>=1)
{
if ((i%2)==1) blank += esp;
esp+=esp;
}
msg=blank+jmsg1+blank;
window.status=msg
window.setTimeout('jscroll()',jspeed);
}

function newwin(fname,pw,ph)
{
    winclose()
//  var col=""
    eval('win=open("","photo","width=" + pw + ",height=" + ph + ",resizable=no,screenX=50,top=50,screenY=50,left=50,scrollbars=no")')
    winex=true 
    win.document.open()
    var txt="<html><head><title>Фотогалерея</title></head><body bgcolor='white' text=\"Yellow\" leftmargin=0 marginwidth=0 marginheight=0 topmargin=0>"
    txt+="<img src='photo/" + fname + "' border=0><br>"
    win.document.write(txt)
    win.document.close()
    win.focus()
}

function winclose()
{
if (winex) {win.close(); winex=false}
}