
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    (1) ITEMSTYLES    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 var ParentName = document.URL;
 var Path = '';
 var Pref = '&nbsp;&nbsp;&nbsp;-&nbsp;';
 var menuTop; 
 var Sl = String.fromCharCode(47);
// 92-47
	var Find1 = Sl + 'news' + Sl; 
	var Find2 = Sl + 'documents' + Sl; 
	var Find3 = Sl + 'tournaments' + Sl; 
	var Find4 = Sl + 'clubs' + Sl; 
	var Find5 = Sl + 'rules' + Sl; 
 var res1 = ParentName.indexOf(Find1);
 var res2 = ParentName.indexOf(Find2);
 var res3 = ParentName.indexOf(Find3);
 var res4 = ParentName.indexOf(Find4);
 var res5 = ParentName.indexOf(Find5);

Path=''
 if  ((res1 !== -1) || (res2 !== -1) || (res3 !== -1) || (res4 !== -1) || (res5 !== -1))
	{
	Path='../'
	}
 if  ((ParentName.indexOf(Find1 + '2004') !== -1) || (ParentName.indexOf(Find1 + '2005') !== -1))
	{
	Path='../../'
	}


var hBar = new ItemStyle(100, 0, '', 0, 0, '', '', '', '', '',null, null)
var subM = new ItemStyle(18, 0, '', 0, 0, '#CAFBCA', '#7ABD7A', '', '', '', '', null, null);

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    (2) MENU DATA    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
var pMenu = new PopupMenu('pMenu');


