// menu.js Andrei Boris 08-10-06

function _preload(img) { var a=new Image(); a.src=img; return a; }
hi_ik=new Array('uk','fr','en');
hi_on=new Array();
hi_off=new Array();
for(k=0; k<3;k++) {
 hi_on[k]=_preload("/i/"+hi_ik[k]+"_on.gif");
 hi_off[k]=_preload("/i/"+hi_ik[k]+"_off.gif");
}

function ban(racine,uk,fr,en,ru){
/* Ribbon Tak!
 document.write('<div class="ribbon">');
 document.write('<a href="http://www.razom.org.ua/">');
 document.write('<IMG src="'+racine+'i/tr.gif" alt="Tak!" width=100 height=129 border=0></a></div>');
*/

// Display logo
 document.write('<table border="0" width="100%" height="40" cellspacing="0" cellpadding="0">');
 document.writeln('  <tr>');
 document.write('<td width="350" style="PADDING-LEFT:5px; PADDING-BOTTOM:1px;">');
 document.write('<a href="http://www.quebec-ukraine.com/" title="На головну сторінку" style="text-decoration:none;">');
 document.write('<span style="font-family:Verdana, Arial;">');
 document.write('<span style="font-size:24px; color:#120285; font-weight:bold">Qu&eacute;bec</span>');
 document.write('<span style="font-size:24px; color:#FE9C11; font-weight:bold">-Ukraine</span>');
 document.write('<span style="font-size:18px; color:#030303; font-weight:bold">.com</span><br>');
 document.write('<span style="font-size:9px; color:#030303;">Український інформаційний портал провінції Квебек, Канада</span>');
 document.write('</a></td>');

// document.write('<td align="center" width="300" style="background: url('+racine+'i/paska.gif) 0 0 // no-repeat;">');

/*
 document.write('<td>');
 document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
 document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
 document.write(' WIDTH=590 HEIGHT=42>');
 document.write('<PARAM NAME=movie VALUE="'+racine+'i/flash/fest_2007_uk.swf"><PARAM NAME=menu VALUE=false>');
 document.write('<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE="#FFFFFF">');
 document.write('<EMBED src="'+racine+'i/flash/fest_2007_uk.swf" menu=false quality=high bgcolor="#FFFFFF"');
 document.write(' WIDTH=590 HEIGHT=42 TYPE="application/x-shockwave-flash"');
 document.write(' PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
 document.write('</EMBED></OBJECT>');
 document.write('</td>');
*/

// document.write('<td align="center" style="PADDING-LEFT:5px; PADDING-BOTTOM:1px;">');
// document.write('<a href="'+racine+'action.html">');

/*
 document.write('<a href="http://zustrich.quebec-ukraine.com/salut.html" style="text-decoration:none;">');
 document.write('<span style="font-size:12px; COLOR:red; font-weight:bold;">');
 document.write('Доля України у твоїх руках!<br>Проголосуй! <span style="COLOR:#FE9C11;">РАЗОМ - переможемо!</span></span></a></td>');
*/

/*
 document.write('<td align="center" style="PADDING-LEFT:0px; PADDING-BOTTOM:0px;">');
 document.write('<IMG src="'+racine+'i/christmas.gif" alt="Щасливого Нового року та Веселих Свят!" ');
 document.write(' width=350 height=42 border=0></td>');
*/

/*
 document.write('<td align="center" style="PADDING-LEFT:0px; PADDING-BOTTOM:0px;">');
 document.write('<IMG src="'+racine+'i/independence.gif" alt="З Днем незалежності України!" ');
 document.write(' width=350 height=42 border=0></td>');
*/

 document.write('<td>&nbsp;</td>');

 if((fr) || (en) || (ru)) {
  document.write('<td style="PADDING-RIGHT:5px; PADDING-BOTTOM:2px;');
  document.write('" align="right" valign="bottom">');
  document.write('<IMG src="'+racine+'i/uk_on.gif" alt="" width=81 height=14 border=0> ');
  if(fr) {
   document.write('<a href="'+fr+'">');
   document.write('<IMG src="'+racine+'i/fr_off.gif" alt="" width=81 height=14 border=0 onMouseover="this.src=hi_on[1].src" onMouseout="this.src=hi_off[1].src" alt="Francais"></a> ');
  }
  if(en) {
   document.write('<a href="'+en+'">');
   document.write('<IMG src="'+racine+'i/en_off.gif" alt="" width=81 height=14 border=0 onMouseover="this.src=hi_on[2].src" onMouseout="this.src=hi_off[2].src" alt="English"></a> ');
  }
  document.write('</td>');
 }
 document.write('</tr></table>');

// DHTML menu
 document.write('<TABLE class="onnote" width="100%" cellSpacing=0 cellPadding=0>');
 document.write(' <TR>');
 document.write('   <TD height="20"><img src="'+racine+'i/tr.gif" width="1" height="20" alt=""></TD>');
 document.write(' </TR>');
 document.writeln('</TABLE>');
 writem(racine);
}

