/* 
  GALLERY SCRIPT; IE4+, NS4+
  Author: Hristo Drumev
  ver.: 2003-11-18
*/

// gallery items
// src - image source; alt - hint of image
var items=[
{src:'img/gal/big/01.jpg',alt:'Икона на Свети Димитър'},
{src:'img/gal/big/02.jpg',alt:'Паметника на Хаджи Димитър'},
{src:'img/gal/big/03.jpg',alt:'Градинката зад паметника на Хаджи Димитър"'},
{src:'img/gal/big/04.jpg',alt:'Изглед от Градската градина'},
{src:'img/gal/big/05.jpg',alt:'Община Сливен'},
{src:'img/gal/big/06.jpg',alt:'Панорамен изглед на град Сливен'},
{src:'img/gal/big/07.jpg',alt:'Поглед към Сливен'},
{src:'img/gal/big/09.jpg',alt:'Детайлна снимка на град Сливен'},
{src:'img/gal/big/10.jpg',alt:'Стария Сливен от въздуха'},
{src:'img/gal/big/11.jpg',alt:'Обща снимка на Сливен'},
{src:'img/gal/big/12.jpg',alt:'Поглед към новия център'},
{src:'img/gal/big/13.jpg',alt:'Панорамен изглед на град Сливен'},
{src:'img/gal/big/14.jpg',alt:'Халката'},
{src:'img/gal/big/15.jpg',alt:'Хисарлъка'},
{src:'img/gal/big/16.jpg',alt:'Поглед към Площада и ПМГ "Добри Чинтулов"'},
{src:'img/gal/big/17.jpg',alt:'Поглед към Площада, Съдебната палата, Общината и Часовника'},
{src:'img/gal/big/18.jpg',alt:'Старият бряст'},
{src:'img/gal/big/19.jpg',alt:'Главната улица на града'},
{src:'img/gal/big/20.jpg',alt:'Старият бряст'},
{src:'img/gal/big/21.jpg',alt:'Община Сливен'},
{src:'img/gal/big/22.jpg',alt:'Часовника'},
{src:'img/gal/big/23.jpg',alt:'Площада пред община Сливен'},
{src:'img/gal/big/24.jpg',alt:'Градинката пред паметника на Х. Димитър'},
{src:'img/gal/big/25.jpg',alt:'Общ изглед на община Сливен'},
{src:'img/gal/big/26.jpg',alt:'Драматичен театър "Стефан Киров"'},
{src:'img/gal/big/27.jpg',alt:'Историческия музей'},
{src:'img/gal/big/28.jpg',alt:'Двор на къща в Стария Сливен'},
{src:'img/gal/big/29.jpg',alt:'Новата автогара'},
{src:'img/gal/big/30.jpg',alt:'Поглед към новото корито на река Асеновска'},
{src:'img/gal/big/31.jpg',alt:'Панорамен изглед на Сливен малко преди залез слънце'},
{src:'img/gal/big/32.jpg',alt:'Главната улица на Сливен през Коледните празници'},
{src:'img/gal/big/33.jpg',alt:'Коледната елха'},
{src:'img/gal/big/34.jpg',alt:'Регионална библиотека "Сава Доброплодни"'},
{src:'img/gal/big/35.jpg',alt:'Нощният живот в Сливен'},
{src:'img/gal/big/36.jpg',alt:'Катедрален храм "Свети Димитър"'}];