with (pMenu)
{
  startMenu('root', false, 0, 107, 23, hBar);
     var leftTop0='<span class="mainmenu">';
     var leftTop1='<span class="submenu">';

  addItem(leftTop0 + '&nbsp;&nbsp;&nbsp;Новости</span>', Path + 'news.php', '', '', 77);
  addItem(leftTop0 + 'Федерация</span>', 'mFederation', 'sm:', '', 88);

//  addItem(leftTop0 + 'Регионы</span>',  'mRegions', 'sm:', '', 72);
  
  addItem(leftTop0 + 'Турниры</span>', 'mTournamnents', 'sm:', '', 70);
//  addItem(leftTop + 'Спортсмены</span>', Path + 'players.htm', '', '', 95);
  addItem(leftTop0 + 'Клубы</span>', 'mClubs', 'sm:', '', 55);
  addItem(leftTop0 + 'Правила</span>', 'mRules', 'sm:', '', 70);
  addItem(leftTop0 + 'Фотогалереи</span>', Path + 'photobank.php', '', '', 98);
  addItem(leftTop0 + 'Видео</span>', Path + 'pool-video.php', '', '', 55);
  addItem(leftTop0 + 'Ссылки</span>', Path + 'friends.php', '', '', 120);
//  addItem(leftTop0 + 'Крым</span>',  Path + 'crimea.php', '', '', 50);
  addItem(leftTop0 + 'Контакты</span>', Path + 'contact.php', '', '', 77);
  

     startMenu('mFederation', true, 0, 20, 120, subM);
	addItem(leftTop1 + '&nbsp;Устав</span>', Path + 'documents.php?id=1', '', '');
	addItem(leftTop1 + '&nbsp;Состав</span>', Path + 'documents.php?id=2', '', '');
	addItem(leftTop1 + '&nbsp;Документы</span>', Path + 'documents.php', '', '');
	addItem(leftTop1 + '&nbsp;Рейтинги</span>', 'mRanking', 'sm:', '', 20, 0, '<img src="' + Path + 'images/_li3.gif">', 110);
    addItem(leftTop1 + '&nbsp;Оборудование</span>', 'mGoods', 'sm:', '', 20, 0, '<img src="' + Path + 'images/_li3.gif">', 110);

		 startMenu('mRanking', true, 115, 0, 85, subM);
		addItem(leftTop1 + '&nbsp;&nbsp;Пирамида</span>', Path + 'ranking.php?pyramid', '', '');
		addItem(leftTop1 + '&nbsp;&nbsp;Пул</span>', Path + 'ranking.php?pool', '', '');
		addItem(leftTop1 + '&nbsp;&nbsp;Снукер</span>', Path + 'ranking.php?snooker', '', '');

		 startMenu('mGoods', true, 115, 0, 78, subM);
		addItem(leftTop1 + '&nbsp;&nbsp;Dynamic</span>', Path + 'g_dynamic.htm', '', '');
		addItem(leftTop1 + '&nbsp;&nbsp;Aramith</span>', Path + 'g_aramith.htm', '', '');
		addItem(leftTop1 + '&nbsp;&nbsp;Simonis</span>', Path + 'g_simonis.htm', '',  '');
		addItem(leftTop1 + '&nbsp;&nbsp;Olhausen</span>', Path + 'g_olhausen.htm', '',  '');
		addItem(leftTop1 + '&nbsp;&nbsp;Longoni</span>', Path + 'g_longoni.htm', '',  '');

	 startMenu('mTournamnents', true, 0, 20, 125, subM);
	addItem(leftTop1 + '&nbsp;Календарь</span>', Path + 'calendar.php', '', '');
	addItem(leftTop1 + '&nbsp;Архив</span>', Path + 'tournaments.php', '', '');
	addItem(leftTop1 + '&nbsp;Международные</span>', Path + 'tournaments.php?int', '', '');

     startMenu('mClubs', true, 0, 23, 125, subM);
	addItem(leftTop1 + '&nbsp;Киев</span>', Path + 'clubs.php?city=1', '', '');
	addItem(leftTop1 + '&nbsp;Донецк</span>', Path + 'clubs.php?city=2', '', '');
	addItem(leftTop1 + '&nbsp;Днепропетровск</span>', Path + 'clubs.php?city=3', '', '');
	addItem(leftTop1 + '&nbsp;Одесса</span>', Path + 'clubs.php?city=4', '', '');

     startMenu('mRegions', true, 0, 23, 125, subM);
	addItem(leftTop1 + '&nbsp;Крым</span>', Path + 'index.php?crimea', '', '');
	addItem(leftTop1 + '&nbsp;Киев</span>', Path + 'index.php?kyiv', '', '');
	addItem(leftTop1 + '&nbsp;Львов</span>', Path + 'index.php?lviv', '', '');
	addItem(leftTop1 + '&nbsp;Запорожье</span>', Path + 'index.php?zaporijya', '', '');
	addItem(leftTop1 + '&nbsp;Житомир</span>', Path + 'index.php?jytomir', '', '');
	addItem(leftTop1 + '&nbsp;Тернополь</span>', Path + 'index.php?ternopil', '', '');
	addItem(leftTop1 + '&nbsp;Хмельницкий</span>', Path + 'index.php?khmelnitsky', '', '');

	 startMenu('mRules', true, 0, 20, 100, subM);
	addItem(leftTop1 + '&nbsp;Пул</span>', 'mRulesPool', 'sm:', '', 20, 0, '<img src="' + Path + 'images/_li3.gif">', 185);
	addItem(leftTop1 + '&nbsp;Пирамида</span>', 'mRulesPyr', 'sm:', '', 20, 0, '<img src="' + Path + 'images/_li3.gif">', 185);
	addItem(leftTop1 + '&nbsp;Снукер</span>', Path + 'rules.php?snk', '', '');
	addItem(leftTop1 + '&nbsp;Карамболь</span>', Path + 'rules.php?carom', '', '');

	     startMenu('mRulesPool', true, 100, 0, 150, subM);
       addItem(leftTop1 + '&nbsp;Общие правила</span><hr />', Path + 'rules.php?pool=0', '', '');
       addItem(leftTop1 + Pref + 'Восьмёрка (8-ball)</span>', Path + 'rules.php?pool=1', '', '');
       addItem(leftTop1 + Pref + 'Девятка (9-ball)</span>', Path + 'rules.php?pool=2', '', '');
       addItem(leftTop1 + Pref + '14+1 (straight pool)</span>', Path + 'rules.php?pool=3', '', '');
       addItem(leftTop1 + Pref + 'Деcятка (10-ball)</span>', Path + 'rules.php?pool=4', '', '');

	     startMenu('mRulesPyr', true, 100, 0, 220, subM);
       addItem(leftTop1 + '&nbsp;Общие правила</span><hr />', Path + 'rules.php?pyr=0', '', '');
       addItem(leftTop1 + Pref + 'Свободная пирамида</span>',  Path + 'rules.php?pyr=1', '', '');
       addItem(leftTop1 + Pref + 'Комбинированная пирамида</span>', Path + 'rules.php?pyr=2', '', '');
       addItem(leftTop1 + Pref + 'Динамичная пирамида</span>', Path + 'rules.php?pyr=3', '', '');
       addItem(leftTop1 + Pref + 'Классическая пирамида</span>', Path + 'rules.php?pyr=4', '', '');

}


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    (3) EVENTS    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if (!isNS4)
{
 pMenu.update(true);
}
else
{
 var popOldOL = window.onload;

window.onload = function()
 {
  if (popOldOL) popOldOL();
  pMenu.update();
 }
}