var croot = '';
var menus = [];
var MENU_POS1 = new Array();


MENU_POS1['height'] = [20, 20, 20, 20];
MENU_POS1['width'] = [100, 150, 270, 270];
// menu block offset from the origin:
// for root level origin is upper left corner of the page
// for other levels origin is upper left corner of parent item
MENU_POS1['block_top'] = [42, 21, 4, 4];
MENU_POS1['block_left'] = [0, 0, 137, 237];
// offsets between items of the same level
MENU_POS1['top'] = [0, 21, 19, 17];
MENU_POS1['left'] = [131, 0, 0, 0];
MENU_POS1['hide_delay'] = [1000, 1200, 1600, 1600];

var MENU_STYLES1 = new Array();
MENU_STYLES1['onmouseout'] = [
	'color', ['#333', '#000', '#000', '#000'], 
	'background', ['#E2EAFA', '#FFF9EA', '#E2EAFA', '#E2EAFA'],
	'fontWeight', ['normal', 'normal', 'normal', 'normal'],
	'textDecoration', ['none', 'none', 'none', 'none'],
];
MENU_STYLES1['onmouseover'] = [
	'color', ['#000', '#000', '#000', '#000'], 
	'background', ['#FE9C11', '#FE9C11', '#FE9C11', '#FE9C11'],
	'fontWeight', ['normal', 'normal', 'normal', 'normal'],
	'textDecoration', ['none', 'none', 'none', 'none'],
];

var MENU_ITEMS = new Array();