// gallery items
// src - image source; alt - hint of image
var itemsen=[
{src:'img/gal/big/01.jpg',alt:'An icon of St. Dimitar'},
{src:'img/gal/big/02.jpg',alt:'The monument of Hadji Dimitar'},
{src:'img/gal/big/03.jpg',alt:'The garden behind to the monument of Hadji Dimitar"'},
{src:'img/gal/big/04.jpg',alt:'A view from "The city`s garden"'},
{src:'img/gal/big/05.jpg',alt:'Municipality of Sliven'},
{src:'img/gal/big/06.jpg',alt:'A large view of the city'},
{src:'img/gal/big/07.jpg',alt:'A view to Sliven'},
{src:'img/gal/big/09.jpg',alt:'Detailed picture on the city'},
{src:'img/gal/big/10.jpg',alt:'An air view of the city'},
{src:'img/gal/big/11.jpg',alt:'A view of the city'},
{src:'img/gal/big/12.jpg',alt:'A view to the new city center'},
{src:'img/gal/big/13.jpg',alt:'A panoramic view of the city'},
{src:'img/gal/big/14.jpg',alt:'The Ring'},
{src:'img/gal/big/15.jpg',alt:'Histoty place "Hisarlaka"'},
{src:'img/gal/big/16.jpg',alt:'The square with High school of mathematics and scince "D. Chintulov"'},
{src:'img/gal/big/17.jpg',alt:'"A view of the main city`s aquare, the Law Courts, Municipality Sliven and the city`s Clock"'},
{src:'img/gal/big/18.jpg',alt:'The old elm-tree'},
{src:'img/gal/big/19.jpg',alt:'The city`s main street'},
{src:'img/gal/big/20.jpg',alt:'The old elm-tree'},
{src:'img/gal/big/21.jpg',alt:'Municipality of Sliven'},
{src:'img/gal/big/22.jpg',alt:'The Clock'},
{src:'img/gal/big/23.jpg',alt:'The square in front of the Municipality of Sliven'},
{src:'img/gal/big/24.jpg',alt:'The garden in fornt of the monument of Hadji Dimitar'},
{src:'img/gal/big/25.jpg',alt:'Municipality of Sliven'},
{src:'img/gal/big/26.jpg',alt:'"Stefan Kirov" drama theatre'},
{src:'img/gal/big/27.jpg',alt:'Historic museum'},
{src:'img/gal/big/28.jpg',alt:'An yard in a house in the old part of the city'},
{src:'img/gal/big/29.jpg',alt:'The new bus station'},
{src:'img/gal/big/30.jpg',alt:'A view of the new rivar-bank of river "Asenocska"'},
{src:'img/gal/big/31.jpg',alt:'A panoramic view of the city just before sunset'},
{src:'img/gal/big/32.jpg',alt:'The main street of the city in Christmas'}, /*:-DDD*/
{src:'img/gal/big/33.jpg',alt:'The christmas tree'},
{src:'img/gal/big/34.jpg',alt:'Regional library "Sava Dobroplodni"'},
{src:'img/gal/big/35.jpg',alt:'The night life in Sliven'},
{src:'img/gal/big/36.jpg',alt:'"St. Dimitar" cathedral temple'}];

window.ns4=document.layers&&!document.getElementById?1:0;

// return object || null if browser is uncompatible {DOM & IE4+}
// id - id of object
// [isImg] - is object image
function get(id,isImg)
{
	if(isImg)return document.images[id];
	if(document.getElementById)return document.getElementById(id);
	else if(window.ie4)return document.all[id];
	else return null;
}

// make changer button
// type - 2 prev || 2 next; 0 - 2 prev, 1 - 2 next
// text - text of link, if = '' no link
// hint - hint of link & image
// src - image src, if = '' no image
// pos - position of link; 0 - before img, 1 - after it
// css - style
function makeBtn(type,text,hint,src,pos,css)
{
	if(window.ns4)return;
	var lnk='<a href="javascript:display('+(type?1:0)+');" title="'+hint+'">';
	var img=lnk+'<img border=0 src="'+src+'" alt="'+hint+'" title="'+hint+'"></а>';
	var tbl='<table border=0 cellpadding=0 cellspacing=0><tr><td valign=middle class="'+css+'">'+(pos?lnk+text+'</a>':img)+'</td><td>&nbsp;</td><td valign=middle class="'+css+'">'+(pos?img:lnk+text+'</a>')+'</td></tr></table>';
	document.write(text==''?img:src==''?lnk+'</a>':tbl);
}

// make gallery container
// items - array w/ items
function makeGallery(items)
{
	window.it=items;
	window.max=items.length-1;
	if(window.ns4)
	{
		document.write('<div align=left>');
		for(var i=0;i<=window.max;i++)document.write('<div>&raquo;&nbsp;<a href="'+window.it[i].src+'" target="_blank">'+window.it[i].alt+'</a></div>');
		document.write('</div>');
	}
	else document.write('<div align=center><img id="g" src="" alt="" title=""></div>');
}

// make hint area
// [css] - css of area
function makeHintArea(css)
{
	if(window.ns4)return;
	document.write('<div id="h"'+((!css)?'':' class="'+css+'"')+'>&nbsp;</div>');
}

// init gallery
// [no] - w/ img number <no>; required correct value
function initGallery(no)
{
	if(window.ns4)return;
	window.c=(!no)?1:no+1;
	window.dom=document.getElementById?1:0;
	window.ie4=document.all&&!window.dom;
	display(0);
}

// display image
// dir - direction; 0 - prev, 1 - next
function display(dir)
{
	window.c=(dir?++window.c:--window.c)>window.max?0:c<0?window.max:window.c;
	get('g',1).src=window.it[window.c].src;
	get('g',1).alt=get('g',1).title=window.it[window.c].alt;
	if(get('h')!=null)get('h').innerHTML=window.it[window.c].alt;
}