window.onresize = function()
{
 ns4BugCheck();
 pMenu.position();
}

window.onscroll = function()
{
 pMenu.position();
}

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = function(evt)
{
 pMenu.click();
 if (isNS4) return document.routeEvent(evt);
}

var nsWinW = window.innerWidth, nsWinH = window.innerHeight;
function ns4BugCheck()
{
 if (isNS4 && (nsWinW!=innerWidth || nsWinH!=innerHeight)) location.reload()
}

if (!isIE || window.opera)
{
 var nsPX=pageXOffset, nsPY=pageYOffset;
 setInterval('if (nsPX!=pageXOffset || nsPY!=pageYOffset) ' +
 '{ nsPX=pageXOffset; nsPY=pageYOffset; window.onscroll() }', 50);
}


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    (4) ANIMATION    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

function menuClip(menuObj, menuName, dir)
{
 var mD = menuObj.menu[menuName][0];
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;
 with (mD)
 {
  clearTimeout(timer);
  if (!lyr || !lyr.ref) return;
  if (dir==1) lyr.vis('visible');
  lyr.sty.zIndex = 1001 + dir;
  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/20),0.75) );
  counter += dir;
  if (counter==11) { counter = 2; if (isDOM&&!isIE) lyr.sty.clip='' }
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout(menuObj.myName+'.'+(dir==1?'show':'hide')+'Menu("'+menuName+'")', 40);
 }
}

if (!window.opera)
{
 pMenu.showMenu = new Function('mN','menuClip(pMenu, mN, 1)');
 pMenu.hideMenu = new Function('mN','menuClip(pMenu, mN, -1)');
}




// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function WriteHeader(Picture, isRambler, subPathLevel)
{
  var Image = 'images/up1.gif';
  var bgColor = '#FFFFFA';
  var subPath = '';
	
if (subPathLevel == 1)
  {
  subPath = '../'	
  }
if (subPathLevel == 2)
  {
  subPath = '../../'	
  }


if (Picture == 'news')
  {
  Image = 'images/up1.gif'	
  }
if (Picture == 'federation')
  {
  Image = 'images/up2.gif'	
  }
if (Picture == 'calendar')
  {
  Image = 'images/up3.gif'	
  }

if (Picture == 'clubs')
  {
  Image = 'images/up5.gif'	
  }
if (Picture == 'rules')
  {
  Image = 'images/up6.gif'	
  }

// количество уникальных посетителей всего/сегодня/сейчас

document.write(' <table cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="' + bgColor + '">');
document.write('    <tr height="108" bgcolor="' + bgColor + '">'); 
document.write('      <td height="109" bgcolor="' + bgColor + '">'); 
document.write('	<img src="' + subPath + Image + '" height="109" border="0" usemap="#Map"></td>');

// document.write('	<td width="100%" bgcolor="' + bgColor + '">');
// document.write('	<table align="center" cellpadding="0" cellspacing="0">');
// document.write('		<tr><td bgcolor="' + bgColor + '" align="center"><img src="' + subPath + 'images/text2.gif"></td></tr>');
// document.write('		<tr><td bgcolor="' + bgColor + '" align="center"><img src="' + subPath + 'images/text3.gif" vspace="1"></td></tr>');
// document.write('	</table>');
// document.write('	</td>');

document.write('      <td bgcolor="' + bgColor + '" width="140" height="66" align="center" valign="middle" >'); 
document.write('        <a href="' + subPath + 'magazin.htm"><img src="' + subPath + 'images/logos/bm1.gif" width="140" height="50" hspace="15" border="0"></a></td>'); 
document.write('      <td bgcolor="' + bgColor + '" width="140" height="66" align="center" valign="middle" >'); 
document.write('        <a href="http:' + Sl + Sl + 'www.weekend-billiard.ru/"><img src="' + subPath + 'images/logos/weekend.jpg" width="140" height="50" border="0"></a></td>'); 
document.write('    <tr>');
document.write('      <td class="topmenu" colspan="4">');
document.write('    </tr></table>');

document.write('<map name="Map">');
document.write('  <area shape="circle" coords="37,32,31" href="' + subPath + '/">');
document.write('</map>');

if (isRambler == 1)
   {
   // begin of Rambler's Top100 code
   document.write('<a href="http:' + Sl + Sl + 'top100.rambler.ru/top100/">');
   document.write('<img src="http:' + Sl + Sl + 'counter.rambler.ru/top100.cnt?684780" alt="" width=1 height=1 border=0 align="left"></a>');
   // end of Top100 code
   }
}

