// header

function _preload_fr(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_fr("/i/"+hi_ik[k]+"_on.gif");
 hi_off[k]=_preload_fr("/i/"+hi_ik[k]+"_off.gif");
}

function ban_fr(racine,uk,fr,en,ru){
// Display logo
 document.write('<table border="0" width="100%" height="40" cellspacing="0" cellpadding="0">');
 document.writeln('  <tr>');
 document.write('<td width="300" style="PADDING-LEFT:5px; PADDING-BOTTOM:1px;">');
 document.write('<a href="http://quebec-ukraine.com/" title="Vers la page d\'accueil" 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;">Portail ukrainien d\'information au Québec, Canada</span>');
 document.write('</a></td>');

/*
 document.write('<td align="center" style="PADDING-LEFT:0px; PADDING-BOTTOM:0px;">');
 document.write('<IMG src="'+racine+'i/christmas_fr.gif" alt="Joyeux Noël et Bonne Année !" ');
 document.write(' width=350 height=42 border=0></td>');
*/

/*
 document.write('<td style="vertical-align:top">');
 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_2011_fr.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_2011_fr.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:0px; PADDING-BOTTOM:0px;">');
 document.write('<IMG src="'+racine+'i/independence_fr.gif" alt="24 août Jour de l\'indépendence de l\'Ukraine" ');
 document.write(' width=350 height=42 border=0></td>');
*/

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

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

 if((uk) || (en) || (ru)) {
  document.write('<td style="PADDING-RIGHT:5px; PADDING-BOTTOM:2px;');
  document.write('" align="right" valign="bottom">');
  if(uk) {
   document.write('<a href="'+uk+'">');
   document.write('<IMG src="'+racine+'i/uk_off.gif" alt="" width=81 height=14 border=0 alt="Ukrainien" ');
   document.write('onMouseover="this.src=hi_on[0].src" ');
   document.write('onMouseout="this.src=hi_off[0].src" ></a> ');
  }
  document.write('<IMG src="'+racine+'i/fr_on.gif" alt="" width=81 height=14 border=0> ');
  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>');

/*
 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>');
*/

 document.write('<div id="onnote0">');
 document.write('<!-- -->');
 document.write('</div>');
 
 document.write('<div id="onnote1">');
 document.write('<!-- -->');
 document.write('</div>');

 writem(racine);
}

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

MENU_POS1['height'] = [20, 20, 20, 20];
MENU_POS1['width'] = [140, 150, 250, 250];
// 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'],
];

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 = [
	['ACCUEIL', racine + 'index_fr.html',
		['Actualités', racine + 'news/index_fr.html'],
		['Photo de la semaine', racine + 'pic_fr.html'],
		[cImg + 'Galeries photo', racine + 'gal/index_fr.html',
			[cImg + 'Année 2009', racine + 'gal/index_fr.html#a2009',
				['Ukrainiens à la Saint Patrick 2009', racine + 'gal/2009_st_patrick_day_fr.html'],
			],
			[cImg + 'Année 2008', racine + 'gal/index_fr.html#a2008',
				['Ukrainiens à la Saint Patrick 2008', racine + 'gal/2008_st_patrick_day_fr.html'],
				['Festival ukrainien de Montréal 2008', racine +'gal/2008_festival_ukrainien_montreal.html'],
			],
			[cImg + 'Année 2007', racine + 'gal/index_fr.html#a2007',
				['Ukrainiens à la Saint Patrick 2007', racine + 'gal/2007_st_patrick_day_fr.html'],
				['Festival de rue Saint-Viateur 2007', racine + 'gal/2007_festival_st_viateur_fr.html'],
				['«Marunczak» à la Fête nationale 2007', racine + 'gal/2007_fete_nationale_fr.html'],
				['Festival ukrainien de Montréal 2007', racine +'gal/2007_festival_ukrainien_montreal.html'],
			],
			[cImg + 'Année 2006', racine + 'gal/index_fr.html#a2006',
				['Ukrainiens à la Saint Patrick 2006', racine + 'gal/2006_st_patrick_day_fr.html'],
				['Festival ukrainien de Montréal 2006', racine + 'gal/2006_festival_fr.html'],
			],
			[cImg + 'Année 2005', racine + 'gal/index_fr.html#a2005',
				['Réveillon de Nouvel An 2005 à «ZUSTRICH»', racine + 'gal/2005_new_year_fr.html'],
				['Ukrainiens à la Saint Patrick 2005', racine + 'gal/2005_st_patrick_day_1_fr.html'],
				['Association «ZUSTRICH» à Québec 2005', racine + 'gal/2005_nouvelle_france_fr.html'],
				['Festival ukrainien de Montréal 2005', racine + 'gal/2005_festival_fr.html'],
			],
			[cImg + 'Année 2004', racine + 'gal/index_fr.html#a2004',
				['Malanka de l\'Association «UKRAINE»', racine + 'gal/2004_malanka_sport_fr.html'],
				['Kutia traditionnel à l\'UNF', racine + 'gal/2004_kutia_1_fr.html'],
				['Festival «MONTRÉAL EN LUMIÈRE»', racine + 'gal/2004_montreal_en_lumiere_fr.html'],
				['Ukraine à la parade de la Saint Patrick', racine + 'gal/2004_st_patrick_day_1_fr.html'],
				['Journée de la culture à Concordia', racine + 'gal/2004_concordia_fr.html'],
				['Capella de bandouristes à Montréal', racine + 'gal/2004_bandurist_fr.html'],
				['Party printanier à SUM', racine + 'gal/2004_sum_party_fr.html'],
				['Spectacle annuel de «MARUNCZAK»', racine + 'gal/2004_marunczhak_recital_fr.html'],
				['54 minutes sur la rue Rachel', racine + 'gal/2004_rachel_fr.html'],
				['Fêtes vertes à Notre-Dame-des-Neiges', racine + 'gal/2004_zeleni_sviata_fr.html'],
				['Pique-nique à l\'île Ste-Hélène', racine + 'gal/2004_st_helene_fr.html'],
				['Concert de «TROYANDA» et «KOLO»', racine + 'gal/2004_troyanda_et_kolo_fr.html'],
				['Festival ukrainien de Montréal 2004', racine + 'gal/2004_festival_1_fr.html'],
				['«TROYANDA» à la Parade du Père Noël', racine + 'gal/2004_pere_noel_fr.html'],
				['Manifestation à Montréal contre la fraude', racine + 'gal/2004_square_victoria_fr.html'],
				['Manifestation à Ottawa contre la fraude', racine + 'gal/2004_parliament_fr.html'],
				['Vigile aux chandelles à Montréal', racine + 'gal/2004_candlelight_fr.html'],
			],
			[cImg + 'Année 2003', racine + 'gal/index_fr.html#a2003',
				['Party de Noël à SUM', racine + 'gal/2003_sum_party_fr.html'],
				['Nouvel An 2004 à l\'Association «ZUSTRICH»', racine +'gal/2004_new_year_1_fr.html'],
			],
                ],
		['Multimédia', racine + 'download_fr.html'],
		['Agenda', racine + 'ev/index.php?l=f'],
   	],
	['COMMUNAUTÉ', racine + 'gr/index_fr.html',
		['Carte', racine + 'gr/map_fr.html'],
		[cImg + 'Églises', racine + 'gr/e/index_fr.html',
			['Assomption-de-la-Bienheureuse-Vierge-Marie', racine + 'gr/e/e1_assumption_fr.html'],
			['St-Michel', racine + 'gr/e/e2_st_michel_fr.html'],
			['St-Esprit', racine + 'gr/e/e3_st_esprit_fr.html'],
			['St-Jean-Baptiste', racine + 'gr/e/e4_st_baptist_fr.html'],
			['St-Basil-le-Grand', racine + 'gr/e/e5_st_basil_fr.html'],
			['Ste-Sophie', racine + 'gr/e/e7_ste_sophie_fr.html'],
			['Ste-Marie-la-Protectrice', racine + 'gr/e/e8_ste_marie_fr.html'],
			['St-Georges', racine + 'gr/e/e9_st_george_fr.html'],
		],
		['Institutions financières', racine + 'gr/banks_fr.html'],
		['Culture et éducation', racine + 'gr/culture_fr.html'],
		['Médias', racine + 'gr/media_fr.html'],
		['Organismes', racine + 'gr/organismes_fr.html'],
		['Services sociaux', racine + 'gr/services_fr.html'],
		['Sport', racine + 'gr/sport_fr.html'],
		['Statistiques', racine + 'gr/stats_fr.html'],
	],
	['PUBLICATIONS', null,
		[cImg + 'Ukrainiens au Québec', racine + 'lib/quebec/index.html',
			['Les Trois Solitudes', racine + 'lib/quebec/trois_solitudes_intro.html'],
			['L\'Internement des Ukrainiens au Québec', racine + 'lib/quebec/maltraites_1.html'],
			['Le Mouvement des Femmes Ukrainiennes au Québec', racine + 'lib/quebec/mouvement_des_femmes_01.html'],
			['La Vie Musicale Ukrainienne à Montréal', racine + 'lib/quebec/vie_musicale_01.html'],
			['L\'Apport des Ukrainiens à l\'Effort de Guerre', racine + 'lib/quebec/militaire_01.html'],
			['L\'Entretien avec Levko Lukianenko', racine + 'lib/quebec/levko_lukianenko.html'],
		],
		[cImg + 'Génocide en Ukraine', racine + 'lib/holodomor/index.html',
			['Analyse du génocide ukrainien', racine+'lib/holodomor/genocide_en_ukraine.html'],
			['Liste de documents', racine + 'lib/holodomor/21_liste.html'],
			['Annexe', racine + 'lib/holodomor/23_annexe.html'],
			['Glossaire', racine + 'lib/holodomor/24_glossaire.html'],
		],
		[cImg + 'Ressources historiques', racine + 'lib/sources/index.html',
			['Les problèmes ukrainiens et la paix européenne', racine+'lib/sources/sidobre_00.html'],
			['L\'Ukraine des origines à Staline', racine + 'lib/sources/benoist_mechin_00.html'],
		],

	],
	['FORUMS', racine + 'fforum/index.php',
		['Rue de l\'Ukraine', racine + 'fforum/index.php?c=1'],
		['Immigration',  racine + 'fforum/index.php?c=2'],
		['Annonces',  racine + 'fforum/index.php?c=3'],
	],
  ];
  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 ('opacity:0.90;');
	document.write ('filter: progid:DXImageTransform.Microsoft.Alpha(opacity=90);');
	document.write ('-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=50)";');
	document.write ('zoom:1;');
 }

 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_fr() {
 var dirNum = Math.floor(Math.random()*30) + 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_fr.html';
 galleryUri[2] = '2004_new_year_1_fr.html';
 galleryUri[3] = '2004_malanka_sport_fr.html';
 galleryUri[4] = '2004_kutia_1_fr.html';
 galleryUri[5] = '2004_montreal_en_lumiere_fr.html';
 galleryUri[6] = '2004_st_patrick_day_1_fr.html';
 galleryUri[7] = '2004_concordia_fr.html';
 galleryUri[8] = '2004_bandurist_fr.html';
 galleryUri[9] = '2004_sum_party_fr.html';
 galleryUri[10] = '2004_marunczhak_recital_fr.html';
 galleryUri[11] = '2004_rachel_fr.html';
 galleryUri[12] = '2004_zeleni_sviata_fr.html';
 galleryUri[13] = '2004_st_helene_fr.html';
 galleryUri[14] = '2004_troyanda_et_kolo_fr.html';
 galleryUri[15] = '2004_festival_1_fr.html';
 galleryUri[16] = '2004_pere_noel_fr.html';
 galleryUri[17] = "2004_square_victoria_fr.html";
 galleryUri[18] = "2004_parliament_fr.html";
 galleryUri[19] = "2004_candlelight_fr.html";
 galleryUri[20] = "2005_new_year_fr.html";
 galleryUri[21] = "2005_st_patrick_day_1_fr.html";
 galleryUri[22] = "2005_nouvelle_france_fr.html";
 galleryUri[23] = "2005_festival_fr.html";
 galleryUri[24] = "2006_st_patrick_day_fr.html";
 galleryUri[25] = "2006_festival_fr.html";
 galleryUri[26] = "2007_st_patrick_day_fr.html";
 galleryUri[27] = "2007_festival_st_viateur_fr.html";
 galleryUri[28] = "2007_fete_nationale_fr.html";
 galleryUri[29] = "2007_festival_ukrainien_montreal.html";
 galleryUri[30] = "2008_st_patrick_day_fr.html";
 var string = '<a href="gal/' + dirNum + '/' + fotoNum + '.jpg" target="_blanc"><IMG src="gal/';
 string += dirNum +'/'+ fotoNum +'s.jpg" alt="Clickez sur l\'image \npour son affichage';
 string += ' en taille agrandie (600&#215;449 px)" width=160 height=120 ';
 string += 'style="BORDER:#000 1px solid;"></a>';
 string += '<br><a href="gal/' + galleryUri[dirNum] + '" class="wt">Visionner cette gallerie</a>';
 document.write(string);
}