function menu (item_struct, pos, styles) {
 this.item_struct = item_struct;
 this.pos = pos;
 this.styles = styles;
 this.id = menus.length;
 this.items = [];
 this.children = [];
	
 this.add_item = menuAddItem;
 this.hide = menuHide;
 this.onclick = menuOnClick;
 this.onmouseout = menuOnMouseOut;
 this.onmouseover = menuOnMouseOver;

 var i;
 for(i=0; i < this.item_struct.length; i++)
  new menu_item(i, this, this);
 for(i=0; i < this.children.length; i++)
  this.children[i].visibility(true);
 menus[this.id] = this;
}
function menuAddItem (item) {
  var id = this.items.length;
  this.items[id] = item;
  return (id);
}
function menuHide () {
 for(var i=0; i < this.items.length; i++) {
  this.items[i].visibility(false);
  this.items[i].switch_style('onmouseout');
 }
}
function menuOnClick (id) {
 var item = this.items[id];
 return (item.fields[1] ? true : false);
}
function menuOnMouseOut (id) {
 this.hide_timer = setTimeout('menus['+ this.id +'].hide();',
 this.pos['hide_delay'][this.active_item.depth]);
 if(this.active_item.id == id)
  this.active_item = null;
}
function menuOnMouseOver (id) {
 this.active_item = this.items[id];
 clearTimeout(this.hide_timer);
 var curr_item, visib;
 for(var i=0; i<this.items.length; i++) {
  curr_item = this.items[i];
  visib=(curr_item.arrpath.slice(0,curr_item.depth).join('_')==this.active_item.arrpath.slice(0,curr_item.depth).join('_'));
  if(visib)
   curr_item.switch_style (curr_item == this.active_item ? 'onmouseover' : 'onmouseout');
   curr_item.visibility(visib);
  }
}
function writem(racine) {
 cImg = '<img src="' + racine + 'i/rt_plus.gif" width="4" height="10" border=0 align="right">';
 MENU_ITEMS = [
	['ГОЛОВНА', racine + 'index_uk.html',
		['Новини', racine + 'news/index.html'],
		['Подробиці', racine + 'news/events.html'],
		[cImg + 'Фотогалерея', racine + 'gal/index.html',
			[cImg + '2009 рік', racine + 'gal/index.html#a2009',
				['«Україна на параді» 2009', racine + 'gal/2009_st_patrick_day.html'],
				['Український Фестиваль 2009', racine + 'gal/2009_ukrainian_festival_montreal.html'],
			],
			[cImg + '2008 рік', racine + 'gal/index.html#a2008',
				['«Україна на параді» 2008', racine + 'gal/2008_st_patrick_day.html'],
				['Міжнародна Незгасима свічка у Монреалі', racine + 'gal/2008_remembrance_flame_montreal.html'],
				['Міжнародна Незгасима свічка в Оттаві', racine + 'gal/2008_remembrance_flame_ottawa.html'],
				['Український Фестиваль 2008', racine + 'gal/2008_ukrainian_festival_montreal.html'],
			],
			[cImg + '2007 рік', racine + 'gal/index.html#a2007',
				['«Україна на параді» 2007', racine + 'gal/2007_st_patrick_day.html'],
				['Фестиваль вулиці <i>St-Viateur</i> 2007', racine + 'gal/2007_festival_st_viateur.html'],
				['«Марунчак» на Національному святі 2007', racine + 'gal/2007_fete_nationale.html'],
				['Український Фестиваль 2007', racine + 'gal/2007_ukrainian_festival_montreal.html'],
			],

			[cImg + '2006 рік', racine + 'gal/index.html#a2006',
				['«Україна на параді» 2006', racine + 'gal/2006_st_patrick_day.html'],
				['Український Фестиваль 2006', racine + 'gal/2006_festival.html'],
			],
			[cImg + '2005 рік', racine + 'gal/index.html#a2005',
				['Новорічний вечір 2005 «ЗУСТРІЧі»', racine + 'gal/2005_new_year.html'],
				['«Україна на параді» 2005', racine + 'gal/2005_st_patrick_day_1.html'],
				['Подорож «ЗУСТРІЧі» у Квебек 2005', racine + 'gal/2005_nouvelle_france.html'],
				['Український Фестиваль 2005', racine + 'gal/2005_festival.html'],
			],
			[cImg + '2004 рік', racine + 'gal/index.html#a2004',
				['Маланка Товариства «Україна»', racine + 'gal/2004_malanka_sport.html'],
				['Традиційна кутя в УНО', racine + 'gal/2004_kutia_1.html'],
				['Фестиваль «Montr&eacute;al en lumi&egrave;re»', racine + 'gal/2004_montreal_en_lumiere.html'],
				['«Україна на параді» 2004', racine + 'gal/2004_st_patrick_day_1.html'],
				['День культури в Конкордії', racine + 'gal/2004_concordia.html'],
				['Капела бандуристів у Монреалі', racine + 'gal/2004_bandurist.html'],
				['Весняна вечірка в СУМі', racine + 'gal/2004_sum_party.html'],
				['Концерт ансамблю «МАРУНЧАК»', racine + 'gal/2004_marunczhak_recital.html'],
				['54 хвилини на вулиці Рашель', racine + 'gal/2004_rachel.html'],
				['Зелені свята', racine + 'gal/2004_zeleni_sviata.html'],
				['Пікнік на острові Св.Єлени', racine + 'gal/2004_st_helene.html'],
				['Концерт «ТРОЯНДА» і «КОЛО»', racine + 'gal/2004_troyanda_&_kolo.html'],
				['Український Фестиваль 2004', racine + 'gal/2004_festival_1.html'],
				['«ТРОЯНДА» на параді P&egrave;re No&euml;l', racine + 'gal/2004_pere_noel.html'],
				['Акція протесту в Монреалі', racine + 'gal/2004_square_victoria.html'],
				['Демонстрація протесту в Оттаві', racine + 'gal/2004_parliament.html'],
				['Акція у підтримку Майдану', racine + 'gal/2004_candlelight.html'],
			],
			[cImg + '2003 рік', racine + 'gal/index.html#a2003',
				['Різдвяна вечірка в СУМі', racine + 'gal/2003_sum_party.html'],
				['Новорічний вечір 2004 «ЗУСТРІЧі»', racine +'gal/2004_new_year_1.html'],
			],
                ],
		['Світлина тижня', racine + 'pic.html'],
		['Мультимедіа', racine + 'download.html'],
		['Каталог підприємств', racine + 'bz/'],
		['Календар подій', racine + 'ev/index.php?l=u'],
   	],

	['КВЕБЕК', racine + 'quebec/index.html',
		[cImg + 'Освіта', racine + 'quebec/education_1.html',
			['Система освіти', racine + 'quebec/education_1.html'],
			['Школи', racine + 'quebec/education_2.html'],
			['CEGEP', racine + 'quebec/education_3.html'],
			['Приватні коледжі', racine + 'quebec/education_4.html'],
			['Університети', racine + 'quebec/education_5.html'],
			['Курси мов', racine + 'quebec/education_6.html'],
		],
		[cImg + 'Житло і побут', racine + 'quebec/home_1.html',
			['Квартири', racine + 'quebec/home_1.html'],
			['Комунальні послуги', racine + 'quebec/home_2.html'],
			['Податки', racine + 'quebec/home_3.html'],
		],
		[cImg + 'Комунікації', racine + 'quebec/communication_1.html',
			['Міський транспорт', racine + 'quebec/communication_1.html'],
			['Автомобіль', racine + 'quebec/communication_2.html'],
			['Телефон', racine + 'quebec/communication_3.html'],
			['Інтернет', racine + 'quebec/communication_4.html'],
			['Міжміський транспорт', racine + 'quebec/communication_5.html'],
			['Пошта', racine + 'quebec/communication_6.html'],
		],
		[cImg + 'Робота', racine + 'quebec/work_1.html',
			['Умови праці', racine + 'quebec/work_1.html'],
			['Пошук праці', racine + 'quebec/work_2.html'],
			['Безробіття', racine + 'quebec/work_3.html'],
			['Для новоприбулих', racine + 'quebec/work_4.html'],
		],
		[cImg + 'Охорона здоров\'я', racine + 'quebec/sante_1.html',
			['Медична картка', racine + 'quebec/sante_1.html'],
			['Медичні послуги', racine + 'quebec/sante_2.html'],
			['Ліки', racine + 'quebec/sante_3.html'],
		],
		[cImg + 'Соціальний захист', racine + 'quebec/bien_1.html',
			['Пенсія', racine + 'quebec/bien_1.html'],
			['Допомога сім\'ям з дітьми', racine + 'quebec/bien_2.html'],
			['Соціальна допомога', racine + 'quebec/bien_3.html'],
		],
	],

	['ГРОМАДА', racine + 'gr/index.html',
		['Мапа', racine + 'gr/map.html'],
		[cImg + 'Церкви', racine + 'gr/e/index.html',
			['Успіння Божої матері', racine + 'gr/e/e1_assumption.html'],
			['Святого Михаїла', racine + 'gr/e/e2_st_michel.html'],
			['Святого Духа', racine + 'gr/e/e3_st_esprit.html'],
			['Святого Івана Хрестителя', racine + 'gr/e/e4_st_baptist.html'],
			['Святого Василія Великого', racine + 'gr/e/e5_st_basil.html'],
			['Катедра Святої Софії', racine + 'gr/e/e7_ste_sophie.html'],
			['Покрови Богородиці', racine + 'gr/e/e8_ste_marie.html'],
			['Святого Юрія', racine + 'gr/e/e9_st_george.html'],
			['<span style="color:#6D7456;">Буковинська</span>', racine + 'gr/e/e10_st_john_sochawa.html'],
		],
		[cImg + 'Люди', racine + 'gr/gens/index.html',
			['Роман Рахманний', racine + 'gr/gens/roman_rakhmanny.html'],
			['Володимир Іллющенко', racine + 'gr/gens/illyushchenko.html'],
		],
		['Кредитівки', racine + 'gr/banks.html'],
		['Освіта і культура', racine + 'gr/culture.html'],
		['Медіа', racine + 'gr/media.html'],
		['Організації', racine + 'gr/organismes.html'],
		['Соціальні послуги', racine + 'gr/services.html'],
		['Спорт', racine + 'gr/sport.html'],
		['Статистика', racine + 'gr/stats.html'],
		['<span style="font-weight:bold;">Втрати у війнах</span>', racine + 'gr/list_of_honor.html'],
	],
	['ВЕБСАЙТИ', racine + 'web.html',
		['КУК', 'http://ucc.quebec-ukraine.com/uk/'],
		['Товариство «ЗУСТРІЧ»', 'http://zustrich.quebec-ukraine.com/'],
		[cImg + 'Лінки', racine + 'cgi-bin/l/links.cgi',
			['Новини', racine + 'cgi-bin/l/links.cgi?kat=a0'],
			['Портали і каталоги', racine + 'cgi-bin/l/links.cgi?kat=a1'],
			['Регіони України', racine + 'cgi-bin/l/links.cgi?kat=a2'],
			['Культура і мистецтво', racine + 'cgi-bin/l/links.cgi?kat=a3'],
			['Вебкрамниці', racine + 'cgi-bin/l/links.cgi?kat=a4'],
			['Українці за кордоном', racine + 'cgi-bin/l/links.cgi?kat=a5'],
			['Спорт', racine + 'cgi-bin/l/links.cgi?kat=a6'],
			['Музика', racine + 'cgi-bin/l/links.cgi?kat=a7'],
			['Особисті сторінки', racine + 'cgi-bin/l/links.cgi?kat=a8'],
			['Все інше', racine + 'cgi-bin/l/links.cgi?kat=a9'],
		],
		['Додати лінк', racine + 'cgi-bin/l/links.cgi?action=add_form'],
	],
	['ФОРУМИ', racine + 'forum/index.php',
		['Rue de l\'Ukraine', racine + 'forum/index.php?c=1'],
		['Іміграція',  racine + 'forum/index.php?c=3'],
		['Оголошення',  racine + 'forum/index.php?c=4'],
	],
	['РЕДАКЦІЯ', racine + 'ab/index.html',
		['Контакт', racine + 'ab/contact.html'],
		['Подяка', racine + 'ab/slovo.html'],
	],
  ];
  new menu (MENU_ITEMS, MENU_POS1, MENU_STYLES1);
}
function menu_onmousedown (id) {
 this.items[id].switch_style('onmousedown');
}
function menu_item (path, parent, container) {
 this.path = new String (path);
 this.parent = parent;
 this.container = container;
 this.arrpath = this.path.split('_');
 this.depth = this.arrpath.length - 1;

// get pointer to item's data in the structure
 var struct_path = '', i;
 for (i = 0; i <= this.depth; i++)
  struct_path += '[' + (Number(this.arrpath[i]) + (i ? 2 : 0)) + ']';
 eval('this.fields = this.container.item_struct' + struct_path);
 if (!this.fields) return;
	
// assign methods	
 this.get_x = mitem_get_x;
 this.get_y = mitem_get_y;

// these methods may be different for different browsers (i.e. non DOM compatible)
 this.init = mitem_init;
 this.visibility = mitem_visibility;
 this.switch_style = mitem_switch_style;
	
// register in the collections
 this.id = this.container.add_item(this);
 parent.children[parent.children.length] = this;
	
// init recursively
 this.init();
 this.children = [];
 var child_count = this.fields.length - 2;
 for(i=0; i < child_count; i++)
  new menu_item (this.path + '_' + i, this, this.container);
 this.switch_style('onmouseout');
}
function mitem_init() {
 var sClass = ' class="m' + this.container.id + 'l' + this.depth + '';
 document.write ('<a id="mi_' + this.container.id + '_'
	+ this.id +'"' + sClass +'o" href="' + this.fields[1] + '" style="position: absolute; top: '
	+ this.get_y() + 'px; left: '	+ this.get_x() + 'px; width: '
	+ this.container.pos['width'][this.depth] + 'px; height: '
	+ this.container.pos['height'][this.depth] + 'px; visibility: hidden;');
 if(this.depth > 0)
  document.write ('filter: progid:DXImageTransform.Microsoft.Alpha(opacity=90);');
  document.write (' background: black; color: white; z-index: ' + this.depth + ';" '
	+ 'onclick="return menus[' + this.container.id + '].onclick('
	+ this.id + ');" onmouseout="menus[' + this.container.id + '].onmouseout('
	+ this.id + ');" onmouseover="menus[' + this.container.id + '].onmouseover('
	+ this.id + ');"><div' + sClass +'i">' 
	+ this.fields[0] + "</div></a>\n");
  this.element = document.getElementById('mi_' + this.container.id + '_' + this.id);
}
function mitem_visibility(make_visible) {
 if(make_visible != null) {
  if(this.visible == make_visible) return;
  this.visible = make_visible;
  if(make_visible)
   this.element.style.visibility = 'visible';
  else if(this.depth)
   this.element.style.visibility = 'hidden';
 }
 return (this.visible);
}
function mitem_get_x() {
 var value = 0;
 for (var i=0; i <= this.depth; i++)
  value += this.container.pos['block_left'][i] + this.arrpath[i] * this.container.pos['left'][i];
 return (value);
}
function mitem_get_y() {
 var value = 0;
 for (var i=0; i <= this.depth; i++)
  value += this.container.pos['block_top'][i] + this.arrpath[i] * this.container.pos['top'][i];
 return (value);
}
function mitem_switch_style(state) {
 if (this.state == state) return;
 this.state = state;
 var style = this.container.styles[state];
 for(var i=0; i < style.length; i += 2)
  if(style[i] && style[i+1]) eval('this.element.style.' + style[i] + "='" + style[i+1][this.depth] + "';");
}
function printImg() {
 var dirNum = Math.floor(Math.random()*35) + 1;
 var fotoNum = Math.floor(Math.random()*20) + 1 ; 
 if(dirNum == 7) 
  fotoNum = Math.floor(Math.random()*11) + 1;
 else if((dirNum == 12) || (dirNum == 14))
  fotoNum = Math.floor(Math.random()*15) + 1;
 else if(dirNum >= 22) {
  if(fotoNum < 10)
   fotoNum='0'+fotoNum;
 }
 var galleryUri = new Array();
 galleryUri[0] = "";
 galleryUri[1] = "2003_sum_party.html";
 galleryUri[2] = "2004_new_year_1.html";
 galleryUri[3] = "2004_malanka_sport.html";
 galleryUri[4] = "2004_kutia_1.html";
 galleryUri[5] = "2004_montreal_en_lumiere.html";
 galleryUri[6] = "2004_st_patrick_day_1.html";
 galleryUri[7] = "2004_concordia.html";
 galleryUri[8] = "2004_bandurist.html";
 galleryUri[9] = "2004_sum_party.html";
 galleryUri[10] = "2004_marunczhak_recital.html";
 galleryUri[11] = "2004_rachel.html";
 galleryUri[12] = "2004_zeleni_sviata.html";
 galleryUri[13] = "2004_st_helene.html";
 galleryUri[14] = "2004_troyanda_&_kolo.html";
 galleryUri[15] = "2004_festival_1.html";
 galleryUri[16] = "2004_pere_noel.html";
 galleryUri[17] = "2004_square_victoria.html";
 galleryUri[18] = "2004_parliament.html";
 galleryUri[19] = "2004_candlelight.html";
 galleryUri[20] = "2005_new_year.html";
 galleryUri[21] = "2005_st_patrick_day_1.html";
 galleryUri[22] = "2005_nouvelle_france.html";
 galleryUri[23] = "2005_festival.html";
 galleryUri[24] = "2006_st_patrick_day.html";
 galleryUri[25] = "2006_festival.html";
 galleryUri[26] = "2007_st_patrick_day.html";
 galleryUri[27] = "2007_festival_st_viateur.html";
 galleryUri[28] = "2007_fete_nationale.html";
 galleryUri[29] = "2007_ukrainian_festival_montreal.html";
 galleryUri[30] = "2008_st_patrick_day.html";
 galleryUri[31] = "2008_remembrance_flame_montreal.html";
 galleryUri[32] = "2008_remembrance_flame_ottawa.html";
 galleryUri[33] = "2008_ukrainian_festival_montreal.html";
 galleryUri[34] = "2009_st_patrick_day.html";
 galleryUri[35] = "2009_ukrainian_festival_montreal.html";
 var string = '<a href="gal/' + dirNum + '/' + fotoNum + '.jpg" target="_blanc"><IMG src="gal/';
 string += dirNum +'/'+ fotoNum +'s.jpg" alt="Ця ж світлина розміром 600х449" width=160 height=120 ';
 string += 'style="BORDER:#000 1px solid;"></a>';
 string += '<br><a href="gal/' + galleryUri[dirNum] + '" class="wt">Переглянути цю підбірку</a>';
 document.write(string);
}
